ManivannanMurugavel / YOLO-Annotation-Tool

This is for create the training set of image to YOLO
MIT License
80 stars 58 forks source link

Error while running convert.py #10

Open MuhammadAsadJaved opened 5 years ago

MuhammadAsadJaved commented 5 years ago

Hi, I am facing these errors while running convert.py , I have 1100 images and their corresponding .txt files, but it only convert just one picture.

(yolo) asad@asad-Z370P-D3:~/YOLO-Annotation-Tool$ python convert.py Input:./Labels/001/00923.txt Output:./Labels/output/00923.txt 1 370 131 553 270

['1\n370', '131', '553', '270\n'] 1 370 (1024, 576) Traceback (most recent call last): File "convert.py", line 89, in print(float(xmin), float(xmax), float(ymin), float(ymax)) ValueError: invalid literal for float(): 1 370

ManivannanMurugavel commented 5 years ago

Hi @MuhammadAsadJaved I think the value '1\n370' value convert to float. So the issue is came. We have to split('\n') and get the index 1 value from the list.

Please show me your '00923.txt'. This is more helpfull.

MuhammadAsadJaved commented 5 years ago

this is the information inside "000923.txt" file ,
1 370 131 553 270

Why he is only reading this file? there are about 1105 text files for 1105 images.

ManivannanMurugavel commented 5 years ago

This is reading all txt files but this file only happened the issue.

suravijayjilla commented 5 years ago

Hi,

I am using python 2.7 if I try to convert all txt files to single file it shows the value error. /home/cd005/avengers/bin/python /home/cd005/Downloads/YOLO-Annotation-Tool-master/convert.py Input:./Labels/003/pos-18.txt Output:./Labels/output/pos-18.txt 1 81 144 191 248

['1\n81', '144', '191', '248\n'] 1 81 Traceback (most recent call last): File "/home/cd005/Downloads/YOLO-Annotation-Tool-master/convert.py", line 89, in print(float(xmin), float(xmax), float(ymin), float(ymax)) ValueError: invalid literal for float(): 1 81 (375, 400)

Process finished with exit code 1

Values in pos-18.txt file:: 1 81 144 191 248

Please give some suggestion to rectify this issue.