GithubHelp home page GithubHelp logo

Comments (4)

alexander-kirillov avatar alexander-kirillov commented on July 22, 2024

This error should be fixed now. Can you try it again?

from panopticapi.

mitalbert avatar mitalbert commented on July 22, 2024

@alexander-kirillov I have the same issue.

470 500
480 500
490 500
Traceback (most recent call last):
File "cityscapes_gt_converter/cityscapes_panoptic_converter.py", line 119, in
panoptic_converter(original_format_folder, out_folder, out_file)
File "cityscapes_gt_converter/cityscapes_panoptic_converter.py", line 116, in panoptic_converter
save_json(d, out_file)
File "/home/user/.local/lib/python3.7/site-packages/panopticapi/utils.py", line 99, in save_json
json.dump(d, f)
File "/usr/lib/python3.7/json/init.py", line 179, in dump
for chunk in iterable:
File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.7/json/encoder.py", line 325, in _iterencode_list
yield from chunks
File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.7/json/encoder.py", line 325, in _iterencode_list
yield from chunks
File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/usr/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type int64 is not JSON serializable

The output json files contains all images till {"id": "munster_000173_000019", "width": 2048, "height": 1024, "file_name": "munster_000173_000019_leftImg8bit.png"}], and the first attempt of annotations:

... "annotations": [{"image_id": "frankfurt_000000_000294", "file_name": "frankfurt_000000_000294_gtFine_instanceIds.png", "segments_info": [{"id": 8405120, "category_id": 7, "area":

from panopticapi.

mitalbert avatar mitalbert commented on July 22, 2024

I fixed it by converting numpy int64 to python integer.

Added the

bbox = [x, y, width, height]; int_bbox = [int(value) for value in bbox]

And changed "area": area, to
"area": int(area),

from panopticapi.

zhangliyun9120 avatar zhangliyun9120 commented on July 22, 2024

@Yuyan-Li

I found a solution here:

https://blog.csdn.net/Zhou_yongzhe/article/details/87692052

tested ok!

pls refer to that.

from panopticapi.

Related Issues (20)

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.