cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.7k stars 3.02k forks source link

'Annotation has failed' for YOLOv3 object detection in CVAT. #896

Closed PareshKamble closed 4 years ago

PareshKamble commented 4 years ago

Hi!

I want to use YOLOv3 for automatic annotation using CVAT tool. I understand that I need .bin, .xml, mapping.json and interp.py files.

I followed the steps given here for generation of .pb file and IR files subsequently. For the above said task, I used official yolov3 weights and custom attributes from the corresponding cfg file. I successfully generated the IR files.

Later, I used the mapping.json and interp.py files provided here. Now, I had the 4 required files for auto annotation at CVAT.

Finally, I provided these 4 files as YOLOv3 through the model manager option in CVAT GUI for object detection. When I press the Run Auto Annotation button, the process completes with Annotation has Failed message.

Is there something I am missing? Is there any method to know what might have gone wrong? During the process of IR files generation, I kept the yolov3.json file as it is since the custom_attributes were the same in the provided file and that in yolov3.cfg here

Any help would be highly appreciated!

nmanovic commented 4 years ago

@benhoff ,

Do you think you can answer on the question?

benhoff commented 4 years ago

@PareshKamble , can you attach the logs? $ docker logs cvat is the command I believe.

Is there a traceback that is provided when you submit the 4 files? If not, what version of cvat are you using?

PareshKamble commented 4 years ago

Thanks @benhoff for the reply. The command is correct but the log is too big to be attached. Do you want a particular portion of the log to be attached or the complete log?

No traceback is provided when I submit the 4 files. Interestingly, everything works smooth unless I run the auto annotation. How to know the version of cvat? However, I cloned cvat on 23 November 2019. Hope it helps?

I get the below shown message after running the auto annotation. First the message as shown in the left image then the right image. cvat1 cvat

benhoff commented 4 years ago

Version of CVAT sounds fine. What version of OpenVino?

If you're a Python developer, can you run this script and post the traceback?

https://github.com/opencv/cvat/tree/develop/utils/auto_annotation

I don't need the entire log, there should just be a section that talks about the errors. Should talk about exceptions. Likely in the last quarter. You can email it to me, beohoff@gmail.com Or, I can try to induce an error in CVAT and I'll post an example so you know what I mean.

PareshKamble commented 4 years ago

I am using l_openvino_toolkit_p_2019.3.376 version of openvino. I shall mail you the log right away. Thanks!

himalayanZephyr commented 4 years ago

Hi Ben I'm getting the same error when I followed the same process. I've emailed the logs to beohoff@gmail.com

benhoff commented 4 years ago

@himalayanZephyr / @PareshKamble, Thanks for submitting the logs! It looks like it's an issue with the interpret script that is showing in the serializer. Specifically, the serializers ensures that no points are less than or equal to zero. Which means that some of the point values (x0, x1, y0, y1) being submitted are less than zero, and thus I need to add some additional validation into the interp.py script.

I need some additional time to diagnose the issue. If you don't want to wait for me to do that though, I believe that I need to put some additional validation in the lines to check the xmin/ymin and xmax/ymax values here, to ensure that the selected mins are actually mins: https://github.com/opencv/cvat/blob/c0f1854f799c5e28022c1a686e6718db392430ba/utils/open_model_zoo/yolov3/interp.py#L12

Additionally, you could put a print or enforcing statement in this line to ensure that nothing less than zero sneaks in.

I'm a little slammed with some other stuff, but I'll try to get this diagnosed and patched soon.

PareshKamble commented 4 years ago

Hi @benhoff ,

Thank you for your reply. I would try to do what you suggested. However, it would be great if you manage time to rectify the issue.

himalayanZephyr commented 4 years ago

Hi Ben Thanks for your reply.

It seems to work now with some enforcing lines as you suggested.

Also, I noticed the sample mapping file starts with 1, whereas it should start at 0. I noticed that because I mapped my label to 'person', however, it was detecting bicycles.

I just submitted a pull request for this as well.

PareshKamble commented 4 years ago

Hi @himalayanZephyr

Thank you for the commit! It is working for me as well.

benhoff commented 4 years ago

@himalayanZephyr , do you want to submit a pull request into CVAT itself? nmanovic doesn't bite and loves new contributors.

You would need to squash into one commit and add a note in the changelog found here.

I usually use git reset to squash commits. So in your case, $ git reset --soft HEAD~2 would stage the two commits you've made to be committed at once. You could then edit the changelog, add it, and use $ git commit -m (or whatever you preferred workflow is) to add the commit message.

I also end up using $ git push --force origin a lot to overwrite the changes in the remote.

himalayanZephyr commented 4 years ago

@benhoff just submitted a pull request. Thanks for the tips above.

@PareshKamble You can refer to this

benhoff commented 4 years ago

@himalayanZephyr , congrats on your first pull request to CVAT! Thanks for making the code base better!