Update README.md
Browse files
README.md
CHANGED
|
@@ -34,104 +34,7 @@ Class-incremental/Continual image segmentation (CIS) aims to train an image segm
|
|
| 34 |
- [x] Release the weights in the next few days.
|
| 35 |
- [x] More detailed instructions.
|
| 36 |
|
| 37 |
-
|
| 38 |
-
## 💡 Quick Start
|
| 39 |
-
### 1. Set up environments
|
| 40 |
-
|
| 41 |
-
```bash
|
| 42 |
-
conda create --name simcis python=3.8 -y
|
| 43 |
-
conda activate simcis
|
| 44 |
-
conda install pytorch==1.9.0 torchvision==0.10.0 cudatoolkit=11.1 -c pytorch -c nvidia
|
| 45 |
-
pip install -U opencv-python
|
| 46 |
-
|
| 47 |
-
git clone [email protected]:SooLab/SimCIS.git
|
| 48 |
-
cd SimCIS
|
| 49 |
-
|
| 50 |
-
git clone [email protected]:facebookresearch/detectron2.git
|
| 51 |
-
cd detectron2
|
| 52 |
-
pip install -e .
|
| 53 |
-
pip install git+https://github.com/cocodataset/panopticapi.git
|
| 54 |
-
pip install git+https://github.com/mcordts/cityscapesScripts.git
|
| 55 |
-
cd ..
|
| 56 |
-
pip install -r requirements.txt
|
| 57 |
-
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
#### CUDA kernel for MSDeformAttn
|
| 61 |
-
After preparing the required environment, run the following command to compile CUDA kernel for MSDeformAttn:
|
| 62 |
-
|
| 63 |
-
`CUDA_HOME` must be defined and points to the directory of the installed CUDA toolkit.
|
| 64 |
-
|
| 65 |
-
```bash
|
| 66 |
-
cd mask2former/modeling/pixel_decoder/ops
|
| 67 |
-
sh make.sh
|
| 68 |
-
```
|
| 69 |
-
|
| 70 |
-
## 2. Data Preparation
|
| 71 |
-
|
| 72 |
-
We follow the previous work [Balconpas](https://github.com/jinpeng0528/BalConpas/tree/master) to prepare the training data.
|
| 73 |
-
|
| 74 |
-
Please download the ADE20K dataset and its instance annotation from [here](http://sceneparsing.csail.mit.edu/), then place the dataset in or create a symbolic link to the `./datasets` directory. The structure of data path should be organized as follows:
|
| 75 |
-
```
|
| 76 |
-
ADEChallengeData2016/
|
| 77 |
-
images/
|
| 78 |
-
annotations/
|
| 79 |
-
objectInfo150.txt
|
| 80 |
-
sceneCategories.txt
|
| 81 |
-
annotations_instance/
|
| 82 |
-
annotations_detectron2/
|
| 83 |
-
ade20k_panoptic_{train,val}.json
|
| 84 |
-
ade20k_panoptic_{train,val}/
|
| 85 |
-
ade20k_instance_{train,val}.json
|
| 86 |
-
```
|
| 87 |
-
The directory `annotations_detectron2` is generated by running `python datasets/prepare_ade20k_sem_seg.py`.
|
| 88 |
-
Then, run `python datasets/prepare_ade20k_pan_seg.py` to combine semantic and instance annotations for panoptic annotations and run `python datasets/prepare_ade20k_ins_seg.py` to extract instance annotations in COCO format.
|
| 89 |
-
|
| 90 |
-
To fit the requirements of continual segmentation tasks, run `python continual/prepare_datasets.py` to reorganize the annotations (reorganized annotations will be placed in `./json`).
|
| 91 |
-
|
| 92 |
-
#### Example data preparation
|
| 93 |
-
```bash
|
| 94 |
-
# for Mask2Former
|
| 95 |
-
cd datasets
|
| 96 |
-
wget http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip
|
| 97 |
-
unzip ADEChallengeData2016.zip
|
| 98 |
-
cd ADEChallengeData2016
|
| 99 |
-
wget http://sceneparsing.csail.mit.edu/data/ChallengeData2017/annotations_instance.tar
|
| 100 |
-
tar -xvf annotations_instance.tar
|
| 101 |
-
cd ../..
|
| 102 |
-
python datasets/prepare_ade20k_sem_seg.py
|
| 103 |
-
python datasets/prepare_ade20k_pan_seg.py
|
| 104 |
-
python datasets/prepare_ade20k_ins_seg.py
|
| 105 |
-
|
| 106 |
-
# for continual segmentation
|
| 107 |
-
python continual/prepare_datasets.py
|
| 108 |
-
```
|
| 109 |
-
|
| 110 |
-
## 🔥 Training
|
| 111 |
-
|
| 112 |
-
Download the weights of the base step(step1) from [huggingface](https://huggingface.co/LightningNO1/SimCIS).
|
| 113 |
-
|
| 114 |
-
Please follow the [scripts](./scripts) to train SimCIS!
|
| 115 |
-
|
| 116 |
-
For example:
|
| 117 |
-
|
| 118 |
-
```bash
|
| 119 |
-
bash scripts/pan_100-5.sh
|
| 120 |
-
```
|
| 121 |
-
|
| 122 |
-
## ⚡️ Evaluation
|
| 123 |
-
|
| 124 |
-
Download the weights from [huggingface](https://huggingface.co/LightningNO1/SimCIS).
|
| 125 |
-
|
| 126 |
-
Please follow the [scripts](./scripts) to evaluate SimCIS!
|
| 127 |
-
|
| 128 |
-
For example:
|
| 129 |
-
|
| 130 |
-
```bash
|
| 131 |
-
# 11 means the 11th step(last step for 100-5 setting)
|
| 132 |
-
bash scripts/panoptic_eval.sh 11
|
| 133 |
-
```
|
| 134 |
-
|
| 135 |
|
| 136 |
## 📖 Cite Us
|
| 137 |
If you find this repository useful in your research, please consider giving a star ⭐ and a citation
|
|
|
|
| 34 |
- [x] Release the weights in the next few days.
|
| 35 |
- [x] More detailed instructions.
|
| 36 |
|
| 37 |
+
## PLEASE FOLLOW this [Github Repo](https://github.com/SooLab/SimCIS) to use the weights!!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## 📖 Cite Us
|
| 40 |
If you find this repository useful in your research, please consider giving a star ⭐ and a citation
|