This repository contains experiments with panoptic segmentation models.
- Clone the repository using
git clone
command. - Open the terminal and go to the project directory using
cd
command. - Create virtual environment using
python -m venv venv
orconda create -n venv python=3.10
command. - Activate virtual environment using
source venv/bin/activate
orconda activate venv
command. - Install poetry using instructions from
here. Use
with the official installer
section. - Set the following option to disable new virtualenv creation:
poetry config virtualenvs.create false
- Install dependencies using
make install_deps
command. - Setup
pre-commit
hooks usingpre-commit install
command. More information aboutpre-commit
you 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 aboutpoetry
you can find here. - If you want to add new tests, use
unittest
library. More information aboutunittest
you can find here. All tests should be placed in thetests
directory. - All commits should be checked by
pre-commit
hooks. If you want to skip this check, usegit commit --no-verify
command. But it is not recommended to do this. - Also, you can run
pre-commit
hooks manually usingpre-commit run --all-files
command. - More useful commands you can find in
Makefile
.
- Setup environment and install dependencies (previous section).
- Download
Cityscapes
dataset and extract it to thedata
directory.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
Cityscapes
dataset toCOCO
format: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.py
to themmdetection/mmdet/datasets
directory. Also, add an import of theCityscapesPanopticDataset
class to themmdetection/mmdet/datasets/__init__.py
file. 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