jiwoon-ahn / irn

Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations, CVPR 2019 (Oral)
MIT License
525 stars 100 forks source link

using own dataset #33

Closed SuzannaLin closed 3 years ago

SuzannaLin commented 4 years ago

I am trying to adjust the code to my own dataset. However, I am really struggling since I am not a pro at python.

How can I generate cls_labels.npy for a different dataset? The script make_cls_labels.py does not work. Plus, it makes use of .xml files. Is there an easier way to generate a dictionary with image level labels?

cls_labels_dict = np.load('voc12/cls_labels.npy', allow_pickle=True).item() print(cls_labels_dict) # 2011003271: array([0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)}

Also, my images don't share the same naming conventions as VOC12, so this part of the code creates a ton of problems: def decode_int_filename(int_filename): s = str(int(int_filename))

image

zhangjiyuzjy commented 3 years ago

you can use some segmentation information to get one hot directly. Then you save this to .npy

SuzannaLin commented 3 years ago

Thank you for your answer! I will definitely look into that for my next project.