GithubHelp home page GithubHelp logo

Comments (7)

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

Hi Yun,

pan = pan_format[:,:,0] + 256 * pan_format[:,:,1] + 256*256*pan_format[:,:,2]
This line converts RGB values to IDs that encode different segments in panoptic COCO format. Please see, note 2 in panoptic segmentation section of COCO data format.

When I print the results after converting to the COCO instance format, it seems that there are all the binary encoding for the "segmentation" rather than the decimal code as the COCO instance format.

Original COCO segmentations are stored as polygons (decimal code represents their vertices) instance_data.py stores in the "segmentation" field RLE encoding of the corresponding mask. Note that COCO API supports the format as well as the polygon description. Current version of Detectron, however, does not support RLE encoded segments. There is a pull request you can use to add the support.

I hope this answers your question. Let me know if something else is not clear.

from panopticapi.

karenyun avatar karenyun commented on July 22, 2024

Hi, thanks for your quick reply, I will read them carefully!

from panopticapi.

karenyun avatar karenyun commented on July 22, 2024

Hi @alexander-kirillov,

Sorry to bother you again, when I make the PNG file I only know the color of different categories while for different segments which belong to the same class in the same image how to diff them in color format, I find in the gt_png file, it does not simple as changing the last channel. So I have some problems when making the "id" for every segment. Could you give some suggestions?

Thanks very much!

from panopticapi.

karenyun avatar karenyun commented on July 22, 2024

Hi, I think I have known how to make it, thanks!

from panopticapi.

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

Hi Shen,

In general, IDs are arbitrary. So you can assign any color to each segment except [0, 0, 0]. The only requirement - for different segments in the same image colors must be different.

If you want IDs that look nice, then there is a class ColorGenerator in format_converter.py script. This class allows to generate colors for segments so that they are similar to class color but each segment will have a unique color. I hope this helps in your case.

from panopticapi.

karenyun avatar karenyun commented on July 22, 2024

got it, thanks!

from panopticapi.

ranjiewwen avatar ranjiewwen commented on July 22, 2024

Hi Shen,

In general, IDs are arbitrary. So you can assign any color to each segment except [0, 0, 0]. The only requirement - for different segments in the same image colors must be different.

If you want IDs that look nice, then there is a class ColorGenerator in format_converter.py script. This class allows to generate colors for segments so that they are similar to class color but each segment will have a unique color. I hope this helps in your case.

i also have some question:
#15

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.