ssaru / convert2Yolo

This project purpose is convert voc annotation xml file to yolo-darknet training file format
458 stars 182 forks source link

More specific example #7

Open Luxato opened 5 years ago

Luxato commented 5 years ago

Hello @ssaru ,

I'm trying to execute the script like this: python example.py --datasets KITTI --img_path ./images/000021.jpg --label ./images/000021.txt --convert_output_path test.txt --img_type ".jpg" --manipast_path manipast.txt --cls_list_file names.txt

But it doesn't work. I don't understand what is manipast_path. Would it be possible to add a more specific example where all the files are present in the git repository?

Thank you.

ssaru commented 5 years ago

Hi @Luxato Ok I will adding more specific example

would you seperate image folder and label folder like ./images/000021.jpg and ./labels/000021.txt

and then execute script file --img_path and --label and --convert_output_path and --manipast_path is just directory path, not file path.

manifast file is just need for darknet framework

python3 example.py --datasets KITTI --img_path ./example/kitti/images/ --label ./example/kitti/labels/ --convert_output_path ./ --img_type ".jpg" --manipast_path ./ --cls_list_file names.txt
Luxato commented 5 years ago

@ssaru Thanks for the effort. Would it be possible to also add an example for converting COCO? COCO comes with multiple label files:

captions_train2017.json captions_val2017.json instances_train2017.json instances_val2017.json person_keypoints_train2017.json person_keypoints_val2017.json

Which one should I put into --label folder/ ?

ssaru commented 5 years ago

@Luxato

COCO dataset case is filepath! like a --label folder/instances_train2017.json

caption_train & person_keypoints json file is not detection label

i will add contents later :)

yjdeveloper commented 5 years ago

@ssaru Would it be possible to also add an example for converting VOC to YOLO format?

ssaru commented 5 years ago

Hi @yjdeveloper ok i will update until tomorrow

ssaru commented 5 years ago

@Luxato , @yjdeveloper pushed specific example (COCO, VOC)

would you check README?

Luxato commented 5 years ago

@ssaru Thank you. This is just a minor error but when I tried to run COCO according to README I found out that some annotations in .names file are missing.

The error looks like this

YOLO Generating Result : False, msg : ERROR : 'motorcycle' is not in list, moreInfo : <class 'ValueError'> Format.py 704

So I had to add these annotations to the list:

motorcycle potted plant dining table tv couch airplane

ssaru commented 5 years ago

@Luxato thanks for error reporting i will update soon!

yjdeveloper commented 5 years ago

Thank you. I have one question but it is not related to your post. I have 80 images of number plates and used 20% in testing and rest all in the training phase. I have used YOLO to detect the number plates and it is working for some images only. For some images, I can see two bounding boxes. Can you please advise me on this.

Note: I have only one class.

On Tue, Nov 27, 2018 at 11:28 AM Martin Hwang notifications@github.com wrote:

@Luxato https://github.com/Luxato thanks for error reporing i will update soon!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ssaru/convert2Yolo/issues/7#issuecomment-441904936, or mute the thread https://github.com/notifications/unsubscribe-auth/AOpLWHmGmK6SPW5qtP2GMKfqklv_OFi8ks5uzL-CgaJpZM4YnIfT .

-- Regards

(YONTEN JAMTSHO) Associate Lecturer (Computer Science) Department of Mathematics and Computer Science Sherubtse College : Kanglung (+975) 17762073

Luxato commented 5 years ago

@yjdeveloper 80 images is a very small number for deep learning. Doesn't your model underfitting?

yjdeveloper commented 5 years ago

Maximum how many images do we need? Please advise me. Thank you very much.

On Tue, Nov 27, 2018, 8:55 PM Lukas S. <notifications@github.com wrote:

@yjdeveloper https://github.com/yjdeveloper 80 images is a very small number for deep learning. Doesn't your model underfitting?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ssaru/convert2Yolo/issues/7#issuecomment-442066385, or mute the thread https://github.com/notifications/unsubscribe-auth/AOpLWKlRfBkjCRb7eFhOmRnerDqZqNjiks5uzURrgaJpZM4YnIfT .

Luxato commented 5 years ago

@yjdeveloper For very basic detection 80 could be enough. But I think detecting number plates is much more difficult. In general, for training deep learning model more images you have the better it will be. So I would collect 80 pictures more and compare how results changed. Also, try to increase the detection threshold, that might remove the double bounding boxes.

@ssaru I hit another issue I don't know how to solve. Your script worked fine on the original COCO dataset. What I have done is that I left only one image in the dataset. As you can see on the screenshot, COCO parsing went well, but Generating YOLO failed. Do you know where the problem can be? Thanks.

image

ssaru commented 5 years ago

you left only one image and *.json file had not changed?

would i get dataset as same with you for error reappearance

yjdeveloper commented 5 years ago

@Luxato Can you tell me which file I have to modify to change the threshold value?

Luxato commented 5 years ago

@yjdeveloper Look at this page https://pjreddie.com/darknet/yolo/ especially this part: image

@ssaru, Of course, I have changed the .json file as well. Here is how it looks like: JSON file - http://github.stranovsky.cloud/annotations/instances_val2017_formatted_with_php.json The first image from the COCO dataset - http://github.stranovsky.cloud/images/000000015335.jpg

the command I'm executing it:

python example.py --datasets COCO --img_path ./MYCOCO/images/ --label ./MYCOCO/annotations/instances_val2017_formatted_with_php.json --convert_output_path ./YOLO/ --img_type ".jpg" --manipast_path ./ --cls_list_file ./coco.names

ssaru commented 5 years ago

@Luxato it's information mismatched

COCO json file have image_id key in annotations key.

it should match with id in images key.

but JSON file(http://github.stranovsky.cloud/annotations/instances_val2017_formatted_with_php.json) is not same with image_id in annotations and id in images

yjdeveloper commented 5 years ago

@Luxato Thank you for the information. Now I am using OpenCV to detect the same objects using trained weights from darknet but I am not getting the same output. I have used code from the following GitHub: https://github.com/arunponnusamy/object-detection-opencv/blob/master/yolo_opencv.py.

Please, can you give me some tips on where I can modify?

lionverve2015 commented 5 years ago

@ssaru I am having problems with this: KITTI Parsing Result : False, msg : ERROR : , moreInfo : <class 'StopIteration'> Format.py 484

Do you have any suggestions? Thank You!

Harsh-Vavaiya commented 5 years ago

YOLO Generating Result : False, msg : ERROR : 'M_50s' is not in list, moreInfo : <class 'ValueError'> Format.py 704

ANYONE CAN HELP ME WITH THIS?

alsawaf commented 4 years ago

@ssaru Thank you. This is just a minor error but when I tried to run COCO according to README I found out that some annotations in .names file are missing.

The error looks like this

YOLO Generating Result : False, msg : ERROR : 'motorcycle' is not in list, moreInfo : <class 'ValueError'> Format.py 704

So I had to add these annotations to the list:

motorcycle potted plant dining table tv couch airplane

i'm having same issue can you please explain in details how did you solve it ?

raynbowy23 commented 4 years ago

@alsawaf @Harsh-Vavaiya

Use this labels file instead of suggesting labels. It should work.

https://github.com/amikelive/coco-labels/blob/master/coco-labels-2014_2017.txt