Skip to content

Commit 53baebd

Browse files
authored
Add files via upload
1 parent 9311dfc commit 53baebd

File tree

100 files changed

+8353
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+8353
-0
lines changed

configs/ocr/Base-RCNN-FPN.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
MODEL:
2+
META_ARCHITECTURE: "GeneralizedRCNN"
3+
BACKBONE:
4+
NAME: "build_resnet_fpn_backbone"
5+
RESNETS:
6+
OUT_FEATURES: ["res2", "res3", "res4", "res5"]
7+
FPN:
8+
IN_FEATURES: ["res2", "res3", "res4", "res5"]
9+
ANCHOR_GENERATOR:
10+
SIZES: [[32], [64], [128], [256], [512]] # One size for each in feature map
11+
ASPECT_RATIOS: [[0.5, 1.0, 2.0]] # Three aspect ratios (same for all in feature maps)
12+
RPN:
13+
IN_FEATURES: ["p2", "p3", "p4", "p5", "p6"]
14+
PRE_NMS_TOPK_TRAIN: 2000 # Per FPN level
15+
PRE_NMS_TOPK_TEST: 1000 # Per FPN level
16+
# Detectron1 uses 2000 proposals per-batch,
17+
# (See "modeling/rpn/rpn_outputs.py" for details of this legacy issue)
18+
# which is approximately 1000 proposals per-image since the default batch size for FPN is 2.
19+
POST_NMS_TOPK_TRAIN: 1000
20+
POST_NMS_TOPK_TEST: 1000
21+
ROI_HEADS:
22+
NAME: "StandardROIHeads"
23+
IN_FEATURES: ["p2", "p3", "p4", "p5"]
24+
NUM_CLASSES: 63
25+
ROI_BOX_HEAD:
26+
NAME: "FastRCNNConvFCHead"
27+
NUM_FC: 2
28+
POOLER_RESOLUTION: 7
29+
ROI_MASK_HEAD:
30+
NAME: "MaskRCNNConvUpsampleHead"
31+
NUM_CONV: 4
32+
POOLER_RESOLUTION: 14
33+
34+

configs/ocr/ctw1500_101_FPN.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
_BASE_: "./Base-RCNN-FPN.yaml"
2+
MODEL:
3+
MASK_ON: True
4+
TEXTFUSENET_MUTIL_PATH_FUSE_ON: True
5+
WEIGHTS: "./out_dir_r101/ctw1500_model/model_ctw_r101.pth"
6+
PIXEL_STD: [57.375, 57.120, 58.395]
7+
RESNETS:
8+
STRIDE_IN_1X1: False # this is a C2 model
9+
NUM_GROUPS: 32
10+
WIDTH_PER_GROUP: 8
11+
DEPTH: 101
12+
ROI_HEADS:
13+
NMS_THRESH_TEST: 0.4
14+
TEXTFUSENET_SEG_HEAD:
15+
FPN_FEATURES_FUSED_LEVEL: 1
16+
POOLER_SCALES: (0.125,)
17+
18+
DATASETS:
19+
TRAIN: ("ctw1500",)
20+
TEST: ("ctw1500",)
21+
SOLVER:
22+
IMS_PER_BATCH: 4
23+
BASE_LR: 0.001
24+
STEPS: (40000,80000,)
25+
MAX_ITER: 120000
26+
CHECKPOINT_PERIOD: 2500
27+
28+
INPUT:
29+
MIN_SIZE_TRAIN: (800,1000,1200)
30+
MAX_SIZE_TRAIN: 1500
31+
MIN_SIZE_TEST: 950
32+
MAX_SIZE_TEST: 1500
33+
34+
35+
OUTPUT_DIR: "./out_dir_r101/ctw1500_model/"

configs/ocr/icdar2013_101_FPN.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
_BASE_: "./Base-RCNN-FPN.yaml"
2+
MODEL:
3+
MASK_ON: True
4+
TEXTFUSENET_MUTIL_PATH_FUSE_ON: True
5+
WEIGHTS: "./out_dir_r101/icdar2013_model/model_ic13_r101.pth"
6+
PIXEL_STD: [57.375, 57.120, 58.395]
7+
RESNETS:
8+
STRIDE_IN_1X1: False # this is a C2 model
9+
NUM_GROUPS: 32
10+
WIDTH_PER_GROUP: 8
11+
DEPTH: 101
12+
ROI_HEADS:
13+
NMS_THRESH_TEST: 0.3
14+
TEXTFUSENET_SEG_HEAD:
15+
FPN_FEATURES_FUSED_LEVEL: 2
16+
POOLER_SCALES: (0.0625,)
17+
18+
DATASETS:
19+
TRAIN: ("icdar2013",)
20+
TEST: ("icdar2013",)
21+
SOLVER:
22+
IMS_PER_BATCH: 4
23+
BASE_LR: 0.001
24+
STEPS: (40000,80000,)
25+
MAX_ITER: 120000
26+
CHECKPOINT_PERIOD: 2500
27+
28+
INPUT:
29+
MIN_SIZE_TRAIN: (800,1000,1200)
30+
MAX_SIZE_TRAIN: 1500
31+
MIN_SIZE_TEST: 800
32+
MAX_SIZE_TEST: 1500
33+
34+
35+
OUTPUT_DIR: "./out_dir_r101/icdar2013_model/"

configs/ocr/icdar2015_101_FPN.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
_BASE_: "./Base-RCNN-FPN.yaml"
2+
MODEL:
3+
MASK_ON: True
4+
TEXTFUSENET_MUTIL_PATH_FUSE_ON: True
5+
WEIGHTS: "./out_dir_r101/icdar2015_model/model_ic15_r101.pth"
6+
PIXEL_STD: [57.375, 57.120, 58.395]
7+
RESNETS:
8+
STRIDE_IN_1X1: False # this is a C2 model
9+
NUM_GROUPS: 32
10+
WIDTH_PER_GROUP: 8
11+
DEPTH: 101
12+
ROI_HEADS:
13+
NMS_THRESH_TEST: 0.35
14+
TEXTFUSENET_SEG_HEAD:
15+
FPN_FEATURES_FUSED_LEVEL: 2
16+
POOLER_SCALES: (0.0625,)
17+
18+
DATASETS:
19+
TRAIN: ("icdar2015",)
20+
TEST: ("icdar2015",)
21+
SOLVER:
22+
IMS_PER_BATCH: 4
23+
BASE_LR: 0.001
24+
STEPS: (40000,80000,)
25+
MAX_ITER: 120000
26+
CHECKPOINT_PERIOD: 2500
27+
28+
INPUT:
29+
MIN_SIZE_TRAIN: (800,1000,1200)
30+
MAX_SIZE_TRAIN: 1500
31+
MIN_SIZE_TEST: 1500
32+
MAX_SIZE_TEST: 3000
33+
34+
35+
OUTPUT_DIR: "./out_dir_r101/icdar2015_model/"

configs/ocr/totaltext_101_FPN.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
_BASE_: "./Base-RCNN-FPN.yaml"
2+
MODEL:
3+
MASK_ON: True
4+
TEXTFUSENET_MUTIL_PATH_FUSE_ON: True
5+
WEIGHTS: "./out_dir_r101/totaltext_model/model_tt_r101.pth"
6+
PIXEL_STD: [57.375, 57.120, 58.395]
7+
RESNETS:
8+
STRIDE_IN_1X1: False # this is a C2 model
9+
NUM_GROUPS: 32
10+
WIDTH_PER_GROUP: 8
11+
DEPTH: 101
12+
ROI_HEADS:
13+
NMS_THRESH_TEST: 0.4
14+
TEXTFUSENET_SEG_HEAD:
15+
FPN_FEATURES_FUSED_LEVEL: 1
16+
POOLER_SCALES: (0.125,)
17+
18+
DATASETS:
19+
TRAIN: ("totaltext",)
20+
TEST: ("totaltext",)
21+
SOLVER:
22+
IMS_PER_BATCH: 4
23+
BASE_LR: 0.001
24+
STEPS: (40000,80000,)
25+
MAX_ITER: 120000
26+
CHECKPOINT_PERIOD: 2500
27+
28+
INPUT:
29+
MIN_SIZE_TRAIN: (800,1000,1200)
30+
MAX_SIZE_TRAIN: 1500
31+
MIN_SIZE_TEST: 800
32+
MAX_SIZE_TEST: 1333
33+
34+
35+
OUTPUT_DIR: "./out_dir_r101/totaltext_model/"

datasets/README.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
For a few datasets that detectron2 natively supports,
3+
the datasets are assumed to exist in a directory called
4+
"datasets/", under the directory where you launch the program.
5+
They need to have the following directory structure:
6+
7+
## Expected dataset structure for COCO instance/keypoint detection:
8+
9+
```
10+
coco/
11+
annotations/
12+
instances_{train,val}2017.json
13+
person_keypoints_{train,val}2017.json
14+
{train,val}2017/
15+
# image files that are mentioned in the corresponding json
16+
```
17+
18+
You can use the 2014 version of the dataset as well.
19+
20+
Some of the builtin tests (`dev/run_*_tests.sh`) uses a tiny version of the COCO dataset,
21+
which you can download with `./prepare_for_tests.sh`.
22+
23+
## Expected dataset structure for PanopticFPN:
24+
25+
```
26+
coco/
27+
annotations/
28+
panoptic_{train,val}2017.json
29+
panoptic_{train,val}2017/
30+
# png annotations
31+
panoptic_stuff_{train,val}2017/ # generated by the script mentioned below
32+
```
33+
34+
Install panopticapi by:
35+
```
36+
pip install git+https://github.com/cocodataset/panopticapi.git
37+
```
38+
Then, run `python prepare_panoptic_fpn.py`, to extract semantic annotations from panoptic annotations.
39+
40+
## Expected dataset structure for LVIS instance segmentation:
41+
```
42+
coco/
43+
{train,val,test}2017/
44+
lvis/
45+
lvis_v0.5_{train,val}.json
46+
lvis_v0.5_image_info_test.json
47+
```
48+
49+
Install lvis-api by:
50+
```
51+
pip install git+https://github.com/lvis-dataset/lvis-api.git
52+
```
53+
54+
## Expected dataset structure for cityscapes:
55+
```
56+
cityscapes/
57+
gtFine/
58+
train/
59+
aachen/
60+
color.png, instanceIds.png, labelIds.png, polygons.json,
61+
labelTrainIds.png
62+
...
63+
val/
64+
test/
65+
leftImg8bit/
66+
train/
67+
val/
68+
test/
69+
```
70+
Install cityscapes scripts by:
71+
```
72+
pip install git+https://github.com/mcordts/cityscapesScripts.git
73+
```
74+
75+
Note:
76+
labelTrainIds.png are created by `cityscapesscripts/preparation/createTrainIdLabelImgs.py`.
77+
They are not needed for instance segmentation.
78+
79+
## Expected dataset structure for Pascal VOC:
80+
```
81+
VOC20{07,12}/
82+
Annotations/
83+
ImageSets/
84+
JPEGImages/
85+
```

datasets/prepare_for_tests.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -e
2+
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
3+
4+
# Download some files needed for running tests.
5+
6+
cd "${0%/*}"
7+
8+
BASE=https://dl.fbaipublicfiles.com/detectron2
9+
mkdir -p coco/annotations
10+
11+
for anno in instances_val2017_100 \
12+
person_keypoints_val2017_100 \
13+
instances_minival2014_100 \
14+
person_keypoints_minival2014_100; do
15+
16+
dest=coco/annotations/$anno.json
17+
[[ -s $dest ]] && {
18+
echo "$dest exists. Skipping ..."
19+
} || {
20+
wget $BASE/annotations/coco/$anno.json -O $dest
21+
}
22+
done

0 commit comments

Comments
 (0)