Spaces:
Runtime error
Runtime error
update app file
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- app.py +1 -1
- configs/_base_/faster-rcnn_r50_fpn_1x_coco.py +70 -1
- configs/{faster-rcnn_r50_fpn_organoid_orgaquant.py → _base_/faster-rcnn_r50_fpn_organoid_orgaquant.py} +1 -1
- model.py +1 -1
- orgaquant_dataset/test.json +0 -0
- orgaquant_dataset/test/Subset_1_450x450_001.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_002.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_003.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_004.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_005.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_006.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_007.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_008.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_009.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_010.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_011.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_012.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_013.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_014.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_015.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_016.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_017.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_018.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_019.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_020.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_021.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_022.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_023.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_024.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_025.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_026.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_027.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_028.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_029.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_030.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_031.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_032.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_033.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_034.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_035.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_036.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_037.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_038.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_039.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_040.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_041.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_042.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_043.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_044.jpg +0 -0
- orgaquant_dataset/test/Subset_1_450x450_045.jpg +0 -0
app.py
CHANGED
@@ -81,7 +81,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
81 |
label='Model Type')
|
82 |
with gr.Row():
|
83 |
model_name = gr.Dropdown(([
|
84 |
-
'Faster R-CNN (R-50-FPN']),
|
85 |
value=DEFAULT_MODEL_NAME,
|
86 |
label='Model')
|
87 |
with gr.Row():
|
|
|
81 |
label='Model Type')
|
82 |
with gr.Row():
|
83 |
model_name = gr.Dropdown(([
|
84 |
+
'Faster R-CNN (R-50-FPN)']),
|
85 |
value=DEFAULT_MODEL_NAME,
|
86 |
label='Model')
|
87 |
with gr.Row():
|
configs/_base_/faster-rcnn_r50_fpn_1x_coco.py
CHANGED
@@ -166,4 +166,73 @@ test_pipeline = [
|
|
166 |
])
|
167 |
]
|
168 |
|
169 |
-
evaluation = dict(interval=1, metric='bbox')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
])
|
167 |
]
|
168 |
|
169 |
+
evaluation = dict(interval=1, metric='bbox')
|
170 |
+
|
171 |
+
data_root = 'data/' # dataset root
|
172 |
+
|
173 |
+
train_batch_size_per_gpu = 16
|
174 |
+
train_num_workers = 1
|
175 |
+
|
176 |
+
max_epochs = 105
|
177 |
+
base_lr = 0.00001
|
178 |
+
|
179 |
+
|
180 |
+
metainfo = {
|
181 |
+
'classes': ('orgaquant', ),
|
182 |
+
'palette': [
|
183 |
+
(220, 20, 60),
|
184 |
+
]
|
185 |
+
}
|
186 |
+
|
187 |
+
train_dataloader = dict(
|
188 |
+
batch_size=train_batch_size_per_gpu,
|
189 |
+
num_workers=train_num_workers,
|
190 |
+
dataset=dict(
|
191 |
+
data_root=data_root,
|
192 |
+
metainfo=metainfo,
|
193 |
+
data_prefix=dict(img='train/'),
|
194 |
+
ann_file='train.json'))
|
195 |
+
|
196 |
+
val_dataloader = dict(
|
197 |
+
dataset=dict(
|
198 |
+
data_root=data_root,
|
199 |
+
metainfo=metainfo,
|
200 |
+
data_prefix=dict(img='val/'),
|
201 |
+
ann_file='val.json'))
|
202 |
+
|
203 |
+
test_dataloader = val_dataloader
|
204 |
+
|
205 |
+
val_evaluator = dict(ann_file=data_root + 'val.json')
|
206 |
+
|
207 |
+
test_evaluator = val_evaluator
|
208 |
+
|
209 |
+
model = dict(
|
210 |
+
roi_head=dict(
|
211 |
+
bbox_head=dict(num_classes=1)))
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
# optimizer
|
216 |
+
optim_wrapper = dict(
|
217 |
+
_delete_=True,
|
218 |
+
type='OptimWrapper',
|
219 |
+
optimizer=dict(type='AdamW', lr=base_lr, weight_decay=0.05),
|
220 |
+
paramwise_cfg=dict(
|
221 |
+
norm_decay_mult=0, bias_decay_mult=0, bypass_duplicate=True))
|
222 |
+
|
223 |
+
default_hooks = dict(
|
224 |
+
checkpoint=dict(
|
225 |
+
interval=5,
|
226 |
+
max_keep_ckpts=2, # only keep latest 2 checkpoints
|
227 |
+
save_best='auto'
|
228 |
+
),
|
229 |
+
logger=dict(type='LoggerHook', interval=5))
|
230 |
+
|
231 |
+
|
232 |
+
# load COCO pre-trained weight
|
233 |
+
|
234 |
+
# load_from = './work_dirs/faster-rcnn_r50_fpn_organoid/best_coco_bbox_mAP_epoch_12.pth'
|
235 |
+
|
236 |
+
|
237 |
+
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=1)
|
238 |
+
visualizer = dict(vis_backends=[dict(type='LocalVisBackend'),dict(type='TensorboardVisBackend')])
|
configs/{faster-rcnn_r50_fpn_organoid_orgaquant.py → _base_/faster-rcnn_r50_fpn_organoid_orgaquant.py}
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
# Inherit and overwrite part of the config based on this config
|
3 |
_base_ = './faster-rcnn_r50_fpn_1x_coco.py'
|
4 |
|
5 |
-
data_root = '
|
6 |
|
7 |
train_batch_size_per_gpu = 16
|
8 |
train_num_workers = 1
|
|
|
2 |
# Inherit and overwrite part of the config based on this config
|
3 |
_base_ = './faster-rcnn_r50_fpn_1x_coco.py'
|
4 |
|
5 |
+
data_root = 'orgaquant_dataset/' # dataset root
|
6 |
|
7 |
train_batch_size_per_gpu = 16
|
8 |
train_num_workers = 1
|
model.py
CHANGED
@@ -23,7 +23,7 @@ class Model:
|
|
23 |
|
24 |
|
25 |
def _load_model(self, name: str) -> nn.Module:
|
26 |
-
return init_detector('configs/_base_/faster-
|
27 |
|
28 |
def set_model(self, name: str) -> None:
|
29 |
if name == self.model_name:
|
|
|
23 |
|
24 |
|
25 |
def _load_model(self, name: str) -> nn.Module:
|
26 |
+
return init_detector('configs/_base_/faster-rcnn_r50_organoid_orgaquant.py', 'models/orgaquant_pretrained.pth' , device=self.device)
|
27 |
|
28 |
def set_model(self, name: str) -> None:
|
29 |
if name == self.model_name:
|
orgaquant_dataset/test.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
orgaquant_dataset/test/Subset_1_450x450_001.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_002.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_003.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_004.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_005.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_006.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_007.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_008.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_009.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_010.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_011.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_012.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_013.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_014.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_015.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_016.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_017.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_018.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_019.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_020.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_021.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_022.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_023.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_024.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_025.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_026.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_027.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_028.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_029.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_030.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_031.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_032.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_033.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_034.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_035.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_036.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_037.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_038.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_039.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_040.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_041.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_042.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_043.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_044.jpg
ADDED
orgaquant_dataset/test/Subset_1_450x450_045.jpg
ADDED