MCPcopy Create free account
hub / github.com/Pixel-Talk/EHM-Tracker / build_command

Function build_command

tracking_video.py:16–38  ·  view source on GitHub ↗
(args, part_lst, gpu_id)

Source from the content-addressed store, hash-verified

14 return target_class(**{k: v for k, v in kwargs.items() if hasattr(target_class, k)})
15
16def build_command(args, part_lst, gpu_id):
17 cmd_parts = [
18 f'CUDA_VISIBLE_DEVICES={gpu_id}',
19 'python', os.path.basename(os.path.abspath(__file__))
20 ]
21 for arg_name, arg_value in vars(args).items():
22 if arg_value is not None and arg_name not in["part_lst","visible_gpus","output_dir","is_vfhq","n_divide"]:
23 if isinstance(arg_value, bool) :
24 if arg_value:
25 cmd_parts.append(f'--{arg_name}')
26 elif isinstance(arg_value, list):
27 cmd_parts.append(f'--{arg_name} {" ".join(map(str, arg_value))}')
28 else:
29 cmd_parts.append(f'--{arg_name} {shlex.quote(str(arg_value))}')
30
31 cmd_parts.extend([
32 '-p', part_lst,
33 '-n', '1',
34 '-v', '0',
35 '--output_dir', args.output_dir
36 ])
37
38 return ' '.join(cmd_parts)
39
40def find_videos_in_path(path):
41 videos = []

Callers 1

mainFunction · 0.85

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected