facebookresearch / CutLER

Code release for "Cut and Learn for Unsupervised Object Detection and Instance Segmentation" and "VideoCutLER: Surprisingly Simple Unsupervised Video Instance Segmentation"
Other
923 stars 89 forks source link

Generating Annotations for VOC with MaskCut #28

Closed zqwang21 closed 1 year ago

zqwang21 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

image

frank-xwang commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

zqwang21 commented 1 year ago

Hey, i have some new problems!

i have deleted segmentation,height,width code in annotation_info which are grabled  in order to  generate annotations for voc, because the jsonfile of voc  download from github  also  does not include this part of code. 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"), AP is 64.58 which is much higher than the value in modelzoo  which you offered. Therefore, i compared those two jsonfiles,  bbox information in my jsonfile  is much less than yours. i do not why, do you have any idea?

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") ------------------ 原始邮件 ------------------ 发件人: "facebookresearch/CutLER" @.>; 发送时间: 2023年4月23日(星期天) 凌晨2:39 @.>; @.**@.>; 主题: Re: [facebookresearch/CutLER] Generating Annotations for VOC with MaskCut (Issue #28)

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

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zqwang21 commented 1 year ago

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

------------------ 原始邮件 ------------------ 发件人: "facebookresearch/CutLER" @.>; 发送时间: 2023年4月23日(星期天) 凌晨2:39 @.>; @.**@.>; 主题: Re: [facebookresearch/CutLER] Generating Annotations for VOC with MaskCut (Issue #28)

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

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

frank-xwang commented 1 year ago

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

zqwang21 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Answered in #29.