Skip to content
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

Generating Annotations for VOC with MaskCut #28

Closed
zqwang21 opened this issue Apr 20, 2023 · 12 comments
Closed

Generating Annotations for VOC with MaskCut #28

zqwang21 opened this issue Apr 20, 2023 · 12 comments

Comments

@zqwang21
Copy link

Hey, thanks for your work!
I have tried to generate anotations for voc with maskcut, but there are garbled characters in the generated json file when it comes to annotation_info.
(The command i ran is python maskcut.py --vit-arch base --patch-size 8 --tau 0.15 --fixed_size 480 --N 3 --num-folder-per-job 1000 --job-index 0 --dataset-path /path/to/dataset/traindir --out-dir /path/to/save/annotations )
image
And I have changed decoding method from ascii to gbk and utf-8, but it still does not work.
image

Do you have any idea about this?

@zqwang21
Copy link
Author

After debugging the maskcut.py, it is found that the value of counts are garbled. Why does it happen? How to solve it ?
image

@zqwang21
Copy link
Author

image

@frank-xwang
Copy link
Collaborator

Hi, the mask annotation is in COCO's Run Length Encoding (RLE) format. You can refer to the discussion here to learn how to convert RLE to the human-readable polygon format.

@frank-xwang
Copy link
Collaborator

By the way, it is recommended to stick with the RLE format for mask annotation unless you have a specific reason to use the polygon format, as the former is more efficient in terms of storage and computation.

@frank-xwang
Copy link
Collaborator

Closing it now. Please feel free to reopen it if you have further questions!

@zqwang21
Copy link
Author

zqwang21 commented Apr 23, 2023 via email

@zqwang21
Copy link
Author

zqwang21 commented Apr 23, 2023 via email

@frank-xwang
Copy link
Collaborator

Hi, could you please resend your questions? There are many &nbsp symbols, it is hard to read your message. Thanks!

@zqwang21
Copy link
Author

zqwang21 commented Apr 23, 2023

Sorry,i rephrase my questions.
i have deleted segmentation, height, and width code in annotation_info which are garbled, in order to generate annotations for voc, because the jsonfile of voc download from github also does not include this part of code.
image

However , after generating the jsonfile and running the command
( python train_net.py --num-gpus 3
--config-file model_zoo/configs/CutLER-ImageNet/cascade_mask_rcnn_R_50_FPN.yaml
--test-dataset cls_agnostic_voc --no-segm
--eval-only MODEL.WEIGHTS "/home/yli/CutLER-main/cutler_cascade_final.pth"), AP50 is 64.58 which is much higher than the value in modelzoo which you offered. Therefore, i compared those two jsonfiles, I found that bbox information in my jsonfile is different from yours. i do not know why there are these differences, do you have any idea?
image

The yellow boxes are my jsonfile visualized results, the red boxes are yours. why are our jsonfiles inconsistent?
image

By the way , my steps are followings:

  1. downlowad VOC2007 JPEGImages

  2. run the command :python maskcut.py --vit-arch base --patch-size 8

  3. specify the jsonfile in cutler/data/datasets/builtin.py

  4. run the command:

    python train_net.py --num-gpus 3
    --config-file model_zoo/configs/CutLER-ImageNet/cascade_mask_rcnn_R_50_FPN.yaml
    --test-dataset cls_agnostic_voc --no-segm
    --eval-only MODEL.WEIGHTS "/home/yli/CutLER-main/cutler_cascade_final.pth")

@zqwang21
Copy link
Author

i also evaluated the model's performance on VOC using the jsonfile download from your github, the result is the same as what you submitted in modelzoo. i feel that my steps are correct, but why my jsonfile generated by maskcut is different from yours?

@zqwang21
Copy link
Author

voc_annotations.zip
This is my jsonfile annotations generated according to the steps described above, do you have any idea why it is different from yours? And how can my result be consistent with yours?

@frank-xwang
Copy link
Collaborator

Answered in #29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants