Spaces:
Build error
Build error
rename models to match DLC modelzoo
#14
by
mwmathis
- opened
app.py
CHANGED
@@ -39,7 +39,7 @@ Megadet_Models = {'md_v5a': "megadet_model/md_v5a.0.0.pt",
|
|
39 |
gr_image_input = gr.inputs.Image(type="pil", label="Input Image")
|
40 |
|
41 |
|
42 |
-
gr_dlc_model_input = gr.inputs.Dropdown(choices=['full_cat','full_dog', '
|
43 |
default='full_cat', # default option
|
44 |
type='value', # Type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected.
|
45 |
label='Select DeepLabCut model')
|
@@ -239,13 +239,13 @@ def predict_pipeline(img_input,
|
|
239 |
elif model_input_str == 'full_dog':
|
240 |
path_to_DLCmodel = "model/DLC_Dog_resnet_50_iteration-0_shuffle-0"
|
241 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
242 |
-
elif model_input_str == '
|
243 |
path_to_DLCmodel = "model/DLC_FacialLandmarks_resnet_50_iteration-1_shuffle-1"
|
244 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
245 |
elif model_input_str == 'full_human':
|
246 |
path_to_DLCmodel = "model/DLC_human_dancing_resnet_101_iteration-0_shuffle-1"
|
247 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
248 |
-
elif model_input_str == '
|
249 |
path_to_DLCmodel = "model/DLC_monkey_resnet_50_iteration-0_shuffle-1"
|
250 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
251 |
|
@@ -353,7 +353,7 @@ gr_description = "Contributed by Sofia Minano, Neslihan Wittek, Nirel Kadzo, Vic
|
|
353 |
# examples = [['data/Macropod.jpg'], ['data/koala2.jpg'],['data/cat.jpg'],['data/BrushtailPossum.jpg']]
|
354 |
|
355 |
# %%
|
356 |
-
examples = [['example/monkey_full.jpg', '
|
357 |
['example/dog.jpeg', 'full_dog', False, 0.5, 0.05, 'amiko', 5, 'yellow', 3, 'md_v5a'],
|
358 |
['example/cat.jpg', 'full_cat', False, 0.5, 0.05, 'amiko', 5, 'purple', 3, 'md_v5a']]
|
359 |
demo = gr.Interface(predict_pipeline,
|
|
|
39 |
gr_image_input = gr.inputs.Image(type="pil", label="Input Image")
|
40 |
|
41 |
|
42 |
+
gr_dlc_model_input = gr.inputs.Dropdown(choices=['full_cat','full_dog', 'primate_face', 'full_human', 'full_macaque'], # choices
|
43 |
default='full_cat', # default option
|
44 |
type='value', # Type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected.
|
45 |
label='Select DeepLabCut model')
|
|
|
239 |
elif model_input_str == 'full_dog':
|
240 |
path_to_DLCmodel = "model/DLC_Dog_resnet_50_iteration-0_shuffle-0"
|
241 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
242 |
+
elif model_input_str == 'primate_face':
|
243 |
path_to_DLCmodel = "model/DLC_FacialLandmarks_resnet_50_iteration-1_shuffle-1"
|
244 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
245 |
elif model_input_str == 'full_human':
|
246 |
path_to_DLCmodel = "model/DLC_human_dancing_resnet_101_iteration-0_shuffle-1"
|
247 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
248 |
+
elif model_input_str == 'full_macaque':
|
249 |
path_to_DLCmodel = "model/DLC_monkey_resnet_50_iteration-0_shuffle-1"
|
250 |
pose_cfg_path = os.path.join(path_to_DLCmodel,'pose_cfg.yaml')
|
251 |
|
|
|
353 |
# examples = [['data/Macropod.jpg'], ['data/koala2.jpg'],['data/cat.jpg'],['data/BrushtailPossum.jpg']]
|
354 |
|
355 |
# %%
|
356 |
+
examples = [['example/monkey_full.jpg', 'full_macaque', False, 0.5, 0.3, 'amiko', 5, 'blue', 3, 'md_v5a'],
|
357 |
['example/dog.jpeg', 'full_dog', False, 0.5, 0.05, 'amiko', 5, 'yellow', 3, 'md_v5a'],
|
358 |
['example/cat.jpg', 'full_cat', False, 0.5, 0.05, 'amiko', 5, 'purple', 3, 'md_v5a']]
|
359 |
demo = gr.Interface(predict_pipeline,
|