AlexeyAB / darknet

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

How to find the Position of Objects detected in a video on YOLO? #5080

Open syedbilaal opened 4 years ago

syedbilaal commented 4 years ago

Hi First of all I'm a real noob to coding and all. I found this YOLO and wanted to do something with it.

After downloading YOLO and running it by typing

./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights

I can successfully detect objects in a video but I need to get the position of each object detected like this example output

Video stream: 1920 x 1080 Frame number : 1 Objects:

Frame number : 2 Objects:

bus: 89% , Position : (0.032253, 0.110209), Height and Width : 0.063911, 0.072384

bus: 86% , Position : (0.237973, 0.090691), Height and Width : 0.074506, 0.068445

car: 99% , Position : (0.304282, 0.219430), Height and Width : 0.100312, 0.104738

car: 96% , Position : (0.452458, 0.125739), Height and Width : 0.044005, 0.061994

car: 96% , Position : (0.758392, 0.163063), Height and Width : 0.082789, 0.070389

So how can I know the coordinates of the objects detected. A detailed answer would be really helpful.

blackwool commented 4 years ago

car: 96% , Position : (0.758392, 0.163063), Height and Width : 0.082789, 0.070389 car position box(left ,top, right,bottom): left=(x - width/2 ) frame_width=(0.758392 - 0.070389/2)1920 top=(y - Height /2 ) frame_height=(0.163063- 0.082789/2)1080 right=(x + width/2 ) frame_width=(0.758392 + 0.070389/2)1920 bottom=(y + Height /2 ) frame_height=(0.163063+ 0.082789/2)1080

syedbilaal commented 4 years ago

where should I enter that?

RashikShahjahan commented 3 years ago

@syedbilaal , add something like this at the end of your command:-ext_output > drive/MyDrive/yolov4/result.txt