WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 572 forks source link

Extracting bounding box coordinates #184

Open reigxxxn opened 3 years ago

reigxxxn commented 3 years ago

Previously, I modify the detect.py of YOLOv3 to get the coordinates of the bounding box using GDAL function. I got JPG images with wld file containing coordinates. But for the YOLOv4 the detect.py is using xyxy2wh for getting the x y w h of the bounding box, and it makes me confuse to modify the scripts.

And I also want to get the result in txt files containing the object coordinates for the images.

I am new to coding, so can someone help me?

WongKinYiu commented 3 years ago

you could decide to save xyxy or xywh by modify https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-csp/detect.py#L121-L124

reigxxxn commented 3 years ago

you could decide to save xyxy or xywh by modify https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-csp/detect.py#L121-L124

Thank you for the response. It will be extracting the coordinates based on the images only, right? I need to get the coordinates of the bounding box to match the real coordinates in field, thats why I got .wld files along with the JPG files in my previous YOLOv3 project with GDAL. How to attach the images with .wld and extract the coordinates based on the .wld files?