AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.73k stars 7.96k forks source link

nms for different classes on same object (double detection) (Bus,Car) (Truck,Car) #8025

Open marfis89 opened 3 years ago

marfis89 commented 3 years ago

Hi i want to measure the size of different vehicles. But in some cases i got two classes (Bus,Car) (Truck,Car) for the same object. Is there any Filter/ Idea to elimtate the double detection on the same object. In my understanding NMS works only for the same class.

image

I could filter the deteciton list for the highest confidence and eliminate other detections, but i dont like a hack like this.

using yoloV4 and sort.py for tracking

Best Regards Martin

stephanecharette commented 3 years ago

Is it possible you didn't train enough? How many classes, and what did you use for max batches?

See this example which shows possibly similar results when the network hasn't been fully trained: https://www.ccoderun.ca/programming/2020-01-04_neural_network_training/#Details

marfis89 commented 3 years ago

Is it possible you didn't train enough? How many classes, and what did you use for max batches?

See this example which shows possibly similar results when the network hasn't been fully trained: https://www.ccoderun.ca/programming/2020-01-04_neural_network_training/#Details

Iam using the original yolov4 weights / cfg (coco dataset). Resolution is set to 320x320.

I think Car/Truck/Bus looks too similarly.

Detection output for a single frame, coordinates are identical:

[('car', '38.09', (1303.8668212890625, 623.4581909179688, 430.96990966796875, 265.2787170410156)), ('truck', '31.08', (1303.8668212890625, 623.4581909179688, 430.96990966796875, 265.2787170410156)), ('bus', '22.33', (1303.21435546875, 621.9441528320312, 430.59820556640625, 273.7593078613281))]

haviduck commented 3 years ago

vehicle detection is kinda tricky because of the similarities and different angles. one think id try is to dewarp the fisheye on your camerastream to provide more accurate input for the cocoset. higher threshold, tinker with iou and nms and use a higher resolution for better accuracy