tony607 / labelme2coco Goto Github PK
View Code? Open in Web Editor NEWHow to create custom COCO data set for instance segmentation
License: Other
How to create custom COCO data set for instance segmentation
License: Other
use width/height from the .json file if no image binhex data exists
Thanks for your excellent article and repo.
When I run labelme2coco with my annotations, I got error:
TypeError: Object of type 'int64' is not JSON serializable
After some tests I noticed I get it because labelme makes my annotations in integer form:
"points": [
[
1389,
1450
],
If I modify it manually in float it works:
"points": [
[
1389.0,
1450.0
],
Maybe you can modify your code to make it compatible with integer annotations?
Line 35 of the labelme2coco.py file has this line:
label = shapes["label"].split("_")
Is there any restriction in COCO format for using '_' in a category?. What about if I have these two categories: tab_cut_left and tab_cut_rigth? Thanks.
为什么关键点的转换不能实现
Hello @Tony607, thank you for the conversion script.
Can you explain why I got this error?
save coco json
Traceback (most recent call last):
File "/content/labelme2coco/labelme2coco.py", line 163, in
labelme2coco(labelme_json, args.output)
File "/content/labelme2coco/labelme2coco.py", line 27, in init
self.save_json()
File "/content/labelme2coco/labelme2coco.py", line 137, in save_json
self.data_transfer()
File "/content/labelme2coco/labelme2coco.py", line 33, in data_transfer
self.images.append(self.image(data, num))
File "/content/labelme2coco/labelme2coco.py", line 51, in image
img = utils.img_b64_to_arr(data["imageData"])
File "/usr/local/lib/python3.6/dist-packages/labelme/utils/image.py", line 18, in img_b64_to_arr
img_data = base64.b64decode(img_b64)
File "/usr/lib/python3.6/base64.py", line 80, in b64decode
s = _bytes_from_decode_data(s)
File "/usr/lib/python3.6/base64.py", line 46, in _bytes_from_decode_data
"string, not %r" % s.class.name) from None
TypeError: argument should be a bytes-like object or ASCII string, not 'NoneType'
First of all, thans for your work!
The latest labelme add 'goup' keyword to indicate seperated parts for the same instance. But as I annotate the images and convert the coco json file using your script, the different parts seem to not belong to the single instance.
Hello @Tony607 , thank you for the script but while running the script I got this error.
What am I doing wrong?
save coco json
Traceback (most recent call last):
File "/content/labelme2coco/labelme2coco.py", line 163, in
labelme2coco(labelme_json, args.output)
File "/content/labelme2coco/labelme2coco.py", line 27, in init
self.save_json()
File "/content/labelme2coco/labelme2coco.py", line 137, in save_json
self.data_transfer()
File "/content/labelme2coco/labelme2coco.py", line 33, in data_transfer
self.images.append(self.image(data, num))
File "/content/labelme2coco/labelme2coco.py", line 51, in image
img = utils.img_b64_to_arr(data["imageData"])
File "/usr/local/lib/python3.6/dist-packages/labelme/utils/image.py", line 18, in img_b64_to_arr
img_data = base64.b64decode(img_b64)
File "/usr/lib/python3.6/base64.py", line 80, in b64decode
s = _bytes_from_decode_data(s)
File "/usr/lib/python3.6/base64.py", line 46, in _bytes_from_decode_data
"string, not %r" % s.class.name) from None
TypeError: argument should be a bytes-like object or ASCII string, not 'NoneType'
hello, I would like to know what's wrong with that, thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.