File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626args = parse_args ().parse ()
2727os .environ ["CUDA_VISIBLE_DEVICES" ] = args .gpu
28- if getattr (args , 'model_path' , '' ):
29- import importlib .util
30- import pathlib
31- model_abspath = os .path .abspath (args .model_path )
32- module_name = pathlib .Path (model_abspath ).stem
33- spec = importlib .util .spec_from_file_location (module_name , model_abspath )
34- module = importlib .util .module_from_spec (spec )
35- assert spec .loader is not None
36- spec .loader .exec_module (module )
37- CFM = getattr (module , 'Model' )
38-
28+
29+ from fmpose3d .models import get_model
30+ CFM = get_model (args .model_type )
31+
3932from fmpose3d .common .camera import *
4033
4134import matplotlib
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ sample_steps=3
55batch_size=1
66sh_file=' vis_in_the_wild.sh'
77
8- model_path= ' ../pre_trained_models/fmpose3d_h36m/model_GAMLP.py '
8+ model_type= ' fmpose3d '
99model_weights_path=' ../pre_trained_models/fmpose3d_h36m/FMpose3D_pretrained_weights.pth'
1010
1111target_path=' ./images/' # folder containing multiple images
@@ -16,7 +16,7 @@ python3 vis_in_the_wild.py \
1616 --type ' image' \
1717 --path ${target_path} \
1818 --model_weights_path " ${model_weights_path} " \
19- --model_path " ${model_path } " \
19+ --model_type " ${model_type } " \
2020 --sample_steps ${sample_steps} \
2121 --batch_size ${batch_size} \
2222 --layers ${layers} \
Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ def init(self):
7474 self .parser .add_argument ("--model_dir" , type = str , default = "" )
7575 # Optional: load model class from a specific file path
7676 self .parser .add_argument ("--model_path" , type = str , default = "" )
77+ # Model registry name (e.g. "fmpose3d"); used instead of --model_path
78+ self .parser .add_argument ("--model_type" , type = str , default = "fmpose3d" )
7779 self .parser .add_argument ("--model_weights_path" , type = str , default = "" )
7880
7981 self .parser .add_argument ("--post_refine_reload" , action = "store_true" )
You can’t perform that action at this time.
0 commit comments