Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No detections #3

Open
mesakarghm opened this issue Jul 21, 2020 · 9 comments
Open

No detections #3

mesakarghm opened this issue Jul 21, 2020 · 9 comments

Comments

@mesakarghm
Copy link

I have been trying to test the model in a pre-recorded video. But unfortunately, there's no any detection being made in the frames. The code seems alright to me? Any idea why this is happening?
Capture

@richturner
Copy link
Member

FYI: This was a proof of concept project carried out by a group of students and therefor support isn't possible (unless one of the students involved are able to help).

@sieuwe1
Copy link
Contributor

sieuwe1 commented Jul 21, 2020

Hi @mesakarghm

First of all I see you are running on windows. I never tested the code on windows so it may be that is giving you trouble. To help you further however I need some info like error messages. Maybe there are some in the terminal?

But if you want to get it running quickly then I recommend you install Ubuntu lts. I think that the video detection thread is crashing because of some missing dependencies.

Greetings

Sieuwe

@mesakarghm
Copy link
Author

mesakarghm commented Jul 23, 2020

@sieuwe1 I did test this on Ubuntu as well as I have a dual booted system and there was no detection there as well. What you should note is, I did perform the test on a prerecorded video, using the external source option in gui.py and changing cv2.videocapture("video path") in tracker.py. Could you recreate the scenario and find out whether the problem lies with the repo or my sytem ? I don't have the openremote manager installed, that shouldn't really be a problem should it?

@sieuwe1
Copy link
Contributor

sieuwe1 commented Jul 25, 2020

@mesakarghm

Can you re clone the entire repo so you start with a fresh unchanged version. And then go to main.py and change at line 18 the "0" to "path to your video file". And then run main.py. Thus should start the yolo detection but bypasses the gui.

Greetings

Sieuwe

@mesakarghm
Copy link
Author

Thanks, that did solve the problem of no detection. The code runs fine now, but there's some kind of weird warning:

NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function "iou" failed type inference due to: non-precise type pyobject
[1] During: typing of argument at D:\Sakar\Computer Vision\flow\or-objectdetection\YOLO_DETECTION\sort.py (37)

File "sort.py", line 37:
def iou(bb_test,bb_gt):

"""
xx1 = np.maximum(bb_test[0], bb_gt[0])
^

@jit

@feyzaaydogan
Copy link

I have a problem like that. I didn't solve it .
File "YOLO_DETECTION\sort.py", line 21:
def iou(bb_test,bb_gt):

"""
xx1 = np.maximum(bb_test[0], bb_gt[0])
^

@DrPlanecraft
Copy link

DrPlanecraft commented Nov 12, 2020

I have this problem too!
I have an output, but once it detects people, it will just crash, full output below
my windows Output:

`[True, True, True, True, True, True, ['person'], True, 0]
['person']
Starting httpd on port 3000...
C:\AI4Y\Finale\OBJ_Detect\YOLO_DETECTION\sort.py:33: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function "iou" failed type inference due to: non-precise type pyobject
During: typing of argument at C:\AI4Y\Finale\OBJ_Detect\YOLO_DETECTION\sort.py (38)

File "sort.py", line 38:
def iou(bb_test,bb_gt):

"""
xx1 = np.maximum(bb_test[0], bb_gt[0])
^

@jit
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\AI4Y\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\envs\AI4Y\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\AI4Y\Finale\OBJ_Detect\YOLO_DETECTION\tracker.py", line 155, in yoloWorker
tracked_objects = mot_tracker.update(detections.cpu())
File "C:\AI4Y\Finale\OBJ_Detect\YOLO_DETECTION\sort.py", line 209, in update
matched, unmatched_dets, unmatched_trks = associate_detections_to_trackers(dets,trks)
File "C:\AI4Y\Finale\OBJ_Detect\YOLO_DETECTION\sort.py", line 153, in associate_detections_to_trackers
if d not in matched_indices[:,0]:
TypeError: tuple indices must be integers or slices, not tuple`

nicburgt added a commit that referenced this issue Dec 7, 2020
@IndrajitFED
Copy link

I have this problem too!
image

Please any one help me on this , i have to show this project...

@akilavivek
Copy link

I had the same issue., Now got Fixed., Try and Follows these steps to fix the bug.

Comment out the import

from scipy.optimize import linear_sum_assignment as linear_assignment

Use pip to install lap

Copy and paste the below function in the sort.py file

def linear_assignment(cost_matrix):
try:
import lap
_, x, y = lap.lapjv(cost_matrix, extend_cost=True)
return np.array([[y[i], i] for i in x if i >= 0])
except ImportError:
from scipy.optimize import linear_sum_assignment
x, y = linear_sum_assignment(cost_matrix)
return np.array(list(zip(x, y)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants