Open adnankarol opened 3 years ago
Hi, first you have negative bounding boxes. Try imgaug. x1,y1 is top-most coords and w = x2-x1. Center coords are just x1 + 0.5w. So if you want to convert yolov3 keras format to yolo darknet:
import cv2 im = cv2.imread('path/to/your/image.ext') wr, hr = im.shape w = x2-x1 h = y2-y1 cx = x1+0.5*w cy = y1+0.5*h cx, cy = cx / wr, cy / hr w, h = w / wr, h / hr with open("annotation.txt","w+") as f: f.write(f"class {cx} {cy} {w} {h}\n"); f.close()
@AlexeyAB
Output of YOLO class1: 30% (left_x: 1594 top_y: 5 width: 823 height: 398) class2: 89% (left_x: 1624 top_y: 11 width: 766 height: 384)
Ground Truth File class2 0.6834710743801653 -0.0007513148009012858 0.9954545454545455 0.9984973703981965 class1 0.6875436293114982 0.00983195749251466 0.9105397751844504 0.989553997972583
I need to Transform the Output of YOLO to Ground Truth File ---- MAIN DOUBT
Format for Ground Truth File : x1min y1min x2max y2max
Format of YOLO :