GithubHelp home page GithubHelp logo

Comments (8)

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

You should use panoptic_coco_categories.json from this repo for --categories_json_file. The json file has the right color field.

from panopticapi.

Robotatron avatar Robotatron commented on July 22, 2024 1

@alexander-kirillov

You should use panoptic_coco_categories.json from this repo for --categories_json_file. The json file has the right color field.

Do we have to modify the panoptic_coco_categories.json if we are using a custom dataset with different labels? I am getting an error Exception: Panoptic coco categories file does not contain category with id: 26

from panopticapi.

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

Thanks you for spotting the bug. The code is fixed now. We'll also update annotations later today to add colors there as well.

from panopticapi.

cao-nv avatar cao-nv commented on July 22, 2024

Have you fixed this issue?
I got this problem today. Both panopticapi and annotations files are the latest releases

from panopticapi.

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

There is a delay with the update due to a migration of the COCO storage. I'm sorry! Nevertheless, current data is correct. New files just have the color field and new segment ID encoding, so there is no need in waiting for them now.

You can use panoptic_coco_categories.json file that has the right color for each category. Also, format_converter.py has been fixed and does not require the color field anymore.

from panopticapi.

cao-nv avatar cao-nv commented on July 22, 2024

Sorry if I was wrong, but I found format_converter.py still used keywords color here.

self.taken_colors.add(tuple(category['color']))

This is my command to convert the format, the categories.json was extracted from the annotation json file of the training data.

(.global_env) cao@slspGPU1:~/workspace/data/COCO$ python panopticapi/format_converter.py --source_folder='../../COCO2018/panoptic/val' --images_json_file='annotations/panoptic_val2017.json' --categories_json_file='./annotations/categories.json' --segmentations_folder='val_seg' --predictions_json_file='val.json'

Output of the command! Thanks


Reading image set information from annotations/panoptic_val2017.json
CONVERTING...
2 channels PNG panoptic format:
        Source folder: ../../COCO2018/panoptic/val
TO
COCO format:
        Segmentation folder: val_seg
        JSON file: val.json
Number of cores: 8, images per core: 625
Core: 0, 0 from 625 images converted
Core: 1, 0 from 625 images converted
Core: 2, 0 from 625 images converted
Core: 3, 0 from 625 images converted
Core: 4, 0 from 625 images converted
Core: 5, 0 from 625 images converted
Core: 6, 0 from 625 images converted
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Traceback (most recent call last):
  File "panopticapi/format_converter.py", line 156, in <module>
    args.void)
  File "panopticapi/format_converter.py", line 125, in converter
    annotations.extend(p.get())
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
KeyError: u'color'
Core: 7, 0 from 625 images converted
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'
Caught exception in worker thread:
Traceback (most recent call last):
  File "/mnt/hdd1/cao/workspace/data/COCO/panopticapi/utils.py", line 12, in wrapper
    return f(*args, **kwargs)
  File "panopticapi/format_converter.py", line 69, in convert_single_core
    color_gererator = ColorGenerator(categories)
  File "panopticapi/format_converter.py", line 26, in __init__
    self.taken_colors.add(tuple(category['color']))
KeyError: u'color'

from panopticapi.

cao-nv avatar cao-nv commented on July 22, 2024

sorry for my mistake, and thanks for you support!

from panopticapi.

eliethesaiyan avatar eliethesaiyan commented on July 22, 2024

@alexander-kirillov , the panoptic_annotation(panoptic_train2017 and val) still have no color attribute when using panoptic2detection_coco_format.py , does the detect task needs color in the annotations? by looking in sample data , panoptic_coco_detection_format.json seems to have the color attribute, would you please guide me to the right Panoptic_annotation files(with color attribute), Thank you

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.