MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / get_speed_up_interval

Function get_speed_up_interval

detrsmpl/utils/demo_utils.py:439–487  ·  view source on GitHub ↗

Get the interval of specific speed up type. Args: speed_up_type (str, optional): Speed up type. choose in ['deciwatch', 'deciwatch_interval5_q1', 'deciwatch_interval5_q2', 'deciwatch_interval5_q3',

(speed_up_type,
                          cfg_base_dir='configs/_base_/post_processing/')

Source from the content-addressed store, hash-verified

437
438
439def get_speed_up_interval(speed_up_type,
440 cfg_base_dir='configs/_base_/post_processing/'):
441 """Get the interval of specific speed up type.
442
443 Args:
444 speed_up_type (str, optional): Speed up type.
445 choose in ['deciwatch',
446 'deciwatch_interval5_q1',
447 'deciwatch_interval5_q2',
448 'deciwatch_interval5_q3',
449 'deciwatch_interval5_q4',
450 'deciwatch_interval5_q5',
451 'deciwatch_interval10_q1',
452 'deciwatch_interval10_q2',
453 'deciwatch_interval10_q3',
454 'deciwatch_interval10_q4',
455 'deciwatch_interval10_q5',]. Defaults to 'deciwatch'.
456 cfg_base_dir (str, optional): Config base dir,
457 default configs/_base_/post_processing/
458
459 Raises:
460 ValueError: check the input speed up type.
461
462 Returns:
463 int: speed up interval
464 """
465
466 if speed_up_type == 'deciwatch':
467 speed_up_type = 'deciwatch_interval5_q3'
468 assert speed_up_type in [
469 'deciwatch_interval5_q1',
470 'deciwatch_interval5_q2',
471 'deciwatch_interval5_q3',
472 'deciwatch_interval5_q4',
473 'deciwatch_interval5_q5',
474 'deciwatch_interval10_q1',
475 'deciwatch_interval10_q2',
476 'deciwatch_interval10_q3',
477 'deciwatch_interval10_q4',
478 'deciwatch_interval10_q5',
479 ]
480 cfg = os.path.join(cfg_base_dir, speed_up_type + '.py')
481 if isinstance(cfg, str):
482 cfg = mmcv.Config.fromfile(cfg)
483 elif not isinstance(cfg, mmcv.Config):
484 raise TypeError('config must be a filename or Config object, '
485 f'but got {type(cfg)}')
486
487 return cfg['speed_up_cfg']['interval']
488
489
490def speed_up_interpolate(selected_frames, speed_up_frames, smpl_poses,

Callers

nothing calls this directly

Calls 1

fromfileMethod · 0.45

Tested by

no test coverage detected