Spaces:
Sleeping
Sleeping
neoguojing
commited on
Commit
·
68d34d0
1
Parent(s):
212faa9
init
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitignore +4 -0
- app.py +246 -0
- configs/Base-RCNN-C4.yaml +18 -0
- configs/Base-RCNN-DilatedC5.yaml +31 -0
- configs/Base-RCNN-FPN.yaml +42 -0
- configs/Base-RetinaNet.yaml +25 -0
- configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml +17 -0
- configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml +9 -0
- configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml +9 -0
- configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml +9 -0
- configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml +6 -0
- configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml +9 -0
- configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml +6 -0
- configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml +9 -0
- configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml +6 -0
- configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml +9 -0
- configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml +13 -0
- configs/COCO-Detection/fcos_R_50_FPN_1x.py +11 -0
- configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml +8 -0
- configs/COCO-Detection/retinanet_R_50_FPN_1x.py +11 -0
- configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml +5 -0
- configs/COCO-Detection/retinanet_R_50_FPN_3x.yaml +8 -0
- configs/COCO-Detection/rpn_R_50_C4_1x.yaml +10 -0
- configs/COCO-Detection/rpn_R_50_FPN_1x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.py +8 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml +6 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x.yaml +6 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.py +8 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml +6 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x_giou.yaml +12 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml +9 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml +13 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_regnetx_4gf_dds_fpn_1x.py +34 -0
- configs/COCO-InstanceSegmentation/mask_rcnn_regnety_4gf_dds_fpn_1x.py +35 -0
- configs/COCO-Keypoints/Base-Keypoint-RCNN-FPN.yaml +15 -0
- configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml +8 -0
- configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.py +8 -0
- configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.yaml +5 -0
- configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml +8 -0
- configs/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml +12 -0
- configs/COCO-PanopticSegmentation/Base-Panoptic-FPN.yaml +11 -0
- configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml +8 -0
- configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.py +8 -0
- configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml +5 -0
- configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml +8 -0
.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ipynb_checkpoints/*
|
2 |
+
__pycache__/
|
3 |
+
*.bin
|
4 |
+
.vscode/
|
app.py
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
from functools import partial
|
3 |
+
from pathlib import Path
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
from PIL import Image
|
7 |
+
import torch
|
8 |
+
import numpy as np
|
9 |
+
from gradio_image_prompter import ImagePrompter
|
10 |
+
import sys
|
11 |
+
sys.path.append("..")
|
12 |
+
|
13 |
+
from inference import ModelFactory
|
14 |
+
from face import FaceAlgo
|
15 |
+
from sam_everything import SamAnything
|
16 |
+
|
17 |
+
|
18 |
+
components = {}
|
19 |
+
|
20 |
+
params = {
|
21 |
+
"algo_type": None,
|
22 |
+
"input_image":None
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
def gradio(*keys):
|
27 |
+
if len(keys) == 1 and type(keys[0]) in [list, tuple]:
|
28 |
+
keys = keys[0]
|
29 |
+
|
30 |
+
return [components[k] for k in keys]
|
31 |
+
|
32 |
+
|
33 |
+
algo_map = {
|
34 |
+
"目标检测":"detect",
|
35 |
+
"单阶段目标检测":"onestep_detect",
|
36 |
+
"分类":"classification",
|
37 |
+
"特征提取":"feature",
|
38 |
+
"语义分割":"semantic",
|
39 |
+
"实例分割":"instance",
|
40 |
+
"关键点检测":"keypoint",
|
41 |
+
"全景分割":"panoptic",
|
42 |
+
"YOLO":"yolo",
|
43 |
+
}
|
44 |
+
|
45 |
+
face_algo_map = {
|
46 |
+
"人脸检测":"detect",
|
47 |
+
"人脸识别":"recognize",
|
48 |
+
"人脸比对":"compare",
|
49 |
+
"特征提取":"feature",
|
50 |
+
"属性分析":"attr",
|
51 |
+
}
|
52 |
+
|
53 |
+
def create_ui():
|
54 |
+
with gr.Blocks() as demo:
|
55 |
+
with gr.Tab("基础算法"):
|
56 |
+
with gr.Row():
|
57 |
+
with gr.Column(scale=2):
|
58 |
+
components["algo_type"] = gr.Dropdown(
|
59 |
+
["目标检测","单阶段目标检测", "分类", "特征提取","语义分割","实例分割","关键点检测","全景分割","YOLO"],value="全景分割",
|
60 |
+
label="算法类别",interactive=True
|
61 |
+
)
|
62 |
+
with gr.Column(scale=2):
|
63 |
+
components["submit_btn"] = gr.Button(value="解析")
|
64 |
+
with gr.Row():
|
65 |
+
with gr.Column(scale=2):
|
66 |
+
with gr.Row(elem_id='audio-container'):
|
67 |
+
with gr.Group():
|
68 |
+
components["image_input"] = gr.Image(type="pil",elem_id='image-input',label='输入')
|
69 |
+
with gr.Column(scale=2):
|
70 |
+
with gr.Row():
|
71 |
+
with gr.Group():
|
72 |
+
components["image_output"] = gr.Image(type="pil",elem_id='image-output',label='输出',interactive=False)
|
73 |
+
|
74 |
+
with gr.Row():
|
75 |
+
with gr.Group():
|
76 |
+
components["result_output"] = gr.JSON(label="推理结果")
|
77 |
+
|
78 |
+
with gr.Tab("人脸算法"):
|
79 |
+
with gr.Row():
|
80 |
+
with gr.Column(scale=2):
|
81 |
+
components["face_type"] = gr.Dropdown(
|
82 |
+
["人脸检测","人脸识别", "人脸比对", "特征提取","属性分析"],value="人脸检测",
|
83 |
+
label="算法类别",interactive=True
|
84 |
+
)
|
85 |
+
with gr.Column(scale=2):
|
86 |
+
components["face_submit_btn"] = gr.Button(value="解析")
|
87 |
+
with gr.Row():
|
88 |
+
with gr.Column(scale=2):
|
89 |
+
with gr.Row(elem_id=''):
|
90 |
+
with gr.Group():
|
91 |
+
components["face_input"] = gr.Gallery(elem_id='face-input',label='输入',columns=2,type="pil")
|
92 |
+
with gr.Column(scale=2):
|
93 |
+
with gr.Row():
|
94 |
+
with gr.Group():
|
95 |
+
components["face_image_output"] = gr.Gallery(elem_id='face_image_output',label='输出',columns=2,interactive=False)
|
96 |
+
|
97 |
+
with gr.Row():
|
98 |
+
with gr.Group():
|
99 |
+
components["face_output"] = gr.JSON(label="推理结果")
|
100 |
+
with gr.Tab("SAM everything"):
|
101 |
+
with gr.Row():
|
102 |
+
with gr.Column(scale=2):
|
103 |
+
components["sam_submit_btn"] = gr.Button(value="解析")
|
104 |
+
with gr.Row():
|
105 |
+
with gr.Column(scale=2):
|
106 |
+
with gr.Group():
|
107 |
+
# components["sam_input"] = gr.ImageEditor(elem_id='sam-input',label='输入',type="pil")
|
108 |
+
components["sam_input"] = ImagePrompter(elem_id='sam-input',label='输入',type="pil")
|
109 |
+
with gr.Column(scale=2):
|
110 |
+
with gr.Group():
|
111 |
+
components["sam_output"] = gr.Gallery(elem_id='sam_output',label='输出',columns=1,interactive=False)
|
112 |
+
|
113 |
+
# with gr.Tab("OCR"):
|
114 |
+
|
115 |
+
create_event_handlers()
|
116 |
+
return demo
|
117 |
+
|
118 |
+
|
119 |
+
def create_event_handlers():
|
120 |
+
params["algo_type"] = gr.State("全景分割")
|
121 |
+
params["input_image"] = gr.State()
|
122 |
+
params["face_type"] = gr.State("人脸检测")
|
123 |
+
|
124 |
+
|
125 |
+
components["image_input"].upload(
|
126 |
+
lambda x: x, gradio('image_input'), params["input_image"]
|
127 |
+
)
|
128 |
+
|
129 |
+
components["algo_type"].change(
|
130 |
+
lambda x: x, gradio('algo_type'), params["algo_type"]
|
131 |
+
)
|
132 |
+
|
133 |
+
components["submit_btn"].click(
|
134 |
+
do_refernce,gradio('algo_type','image_input'),gradio("result_output",'image_output')
|
135 |
+
)
|
136 |
+
|
137 |
+
components["face_type"].change(
|
138 |
+
ui_by_facetype, gradio('face_type'), params["face_type"]
|
139 |
+
)
|
140 |
+
|
141 |
+
components["face_submit_btn"].click(
|
142 |
+
do_face_refernce,gradio('face_type','face_input'),gradio("face_output",'face_image_output')
|
143 |
+
)
|
144 |
+
|
145 |
+
# components["sam_input"].upload(
|
146 |
+
# do_sam_everything,gradio('sam_input'),gradio("sam_output")
|
147 |
+
# )
|
148 |
+
|
149 |
+
# components["sam_input"].change(
|
150 |
+
# do_sam_everything,gradio('sam_input'),gradio("sam_output")
|
151 |
+
# )
|
152 |
+
|
153 |
+
components["sam_submit_btn"].click(
|
154 |
+
do_sam_everything,gradio('sam_input'),gradio("sam_output")
|
155 |
+
)
|
156 |
+
|
157 |
+
def do_refernce(algo_type,input_image):
|
158 |
+
# def do_refernce():
|
159 |
+
print("input image",input_image)
|
160 |
+
print(algo_type)
|
161 |
+
|
162 |
+
if input_image is None:
|
163 |
+
gr.Warning('请上传图片')
|
164 |
+
return None
|
165 |
+
algo_type = algo_map[algo_type]
|
166 |
+
factory = ModelFactory()
|
167 |
+
output,output_image = factory.predict(pil_image=input_image,task_type=algo_type)
|
168 |
+
if output_image is None or len(output_image) == 0:
|
169 |
+
return output,None
|
170 |
+
print("output image",output_image[0])
|
171 |
+
return output,output_image[0]
|
172 |
+
|
173 |
+
def ui_by_facetype(face_type):
|
174 |
+
print("ui_by_facetype",face_type)
|
175 |
+
|
176 |
+
|
177 |
+
def do_face_refernce(algo_type,input_images):
|
178 |
+
print("input image",input_images)
|
179 |
+
print(algo_type)
|
180 |
+
|
181 |
+
if input_images is None:
|
182 |
+
gr.Warning('请上传图片')
|
183 |
+
return None,None
|
184 |
+
|
185 |
+
input1 = input_images[0][0]
|
186 |
+
input2 = None
|
187 |
+
algo_type = face_algo_map[algo_type]
|
188 |
+
if algo_type == "compare" and len(input_images) >=2:
|
189 |
+
input2 = input_images[1][0]
|
190 |
+
elif algo_type == "compare" and len(input_images) < 2:
|
191 |
+
gr.Warning('请上传两张图片')
|
192 |
+
return None,None
|
193 |
+
|
194 |
+
m = FaceAlgo() # pragma: no cover
|
195 |
+
out,faces = m.predict(pil_image=input1,pil_image1=input2,algo_type=algo_type)
|
196 |
+
|
197 |
+
return out,faces
|
198 |
+
|
199 |
+
def do_sam_everything(im):
|
200 |
+
sam_anything = SamAnything()
|
201 |
+
print(im)
|
202 |
+
image_pil = im['image']
|
203 |
+
points = im['points']
|
204 |
+
images = None
|
205 |
+
if points is None or len(points) == 0:
|
206 |
+
_, images = sam_anything.seg_all(image_pil)
|
207 |
+
else:
|
208 |
+
point_coords = []
|
209 |
+
box = None
|
210 |
+
for item in points:
|
211 |
+
if item[2] == 1:
|
212 |
+
# 点类型
|
213 |
+
point_coords.append([item[0],item[1]])
|
214 |
+
else:
|
215 |
+
# box类型,只使用最后一个box
|
216 |
+
box = [item[0],item[1],item[3],item[4]]
|
217 |
+
box = np.array(box)
|
218 |
+
|
219 |
+
if box is not None:
|
220 |
+
_, images = sam_anything.seg_with_promp(image_pil,box=box)
|
221 |
+
else:
|
222 |
+
coords = np.array(point_coords)
|
223 |
+
print("point_coords:",coords.shape)
|
224 |
+
_, images = sam_anything.seg_with_promp(image_pil,point_coords=coords)
|
225 |
+
|
226 |
+
return images
|
227 |
+
|
228 |
+
def point_to_mask(pil_image):
|
229 |
+
# 遍历每个像素
|
230 |
+
width, height = pil_image.size
|
231 |
+
print(width, height)
|
232 |
+
points_list = []
|
233 |
+
for x in range(width):
|
234 |
+
for y in range(height):
|
235 |
+
# 获取像素的RGB值
|
236 |
+
pix_val = pil_image.getpixel((x, y))
|
237 |
+
if pix_val[0] != 0 and pix_val[1] != 0 and pix_val[2] != 0:
|
238 |
+
points_list.append((x, y))
|
239 |
+
points_array = np.array(points_list)
|
240 |
+
points_array_reshaped = points_array.reshape(-1, 2)
|
241 |
+
return points_array_reshaped
|
242 |
+
|
243 |
+
if __name__ == "__main__":
|
244 |
+
demo = create_ui()
|
245 |
+
# demo.launch(server_name="10.151.124.137")
|
246 |
+
demo.launch()
|
configs/Base-RCNN-C4.yaml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MODEL:
|
2 |
+
META_ARCHITECTURE: "GeneralizedRCNN"
|
3 |
+
RPN:
|
4 |
+
PRE_NMS_TOPK_TEST: 6000
|
5 |
+
POST_NMS_TOPK_TEST: 1000
|
6 |
+
ROI_HEADS:
|
7 |
+
NAME: "Res5ROIHeads"
|
8 |
+
DATASETS:
|
9 |
+
TRAIN: ("coco_2017_train",)
|
10 |
+
TEST: ("coco_2017_val",)
|
11 |
+
SOLVER:
|
12 |
+
IMS_PER_BATCH: 16
|
13 |
+
BASE_LR: 0.02
|
14 |
+
STEPS: (60000, 80000)
|
15 |
+
MAX_ITER: 90000
|
16 |
+
INPUT:
|
17 |
+
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
|
18 |
+
VERSION: 2
|
configs/Base-RCNN-DilatedC5.yaml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MODEL:
|
2 |
+
META_ARCHITECTURE: "GeneralizedRCNN"
|
3 |
+
RESNETS:
|
4 |
+
OUT_FEATURES: ["res5"]
|
5 |
+
RES5_DILATION: 2
|
6 |
+
RPN:
|
7 |
+
IN_FEATURES: ["res5"]
|
8 |
+
PRE_NMS_TOPK_TEST: 6000
|
9 |
+
POST_NMS_TOPK_TEST: 1000
|
10 |
+
ROI_HEADS:
|
11 |
+
NAME: "StandardROIHeads"
|
12 |
+
IN_FEATURES: ["res5"]
|
13 |
+
ROI_BOX_HEAD:
|
14 |
+
NAME: "FastRCNNConvFCHead"
|
15 |
+
NUM_FC: 2
|
16 |
+
POOLER_RESOLUTION: 7
|
17 |
+
ROI_MASK_HEAD:
|
18 |
+
NAME: "MaskRCNNConvUpsampleHead"
|
19 |
+
NUM_CONV: 4
|
20 |
+
POOLER_RESOLUTION: 14
|
21 |
+
DATASETS:
|
22 |
+
TRAIN: ("coco_2017_train",)
|
23 |
+
TEST: ("coco_2017_val",)
|
24 |
+
SOLVER:
|
25 |
+
IMS_PER_BATCH: 16
|
26 |
+
BASE_LR: 0.02
|
27 |
+
STEPS: (60000, 80000)
|
28 |
+
MAX_ITER: 90000
|
29 |
+
INPUT:
|
30 |
+
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
|
31 |
+
VERSION: 2
|
configs/Base-RCNN-FPN.yaml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
ROI_BOX_HEAD:
|
25 |
+
NAME: "FastRCNNConvFCHead"
|
26 |
+
NUM_FC: 2
|
27 |
+
POOLER_RESOLUTION: 7
|
28 |
+
ROI_MASK_HEAD:
|
29 |
+
NAME: "MaskRCNNConvUpsampleHead"
|
30 |
+
NUM_CONV: 4
|
31 |
+
POOLER_RESOLUTION: 14
|
32 |
+
DATASETS:
|
33 |
+
TRAIN: ("coco_2017_train",)
|
34 |
+
TEST: ("coco_2017_val",)
|
35 |
+
SOLVER:
|
36 |
+
IMS_PER_BATCH: 16
|
37 |
+
BASE_LR: 0.02
|
38 |
+
STEPS: (60000, 80000)
|
39 |
+
MAX_ITER: 90000
|
40 |
+
INPUT:
|
41 |
+
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
|
42 |
+
VERSION: 2
|
configs/Base-RetinaNet.yaml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MODEL:
|
2 |
+
META_ARCHITECTURE: "RetinaNet"
|
3 |
+
BACKBONE:
|
4 |
+
NAME: "build_retinanet_resnet_fpn_backbone"
|
5 |
+
RESNETS:
|
6 |
+
OUT_FEATURES: ["res3", "res4", "res5"]
|
7 |
+
ANCHOR_GENERATOR:
|
8 |
+
SIZES: !!python/object/apply:eval ["[[x, x * 2**(1.0/3), x * 2**(2.0/3) ] for x in [32, 64, 128, 256, 512 ]]"]
|
9 |
+
FPN:
|
10 |
+
IN_FEATURES: ["res3", "res4", "res5"]
|
11 |
+
RETINANET:
|
12 |
+
IOU_THRESHOLDS: [0.4, 0.5]
|
13 |
+
IOU_LABELS: [0, -1, 1]
|
14 |
+
SMOOTH_L1_LOSS_BETA: 0.0
|
15 |
+
DATASETS:
|
16 |
+
TRAIN: ("coco_2017_train",)
|
17 |
+
TEST: ("coco_2017_val",)
|
18 |
+
SOLVER:
|
19 |
+
IMS_PER_BATCH: 16
|
20 |
+
BASE_LR: 0.01 # Note that RetinaNet uses a different default learning rate
|
21 |
+
STEPS: (60000, 80000)
|
22 |
+
MAX_ITER: 90000
|
23 |
+
INPUT:
|
24 |
+
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
|
25 |
+
VERSION: 2
|
configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
LOAD_PROPOSALS: True
|
6 |
+
RESNETS:
|
7 |
+
DEPTH: 50
|
8 |
+
PROPOSAL_GENERATOR:
|
9 |
+
NAME: "PrecomputedProposals"
|
10 |
+
DATASETS:
|
11 |
+
TRAIN: ("coco_2017_train",)
|
12 |
+
PROPOSAL_FILES_TRAIN: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_train_box_proposals_21bc3a.pkl", )
|
13 |
+
TEST: ("coco_2017_val",)
|
14 |
+
PROPOSAL_FILES_TEST: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_val_box_proposals_ee0dad.pkl", )
|
15 |
+
DATALOADER:
|
16 |
+
# proposals are part of the dataset_dicts, and take a lot of RAM
|
17 |
+
NUM_WORKERS: 2
|
configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 101
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-DilatedC5.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 101
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 101
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-DilatedC5.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-DilatedC5.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: False
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
MASK_ON: False
|
4 |
+
WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl"
|
5 |
+
PIXEL_STD: [57.375, 57.120, 58.395]
|
6 |
+
RESNETS:
|
7 |
+
STRIDE_IN_1X1: False # this is a C2 model
|
8 |
+
NUM_GROUPS: 32
|
9 |
+
WIDTH_PER_GROUP: 8
|
10 |
+
DEPTH: 101
|
11 |
+
SOLVER:
|
12 |
+
STEPS: (210000, 250000)
|
13 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/fcos_R_50_FPN_1x.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco import dataloader
|
4 |
+
from ..common.models.fcos import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
dataloader.train.mapper.use_instance_mask = False
|
8 |
+
optimizer.lr = 0.01
|
9 |
+
|
10 |
+
model.backbone.bottom_up.freeze_at = 2
|
11 |
+
train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RetinaNet.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 101
|
6 |
+
SOLVER:
|
7 |
+
STEPS: (210000, 250000)
|
8 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/retinanet_R_50_FPN_1x.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco import dataloader
|
4 |
+
from ..common.models.retinanet import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
dataloader.train.mapper.use_instance_mask = False
|
8 |
+
model.backbone.bottom_up.freeze_at = 2
|
9 |
+
optimizer.lr = 0.01
|
10 |
+
|
11 |
+
train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RetinaNet.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 50
|
configs/COCO-Detection/retinanet_R_50_FPN_3x.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RetinaNet.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 50
|
6 |
+
SOLVER:
|
7 |
+
STEPS: (210000, 250000)
|
8 |
+
MAX_ITER: 270000
|
configs/COCO-Detection/rpn_R_50_C4_1x.yaml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
META_ARCHITECTURE: "ProposalNetwork"
|
4 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
5 |
+
MASK_ON: False
|
6 |
+
RESNETS:
|
7 |
+
DEPTH: 50
|
8 |
+
RPN:
|
9 |
+
PRE_NMS_TOPK_TEST: 12000
|
10 |
+
POST_NMS_TOPK_TEST: 2000
|
configs/COCO-Detection/rpn_R_50_FPN_1x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
META_ARCHITECTURE: "ProposalNetwork"
|
4 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
5 |
+
MASK_ON: False
|
6 |
+
RESNETS:
|
7 |
+
DEPTH: 50
|
8 |
+
RPN:
|
9 |
+
POST_NMS_TOPK_TEST: 2000
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 101
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-DilatedC5.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 101
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 101
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.train import train
|
2 |
+
from ..common.optim import SGD as optimizer
|
3 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
4 |
+
from ..common.data.coco import dataloader
|
5 |
+
from ..common.models.mask_rcnn_c4 import model
|
6 |
+
|
7 |
+
model.backbone.freeze_at = 2
|
8 |
+
train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-C4.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x.yaml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-DilatedC5.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-DilatedC5.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco import dataloader
|
4 |
+
from ..common.models.mask_rcnn_fpn import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
model.backbone.bottom_up.freeze_at = 2
|
8 |
+
train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x_giou.yaml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
RPN:
|
8 |
+
BBOX_REG_LOSS_TYPE: "giou"
|
9 |
+
BBOX_REG_LOSS_WEIGHT: 2.0
|
10 |
+
ROI_BOX_HEAD:
|
11 |
+
BBOX_REG_LOSS_TYPE: "giou"
|
12 |
+
BBOX_REG_LOSS_WEIGHT: 10.0
|
configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
MASK_ON: True
|
5 |
+
RESNETS:
|
6 |
+
DEPTH: 50
|
7 |
+
SOLVER:
|
8 |
+
STEPS: (210000, 250000)
|
9 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
MASK_ON: True
|
4 |
+
WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl"
|
5 |
+
PIXEL_STD: [57.375, 57.120, 58.395]
|
6 |
+
RESNETS:
|
7 |
+
STRIDE_IN_1X1: False # this is a C2 model
|
8 |
+
NUM_GROUPS: 32
|
9 |
+
WIDTH_PER_GROUP: 8
|
10 |
+
DEPTH: 101
|
11 |
+
SOLVER:
|
12 |
+
STEPS: (210000, 250000)
|
13 |
+
MAX_ITER: 270000
|
configs/COCO-InstanceSegmentation/mask_rcnn_regnetx_4gf_dds_fpn_1x.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco import dataloader
|
4 |
+
from ..common.models.mask_rcnn_fpn import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
from detectron2.config import LazyCall as L
|
8 |
+
from detectron2.modeling.backbone import RegNet
|
9 |
+
from detectron2.modeling.backbone.regnet import SimpleStem, ResBottleneckBlock
|
10 |
+
|
11 |
+
|
12 |
+
# Replace default ResNet with RegNetX-4GF from the DDS paper. Config source:
|
13 |
+
# https://github.com/facebookresearch/pycls/blob/2c152a6e5d913e898cca4f0a758f41e6b976714d/configs/dds_baselines/regnetx/RegNetX-4.0GF_dds_8gpu.yaml#L4-L9 # noqa
|
14 |
+
model.backbone.bottom_up = L(RegNet)(
|
15 |
+
stem_class=SimpleStem,
|
16 |
+
stem_width=32,
|
17 |
+
block_class=ResBottleneckBlock,
|
18 |
+
depth=23,
|
19 |
+
w_a=38.65,
|
20 |
+
w_0=96,
|
21 |
+
w_m=2.43,
|
22 |
+
group_width=40,
|
23 |
+
freeze_at=2,
|
24 |
+
norm="FrozenBN",
|
25 |
+
out_features=["s1", "s2", "s3", "s4"],
|
26 |
+
)
|
27 |
+
model.pixel_std = [57.375, 57.120, 58.395]
|
28 |
+
|
29 |
+
optimizer.weight_decay = 5e-5
|
30 |
+
train.init_checkpoint = (
|
31 |
+
"https://dl.fbaipublicfiles.com/pycls/dds_baselines/160906383/RegNetX-4.0GF_dds_8gpu.pyth"
|
32 |
+
)
|
33 |
+
# RegNets benefit from enabling cudnn benchmark mode
|
34 |
+
train.cudnn_benchmark = True
|
configs/COCO-InstanceSegmentation/mask_rcnn_regnety_4gf_dds_fpn_1x.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco import dataloader
|
4 |
+
from ..common.models.mask_rcnn_fpn import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
from detectron2.config import LazyCall as L
|
8 |
+
from detectron2.modeling.backbone import RegNet
|
9 |
+
from detectron2.modeling.backbone.regnet import SimpleStem, ResBottleneckBlock
|
10 |
+
|
11 |
+
|
12 |
+
# Replace default ResNet with RegNetY-4GF from the DDS paper. Config source:
|
13 |
+
# https://github.com/facebookresearch/pycls/blob/2c152a6e5d913e898cca4f0a758f41e6b976714d/configs/dds_baselines/regnety/RegNetY-4.0GF_dds_8gpu.yaml#L4-L10 # noqa
|
14 |
+
model.backbone.bottom_up = L(RegNet)(
|
15 |
+
stem_class=SimpleStem,
|
16 |
+
stem_width=32,
|
17 |
+
block_class=ResBottleneckBlock,
|
18 |
+
depth=22,
|
19 |
+
w_a=31.41,
|
20 |
+
w_0=96,
|
21 |
+
w_m=2.24,
|
22 |
+
group_width=64,
|
23 |
+
se_ratio=0.25,
|
24 |
+
freeze_at=2,
|
25 |
+
norm="FrozenBN",
|
26 |
+
out_features=["s1", "s2", "s3", "s4"],
|
27 |
+
)
|
28 |
+
model.pixel_std = [57.375, 57.120, 58.395]
|
29 |
+
|
30 |
+
optimizer.weight_decay = 5e-5
|
31 |
+
train.init_checkpoint = (
|
32 |
+
"https://dl.fbaipublicfiles.com/pycls/dds_baselines/160906838/RegNetY-4.0GF_dds_8gpu.pyth"
|
33 |
+
)
|
34 |
+
# RegNets benefit from enabling cudnn benchmark mode
|
35 |
+
train.cudnn_benchmark = True
|
configs/COCO-Keypoints/Base-Keypoint-RCNN-FPN.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
KEYPOINT_ON: True
|
4 |
+
ROI_HEADS:
|
5 |
+
NUM_CLASSES: 1
|
6 |
+
ROI_BOX_HEAD:
|
7 |
+
SMOOTH_L1_BETA: 0.5 # Keypoint AP degrades (though box AP improves) when using plain L1 loss
|
8 |
+
RPN:
|
9 |
+
# Detectron1 uses 2000 proposals per-batch, but this option is per-image in detectron2.
|
10 |
+
# 1000 proposals per-image is found to hurt box AP.
|
11 |
+
# Therefore we increase it to 1500 per-image.
|
12 |
+
POST_NMS_TOPK_TRAIN: 1500
|
13 |
+
DATASETS:
|
14 |
+
TRAIN: ("keypoints_coco_2017_train",)
|
15 |
+
TEST: ("keypoints_coco_2017_val",)
|
configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Keypoint-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 101
|
6 |
+
SOLVER:
|
7 |
+
STEPS: (210000, 250000)
|
8 |
+
MAX_ITER: 270000
|
configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco_keypoint import dataloader
|
4 |
+
from ..common.models.keypoint_rcnn_fpn import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
model.backbone.bottom_up.freeze_at = 2
|
8 |
+
train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.yaml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Keypoint-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 50
|
configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Keypoint-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 50
|
6 |
+
SOLVER:
|
7 |
+
STEPS: (210000, 250000)
|
8 |
+
MAX_ITER: 270000
|
configs/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Keypoint-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl"
|
4 |
+
PIXEL_STD: [57.375, 57.120, 58.395]
|
5 |
+
RESNETS:
|
6 |
+
STRIDE_IN_1X1: False # this is a C2 model
|
7 |
+
NUM_GROUPS: 32
|
8 |
+
WIDTH_PER_GROUP: 8
|
9 |
+
DEPTH: 101
|
10 |
+
SOLVER:
|
11 |
+
STEPS: (210000, 250000)
|
12 |
+
MAX_ITER: 270000
|
configs/COCO-PanopticSegmentation/Base-Panoptic-FPN.yaml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "../Base-RCNN-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
META_ARCHITECTURE: "PanopticFPN"
|
4 |
+
MASK_ON: True
|
5 |
+
SEM_SEG_HEAD:
|
6 |
+
LOSS_WEIGHT: 0.5
|
7 |
+
DATASETS:
|
8 |
+
TRAIN: ("coco_2017_train_panoptic_separated",)
|
9 |
+
TEST: ("coco_2017_val_panoptic_separated",)
|
10 |
+
DATALOADER:
|
11 |
+
FILTER_EMPTY_ANNOTATIONS: False
|
configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Panoptic-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 101
|
6 |
+
SOLVER:
|
7 |
+
STEPS: (210000, 250000)
|
8 |
+
MAX_ITER: 270000
|
configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ..common.optim import SGD as optimizer
|
2 |
+
from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
|
3 |
+
from ..common.data.coco_panoptic_separated import dataloader
|
4 |
+
from ..common.models.panoptic_fpn import model
|
5 |
+
from ..common.train import train
|
6 |
+
|
7 |
+
model.backbone.bottom_up.freeze_at = 2
|
8 |
+
train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Panoptic-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 50
|
configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_BASE_: "Base-Panoptic-FPN.yaml"
|
2 |
+
MODEL:
|
3 |
+
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
|
4 |
+
RESNETS:
|
5 |
+
DEPTH: 50
|
6 |
+
SOLVER:
|
7 |
+
STEPS: (210000, 250000)
|
8 |
+
MAX_ITER: 270000
|