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

using own dataset #33

Closed
SuzannaLin opened this issue Sep 17, 2020 · 2 comments
Closed

using own dataset #33

SuzannaLin opened this issue Sep 17, 2020 · 2 comments

Comments

@SuzannaLin
Copy link

SuzannaLin commented Sep 17, 2020

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
Copy link

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

@SuzannaLin
Copy link
Author

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

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