This repository contains experiments with panoptic segmentation models.
- Clone the repository using
git clonecommand. - Open the terminal and go to the project directory using
cdcommand. - Create virtual environment using
python -m venv venvorconda create -n venv python=3.10command. - Activate virtual environment using
source venv/bin/activateorconda activate venvcommand. - Install poetry using instructions from
here. Use
with the official installersection. - Set the following option to disable new virtualenv creation:
poetry config virtualenvs.create false - Install dependencies using
make install_depscommand. - Setup
pre-commithooks usingpre-commit installcommand. More information aboutpre-commityou can find here. - Run the test to check the correctness of the project work using following
command:
python -m unittest -b
- After successful passing of the tests, you can work with the project!
- If you want to add new dependencies, use
poetry add <package_name>command. More information aboutpoetryyou can find here. - If you want to add new tests, use
unittestlibrary. More information aboutunittestyou can find here. All tests should be placed in thetestsdirectory. - All commits should be checked by
pre-commithooks. If you want to skip this check, usegit commit --no-verifycommand. But it is not recommended to do this. - Also, you can run
pre-commithooks manually usingpre-commit run --all-filescommand. - More useful commands you can find in
Makefile.
- Setup environment and install dependencies (previous section).
- Download
Cityscapesdataset and extract it to thedatadirectory.make download_cityscapes
- You should have the following structure:
data └── cityscapes ├── gtFine │ ├── test │ ├── train │ └── val └── leftImg8bit ├── test ├── train └── val
- Run the following command to convert
Cityscapesdataset toCOCOformat:make convert_cityscapes_to_coco_3
- After that, you should have the following structure:
data └── cityscapes ├── gtFine │ ├── test │ ├── train │ ├── val │ ├── cityscapes_panoptic_val │ ├── cityscapes_panoptic_train │ └── cityscapes_panoptic_test ├── leftImg8bit │ ├── test │ ├── train │ ├── val │ ├── cityscapes_panoptic_val │ ├── cityscapes_panoptic_train │ └── cityscapes_panoptic_test └── annotations ├── cityscapes_panoptic_test.json ├── cityscapes_panoptic_train.json └── cityscapes_panoptic_val.json
- Copy
src/cityscapes_panoptic_dataset.pyto themmdetection/mmdet/datasetsdirectory. Also, add an import of theCityscapesPanopticDatasetclass to themmdetection/mmdet/datasets/__init__.pyfile. Finally, add the following class to__all__list. - Run the following command to start training:
make run_train
- Run the following command to start testing:
make run_test