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.py #529

Closed
qvduoduo1997 opened this issue Dec 27, 2019 · 7 comments
Closed

json_to_dataset.py #529

qvduoduo1997 opened this issue Dec 27, 2019 · 7 comments
Assignees

Comments

@qvduoduo1997
Copy link

qvduoduo1997 commented Dec 27, 2019

when i use json_to_dataset.py home/xxx.json, it can't work, and it will go wrong

�[33m[WARNING]�[0m This script is aimed to demonstrate how to convert theJSON file to a single image dataset, and not to handlemultiple JSON files to generate a real-use dataset. (�[1mjson_to_dataset.py�[0m:16)
Traceback (most recent call last):
File "c:\users\xxx\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\xxx\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\xxx\Anaconda3\Scripts\labelme_json_to_dataset.exe_main
.py", line 9, in
File "c:\users\xxx\anaconda3\lib\site-packages\labelme\cli\json_to_dataset.py", line 59, in main
label=lbl, img=img, label_names=label_names, loc='rb'
File "c:\users\xxxanaconda3\lib\site-packages\imgviz\label.py", line 113, in label2rgb
legend, aabb1, aabb2, fill=(255, 255, 255))
File "c:\users\xxx\anaconda3\lib\site-packages\imgviz\draw.py", line 181, in rectangle
xy=(x1, y1, x2, y2), fill=fill, outline=outline, width=width
TypeError: rectangle() got an unexpected keyword argument 'width'

@wkentaro
Copy link
Member

wkentaro commented Dec 28, 2019

Please run pip install -U imgviz

Please run pip install -U pillow

@wkentaro wkentaro self-assigned this Dec 28, 2019
@wkentaro wkentaro added the bug label Dec 28, 2019
@wkentaro
Copy link
Member

Fixed via 967f360f4dfff4857a8ed1212adbb7f812a65f54

Now pip install -U imgviz also works. (you may need --no-cache-dir option)

@qvduoduo1997
Copy link
Author

Thank you very much for your timely help!~谢谢♪(・ω・)ノ

@abhirooptalasila
Copy link

Hi
This issue persists even after installing imgviz and pillow
My code output:
$ labelme_json_to_dataset /home/user/Documents/new.json

[WARNING] This script is aimed to demonstrate how to convert theJSON file to a single image dataset, and not to handlemultiple JSON files to generate a real-use dataset. (json_to_dataset.py:15)
Traceback (most recent call last):
File "/usr/local/bin/labelme_json_to_dataset", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/labelme/cli/json_to_dataset.py", line 61, in main
label=lbl, img=imgviz.asgray(img), label_names=label_names, loc='rb'
File "/usr/local/lib/python3.6/dist-packages/imgviz/label.py", line 160, in label2rgb
legend, aabb1, aabb2, fill=(255, 255, 255)
File "/usr/local/lib/python3.6/dist-packages/imgviz/draw.py", line 188, in rectangle
xy=(x1, y1, x2, y2), fill=fill, outline=outline, width=width
TypeError: rectangle() got an unexpected keyword argument 'width'

@wkentaro
Copy link
Member

wkentaro commented Mar 16, 2020 via email

@abhirooptalasila
Copy link

Hi
I managed to get it working!
When I tried updating pillow it wasn't replacing the default PIL package Ubuntu comes with out of the box. I had to manually remove all associated files/folders regarding PIL and Pillow and reinstall them by running:
sudo apt-get install python-pil
python3 -m pip install image

Thank you and hope this helps others!

@litao-debug
Copy link

labelme: error: unrecognized arguments: -2}'

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

4 participants