From 13c7f09bcdfd9231f95c0b0e48e8ae0de9eb6cf1 Mon Sep 17 00:00:00 2001 From: Alexander Kolesnikov Date: Tue, 12 Jul 2022 10:57:05 +0000 Subject: [PATCH] Make converters "importable" --- CONVERTERS.md | 4 ++-- ...ic_coco_format.py => twochannels2panoptic_coco_format.py} | 0 setup.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename converters/{2channels2panoptic_coco_format.py => twochannels2panoptic_coco_format.py} (100%) diff --git a/CONVERTERS.md b/CONVERTERS.md index 2130a9e..95b213c 100644 --- a/CONVERTERS.md +++ b/CONVERTERS.md @@ -58,10 +58,10 @@ In COCO stuff segmentation challenge 2017 all thing classes were merged into one In the panoptic segmentation [paper](https://arxiv.org/abs/1801.00868) naive format to store panoptic segmentation is proposed. We call the format *2 channel format*. Each segment is defined by two labels: (1) semantic category label and (2) instance ID label. Together this two labels form a unique pair that distinguishes one segment from another. These two labels are stored as first two channels of a PNG file correspondingly. Example of panoptic data saved in the 2 channel format can be found in [sample_data/panoptic_examples_2ch_format](https://github.com/cocodataset/panopticapi/blob/master/sample_data/panoptic_examples_2ch_format) folder. -The script `converters/2channels2panoptic_coco_format.py` converts panoptic segmentation prediction from 2 channels format to COCO panoptic format: +The script `converters/twochannels2panoptic_coco_format.py` converts panoptic segmentation prediction from 2 channels format to COCO panoptic format: ``` bash -python converters/2channels2panoptic_coco_format.py \ +python converters/twochannels2panoptic_coco_format.py \ --source_folder sample_data/panoptic_examples_2ch_format \ --images_json_file sample_data/images_info_examples.json \ --prediction_json_file converted_data/panoptic_coco_from_2ch.json diff --git a/converters/2channels2panoptic_coco_format.py b/converters/twochannels2panoptic_coco_format.py similarity index 100% rename from converters/2channels2panoptic_coco_format.py rename to converters/twochannels2panoptic_coco_format.py diff --git a/setup.py b/setup.py index 9881f00..ad2ce6e 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,9 @@ setup( name='panopticapi', - packages=['panopticapi'], - package_dir = {'panopticapi': 'panopticapi'}, + packages=['panopticapi', 'panopticapi_converters'], + package_dir = {'panopticapi': 'panopticapi', + 'panopticapi_converters': 'converters'}, install_requires=[ 'numpy', 'Pillow',