-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Annotation Per Category using COCO Json #814
Comments
@JSharp4273 , sorry for the bad experience. Please let's look at the issue and come back with a fix. Could use please provide steps to reproduce the bug? Thus it will be easy for us to fix it in short period of time. |
Actually I just labels my dataset, dump the data as MS-COCO JSON.
I can provide you the generated json, and cvat xml files if you want to compare. The cvat xml file seems to be accurate. |
Hi @JSharp4273 It would be very helpful. |
Is there any email address I can send it to you ? |
@azhavoro Hi, when I dump the annotations as a MS-COCO json format, I also have some problems. |
@JSharp4273 Could you please attach files to the comment directly or share via any preferable service (dropbox, etc)? |
@BerryRB Hi, it's expected. For now CVAT supports export of polygons and rectangles only for COCO (https://github.com/opencv/cvat/blob/develop/cvat/apps/annotation/README.md#ms-coco-object-detection). |
@azhavoro Thank you for your reply. How can I get the coco file about point annotation? |
Here are a zip folder with the zip annotations (cvat xml, coco json) |
@BerryRB If you have to use COCO format you can extend existing dump functionality (https://github.com/opencv/cvat/blob/develop/cvat/apps/annotation/coco.py) to handle your case properly. It would be great if you contribute this feature to CVAT. |
@JSharp4273 Thanks, I'll take a look. |
@azhavoro FYI the annotations for class named |
@azhavoro Hi, I tried to add the human key annotation function for cvat. Now I have basically achieved this function by modifying the file (https://github.com/opencv/cvat/blob/develop/utils/coco/converter.py), |
@BerryRB Hi, dumper code is called from here https://github.com/opencv/cvat/blob/3b6961f4db95894229f466cd9b897c5ef3f8db9b/cvat/apps/engine/annotation.py#L722 I suggest you make a copy of dumper function and call it from mentioned function directly for debugging, because it's difficult to debug python |
@azhavoro Thanks for your repIy. I want to copy dumper function from (https://github.com/opencv/cvat/blob/develop/cvat/apps/annotation/coco.py) for debugging. How should I get the file in the form of (file_object, annotations) in the dump function? |
@BerryRB I'm not sure that understand you question correctly, but I try to explain my previous answer. You code should be smth like that: # define new function
def coco_dumper_copy(file_object, annotations):
# copy the dumper code from https://github.com/opencv/cvat/blob/develop/cvat/apps/annotation/coco.py
# Note also you need copy mask_to_polygon function as well
def dump(self, filename, dumper, scheme, host):
# you need to change only the last line:
# execute_python_code("{}(file_object, annotations)".format(dumper.handler), global_vars)
coco_dumper_debug(dump_file, anno_exporter)
|
@azhavoro So I should "with open(filename, 'wb') as dump_file:" to get dump_file. But I don't know what kind of file filename here refers to. Can you provide me a sample file in filename format? Thank you |
@BerryRB Maybe it will be helpful: |
@azhavoro Have you found why the convertion from CVAT xml to MS-COCO json does not compute more than the first annotated image ? |
@JSharp4273 Hi, apologies for the delayed response. What version of CVAT did you use? I tested on the current develop branch: I created the task, upload *.xml provided provided by you and dumped annotation as COCO json. It's completely different from your *.json file. Also I tried to upload the generated json and it seems to look ok. Could you please try the latest develop branch? |
@azhavoro I think you confused my name with the one of someone else. |
@JSharp4273 Yep, sorry about that. If you cloned CVAT via git it's possible obtain exact commit that you use by |
I took a look when the folder for the version of CVAT I used was created. |
@JSharp4273 On my side the latest develop branch works as expected. Since August there have been several fixes to the coco dumper/loader, just try to update. If the update does not solve the issue, let's investigate it further. |
@azhavoro Ok ok I did it I will make a trial tomorrow. |
Hello |
Hello
I finish to annotate a tiny dataset.
This dataset has 4 classes.
I dump the annotations as a MS-COCO json format.
Using
pycocotools
I ask to access the annotations related to 1 of the 4 classes.What I got does not correspond to what I ask, In the annotations returned I got annotations that does cover other annotations as well as the one I asked.
I used
pycocotools
before with different dataset without issues.----Edit----
I pushed further my investigations... the whole convertion is wrong.
I labeled 200 images only, the number of images id is right but the only image that as been converted is the first one and that for each classe.
The text was updated successfully, but these errors were encountered: