or-objectdetection
or-objectdetection copied to clipboard
No detections
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?
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).
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
@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?
@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
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):
@jit
I have a problem like that. I didn't solve it .
File "YOLO_DETECTION\sort.py", line 21:
def iou(bb_test,bb_gt):
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):
@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`
I have this problem too!
Please any one help me on this , i have to show this project...
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)))