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

json to dataset not working #588

Closed
RuijtenP opened this issue Feb 7, 2020 · 3 comments · Fixed by #589
Closed

json to dataset not working #588

RuijtenP opened this issue Feb 7, 2020 · 3 comments · Fixed by #589
Assignees

Comments

@RuijtenP
Copy link

RuijtenP commented Feb 7, 2020

I get an error when running labelme_json_to_dataset on my json-files.

File "...\anaconda3\envs\labelme\lib\site-packages\imgviz\color.py", line 21, in rgb2gray
assert rgb.shape[2] == 3, 'rgb shape must be (H, W, 3)'

import labelme also not working. (as expected)

So I guess my question: how to get png masks from the json files generated by labelme ?

@wkentaro
Copy link
Member

wkentaro commented Feb 7, 2020

I guess you're using gray or RGBA image instead of RGB, right?

@wkentaro
Copy link
Member

wkentaro commented Feb 7, 2020

So I guess my question: how to get png masks from the json files generated by labelme ?

Please refer to the examples.

wkentaro added a commit that referenced this issue Feb 7, 2020
@wkentaro wkentaro self-assigned this Feb 7, 2020
wkentaro added a commit that referenced this issue Feb 7, 2020
@RuijtenP
Copy link
Author

My utils.img_b64_to_arr command gave a (w,h,4) image, with the last dimension just being the type (uint8 in my case). So I was working with colored images, but solved it by throwing away that last "dimension":

img2 = utils.img_b64_to_arr(imageData)
img= np.zeros((1080,1920,3),np.uint8)
for i in range(1080):
    for j in range(1920):
            img[i][j]=img2[i][j][:-1]

Now it seems to be working fine.

I guess it`s the same type of problem as using gray images.

Thanks for the responses!

codebaragi23 pushed a commit to codebaragi23/mindAT that referenced this issue Dec 23, 2020
0ssamaak0 pushed a commit to 0ssamaak0/DLTA-AI that referenced this issue Apr 5, 2023
0ssamaak0 pushed a commit to 0ssamaak0/DLTA-AI that referenced this issue Apr 15, 2023
0ssamaak0 pushed a commit to 0ssamaak0/DLTA-AI that referenced this issue May 20, 2023
0ssamaak0 pushed a commit to 0ssamaak0/DLTA-AI that referenced this issue May 21, 2023
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

Successfully merging a pull request may close this issue.

2 participants