@@ -190,30 +190,26 @@ def box_to_center_scale(box, model_image_width, model_image_height):
190
190
return center , scale
191
191
192
192
193
- def parse_args ():
193
+ # def parse_args():
194
194
195
- parser = argparse .ArgumentParser (description = 'Train keypoints network' )
196
- # general
197
- parser .add_argument ('--cfg' , type = str , default = f'{ cur_dir } /inference-config.yaml' )
198
- parser .add_argument ('--video' , type = str )
199
- parser .add_argument ('--write' ,action = 'store_true' )
200
- parser .add_argument ('--showFps' ,action = 'store_true' )
201
- parser .add_argument ('--output_dir' ,type = str , default = '/' )
195
+ # parser = argparse.ArgumentParser(description='Train keypoints network')
196
+ # # general
197
+ # parser.add_argument('--cfg', type=str, default=f'{cur_dir}/inference-config.yaml')
198
+ # parser.add_argument('--video', type=str)
199
+ # parser.add_argument('--write',action='store_true')
200
+ # parser.add_argument('--showFps',action='store_true')
201
+ # parser.add_argument('--output_dir',type=str, default='/')
202
202
203
- parser .add_argument ('opts' ,
204
- help = 'Modify config options using the command-line' ,
205
- default = None ,
206
- nargs = argparse .REMAINDER )
203
+ # parser.add_argument('opts',
204
+ # help='Modify config options using the command-line',
205
+ # default=None,
206
+ # nargs=argparse.REMAINDER)
207
207
208
- args = parser .parse_args ()
209
-
210
- # args expected by supporting codebase
211
- args .modelDir = ''
212
- args .logDir = ''
213
- args .dataDir = ''
214
- args .prevModelDir = ''
215
- return args
208
+ # args = parser.parse_args()
216
209
210
+ class Bunch :
211
+ def __init__ (self , ** kwds ):
212
+ self .__dict__ .update (kwds )
217
213
218
214
def get_deepHRnet_keypoints (video , output_dir = None , output_video = False , save_kpts = False , custom_model = None ):
219
215
@@ -223,8 +219,8 @@ def get_deepHRnet_keypoints(video, output_dir=None, output_video=False, save_kpt
223
219
torch .backends .cudnn .deterministic = cfg .CUDNN .DETERMINISTIC
224
220
torch .backends .cudnn .enabled = cfg .CUDNN .ENABLED
225
221
226
- args = parse_args ( )
227
- update_config (cfg , args )
222
+ # args = parses_args(video, output_dir )
223
+ update_config (cfg , Bunch ( cfg = f' { cur_dir } /inference-config.yaml' , opts = None ) )
228
224
229
225
box_model = torchvision .models .detection .fasterrcnn_resnet50_fpn (pretrained = True )
230
226
box_model .to (CTX )
0 commit comments