Giter Site home page Giter Site logo

labelme2coco's People

Contributors

tony607 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

labelme2coco's Issues

Object of type 'int64' is not JSON serializable

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?

Why do you separate categories splitting by '_'?

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.

Error while saving the COCO format

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'

Seems not support new 'group' feature of labelme

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.

Error while saving JSON file

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.