forked from facebookresearch/maskrcnn-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support more datasets (facebookresearch#232)
* add force json option * fix the same issue as facebookresearch#185 * bug fix * cityscapes config * update paths catalog * discard config change * organize code for more-datasets * use better representation for coco-style datasets * rename coco-style config * remove import * chmod 644 * make the config more verbose * update readme * rename * chmod
- Loading branch information
1 parent
46dbf29
commit 0f61b00
Showing
9 changed files
with
581 additions
and
27 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
configs/cityscapes/e2e_faster_rcnn_R_50_FPN_1x_cocostyle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
OUT_CHANNELS: 256 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
NUM_CLASSES: 9 | ||
DATASETS: | ||
TRAIN: ("cityscapes_fine_instanceonly_seg_train_cocostyle",) | ||
TEST: ("cityscapes_fine_instanceonly_seg_val_cocostyle",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
BASE_LR: 0.01 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (18000,) | ||
MAX_ITER: 24000 |
41 changes: 41 additions & 0 deletions
41
configs/cityscapes/e2e_mask_rcnn_R_50_FPN_1x_cocostyle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
OUT_CHANNELS: 256 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
NUM_CLASSES: 9 | ||
ROI_MASK_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor" | ||
PREDICTOR: "MaskRCNNC4Predictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 28 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
MASK_ON: True | ||
DATASETS: | ||
TRAIN: ("cityscapes_fine_instanceonly_seg_train_cocostyle",) | ||
TEST: ("cityscapes_fine_instanceonly_seg_val_cocostyle",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
BASE_LR: 0.01 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (18000,) | ||
MAX_ITER: 24000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
configs/pascal_voc/e2e_mask_rcnn_R_50_FPN_1x_cocostyle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
OUT_CHANNELS: 256 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
NUM_CLASSES: 21 | ||
ROI_MASK_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor" | ||
PREDICTOR: "MaskRCNNC4Predictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 28 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
MASK_ON: True | ||
DATASETS: | ||
TRAIN: ("voc_2012_train_cocostyle",) | ||
TEST: ("voc_2012_val_cocostyle",) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
BASE_LR: 0.01 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (18000,) | ||
MAX_ITER: 24000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Setting Up Datasets | ||
This file describes how to perform training on other datasets. | ||
|
||
Only Pascal VOC dataset can be loaded from its original format and be outputted to Pascal style results currently. | ||
|
||
We expect the annotations from other datasets be converted to COCO json format, and | ||
the output will be in COCO-style. (i.e. AP, AP50, AP75, APs, APm, APl for bbox and segm) | ||
|
||
## Creating Symlinks for PASCAL VOC | ||
|
||
We assume that your symlinked `datasets/voc/VOC<year>` directory has the following structure: | ||
|
||
``` | ||
VOC<year> | ||
|_ JPEGImages | ||
| |_ <im-1-name>.jpg | ||
| |_ ... | ||
| |_ <im-N-name>.jpg | ||
|_ Annotations | ||
| |_ pascal_train<year>.json (optional) | ||
| |_ pascal_val<year>.json (optional) | ||
| |_ pascal_test<year>.json (optional) | ||
| |_ <im-1-name>.xml | ||
| |_ ... | ||
| |_ <im-N-name>.xml | ||
|_ VOCdevkit<year> | ||
``` | ||
|
||
Create symlinks for `voc/VOC<year>`: | ||
|
||
``` | ||
cd ~/github/maskrcnn-benchmark | ||
mkdir -p datasets/voc/VOC<year> | ||
ln -s /path/to/VOC<year> /datasets/voc/VOC<year> | ||
``` | ||
Example configuration files for PASCAL VOC could be found [here](https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/configs/pascal_voc/). | ||
|
||
### PASCAL VOC Annotations in COCO Format | ||
To output COCO-style evaluation result, PASCAL VOC annotations in COCO json format is required and could be downloaded from [here](https://storage.googleapis.com/coco-dataset/external/PASCAL_VOC.zip) | ||
via http://cocodataset.org/#external. | ||
|
||
## Creating Symlinks for Cityscapes: | ||
|
||
We assume that your symlinked `datasets/cityscapes` directory has the following structure: | ||
|
||
``` | ||
cityscapes | ||
|_ images | ||
| |_ <im-1-name>.jpg | ||
| |_ ... | ||
| |_ <im-N-name>.jpg | ||
|_ annotations | ||
| |_ instanceonly_gtFile_train.json | ||
| |_ ... | ||
|_ raw | ||
|_ gtFine | ||
|_ ... | ||
|_ README.md | ||
``` | ||
|
||
Create symlinks for `cityscapes`: | ||
|
||
``` | ||
cd ~/github/maskrcnn-benchmark | ||
mkdir -p datasets/cityscapes | ||
ln -s /path/to/cityscapes datasets/data/cityscapes | ||
``` | ||
|
||
### Steps to convert Cityscapes Annotations to COCO Format | ||
1. Download gtFine_trainvaltest.zip from https://www.cityscapes-dataset.com/downloads/ (login required) | ||
2. Extract it to /path/to/gtFine_trainvaltest | ||
``` | ||
gtFine_trainvaltest | ||
|_ gtFine | ||
``` | ||
3. Run the below commands to convert the annotations | ||
|
||
``` | ||
cd ~/github | ||
git clone https://github.com/mcordts/cityscapesScripts.git | ||
cd cityscapesScripts | ||
cp ~/github/maskrcnn-benchmark/tool/cityscapes/instances2dict_with_polygons.py cityscapesscripts/evaluation | ||
python setup.py install | ||
cd ~/github/maskrcnn-benchmark | ||
python tools/cityscapes/convert_cityscapes_to_coco.py --datadir /path/to/gtFine_trainvaltest --outdir /path/to/cityscapes/annotations | ||
``` | ||
|
||
Example configuration files for Cityscapes could be found [here](https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/configs/cityscapes/). |
Oops, something went wrong.