NVlabs / mask-auto-labeler

Other
159 stars 14 forks source link

How to visualise the pseudo labels also the results of the instance segmentation model #9

Closed tianyufang1958 closed 1 year ago

tianyufang1958 commented 1 year ago

I can successfully run all steps, but I am wondering how I can visualise the pseudo labels on images also the results of the instance segmentation model. The reason I asked is that in the json file of psuedo labels, I got the results like this {"bbox": [657.0, 108.0, 216.0, 146.0], "id": 6104, "category_id": 1, "segmentation": {"size": [1800, 1800], "counts": "mQST1f0bg11O0RYN[OXf1f0gYN\OXf1e0gYN[OXf1g0fYN[OYf1f0eYN\OYf1f0eYN\OYf1f0eYN\OZf1e0dYN^OYf1d0dYN_OZf1c0dYN_O[f1X1N2N2O1N2N2N101N2N1O2M3M3N2N2O001O0010O001O010O000000000000000001O1O3M0O1000M3O1O100O0100O001O1O1O1O0010000O100O01000O00100O010O10O0100O010O1O010O100O010O10O01000O01000O1000O100O101N2M3L4M2O0000000L4O11O1000001O1O1O0010O00000O10O0100O010O010O010O001O1O1O00100O10O01000O100O100O10000O0010O0100O1O100O100O100O1O100O1O1O1O1N2N2O1N3N3M2N2N2N2N1J6K5O1O1O01000O10001O1O8G3N1N2K5J5O2M3N2N2M3M2N3N2L3M4M3M4M3M3N001N2Onbkb1"}, "iscrowd": 0, "area": 31536.0, "image_id": 61422},

The segmentation and counts look very weird without any coordinate information. Could you please let me know what does it mean?

voidrank commented 1 year ago

Hi @tianyufang1958

Thanks for validating MAL!

  1. visualize the pseudo labels? try https://github.com/NVlabs/mask-auto-labeler/blob/main/tools/visualize_anns.py
  2. segmentation and counts look weird? It is what it should look like. The format of counts is RLE, and you can check the format in the official COCO toolkit, check these lines: https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/mask.py#L7
tianyufang1958 commented 1 year ago

Hi @tianyufang1958

Thanks for validating MAL!

  1. visualize the pseudo labels? try https://github.com/NVlabs/mask-auto-labeler/blob/main/tools/visualize_anns.py
  2. segmentation and counts look weird? It is what it should look like. The format of counts is RLE, and you can check the format in the official COCO toolkit, check these lines: https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/mask.py#L7

Thanks for your reply. I will have a go.

liusurufeng commented 1 year ago

@tianyufang1958 Hi, I'm sorry to bother you! I trained a Multiple Instance Learning (MAL) model on my own dataset to generate labels, and I encountered a situation similar to yours. The segmentation results seem to be based on the entire bounding box area rather than accurate segmentation. If it's possible, could you please share how you resolved this issue?

My annotation situation is as follows: "annotations": [{"bbox": [36.0, 232.0, 8.0, 9.0], "id": 2, "category_id": 1, "segmentation": {"size": [256, 256], "counts": "XW9:f7000000000000000h`d1"}, "iscrowd": 0, "area": 72.0, "image_id": 1}, {"bbox": [4.0, 223.0, 20.0, 14.0], "id": 4, "category_id": 1, "segmentation": {"size": [256, 256], "counts": "oV1?a7000000000000000000000000000000000000000Qai1"}, "iscrowd": 0, "area": 280.0, "image_id": 1}, {"bbox": [188.0, 251.0, 18.0, 5.0], "id": 6, "category_id": 1, "segmentation": {"size": [256, 256], "counts": "kW_15k700000000000000000000000000000000000UP<"}, "iscrowd": 0, "area": 90.0, "image_id": 1}。

liusurufeng commented 1 year ago

@voidrank Hi, If in the annotation file I generate: "segmentation": {"size": [256, 256], "counts": "PPd09g70000000000000000000000000P`X11} If the generated counts are all chaotic, how should they be handled?

voidrank commented 1 year ago

@liusurufeng Check this repo for detail https://github.com/cocodataset/cocoapi