or-objectdetection icon indicating copy to clipboard operation
or-objectdetection copied to clipboard

No detections

Open mesakarghm opened this issue 4 years ago • 9 comments

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

mesakarghm avatar Jul 21 '20 06:07 mesakarghm

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).

richturner avatar Jul 21 '20 08:07 richturner

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 avatar Jul 21 '20 08:07 sieuwe1

@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 avatar Jul 23 '20 04:07 mesakarghm

@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

sieuwe1 avatar Jul 25 '20 09:07 sieuwe1

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

mesakarghm avatar Jul 28 '20 05:07 mesakarghm

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]) ^

feyzaaydogan avatar Aug 30 '20 11:08 feyzaaydogan

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`

DrPlanecraft avatar Nov 12 '20 02:11 DrPlanecraft

I have this problem too! image

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

IndrajitFED avatar Feb 14 '21 09:02 IndrajitFED

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)))

akilavivek avatar Aug 16 '21 18:08 akilavivek