22
22
from dlclive .version import VERSION
23
23
24
24
25
- def get_system_info () -> dict :
26
- """
27
- Returns a summary of system information relevant to running benchmarking.
28
-
29
- Returns
30
- -------
31
- dict
32
- A dictionary containing the following system information:
33
- - host_name (str): Name of the machine.
34
- - op_sys (str): Operating system.
35
- - python (str): Path to the Python executable, indicating the conda/virtual environment in use.
36
- - device_type (str): Type of device used ('GPU' or 'CPU').
37
- - device (list): List containing the name of the GPU or CPU brand.
38
- - freeze (list): List of installed Python packages with their versions.
39
- - python_version (str): Version of Python in use.
40
- - git_hash (str or None): If installed from git repository, hash of HEAD commit.
41
- - dlclive_version (str): Version of the DLCLive package.
42
- """
43
-
44
- # Get OS and host name
45
- op_sys = platform .platform ()
46
- host_name = platform .node ().replace (" " , "" )
47
-
48
- # Get Python executable path
49
- if platform .system () == "Windows" :
50
- host_python = sys .executable .split (os .path .sep )[- 2 ]
51
- else :
52
- host_python = sys .executable .split (os .path .sep )[- 3 ]
53
-
54
- # Try to get git hash if possible
55
- git_hash = None
56
- dlc_basedir = os .path .dirname (os .path .dirname (__file__ ))
57
- try :
58
- git_hash = (
59
- subprocess .check_output (["git" , "rev-parse" , "HEAD" ], cwd = dlc_basedir )
60
- .decode ("utf-8" )
61
- .strip ()
62
- )
63
- except subprocess .CalledProcessError :
64
- # Not installed from git repo, e.g., pypi
65
- pass
66
-
67
- # Get device info (GPU or CPU)
68
- if torch .cuda .is_available ():
69
- dev_type = "GPU"
70
- dev = [torch .cuda .get_device_name (torch .cuda .current_device ())]
71
- else :
72
- from cpuinfo import get_cpu_info
73
-
74
- dev_type = "CPU"
75
- dev = [get_cpu_info ()["brand_raw" ]]
76
-
77
- return {
78
- "host_name" : host_name ,
79
- "op_sys" : op_sys ,
80
- "python" : host_python ,
81
- "device_type" : dev_type ,
82
- "device" : dev ,
83
- "freeze" : list (freeze .freeze ()),
84
- "python_version" : sys .version ,
85
- "git_hash" : git_hash ,
86
- "dlclive_version" : VERSION ,
87
- }
88
-
89
-
90
25
def benchmark (
91
26
video_path : str ,
92
27
model_path : str ,
@@ -106,7 +41,6 @@ def benchmark(
106
41
save_poses = False ,
107
42
draw_keypoint_names = False ,
108
43
cmap = "bmy" ,
109
- get_sys_info = True ,
110
44
save_video = False ,
111
45
):
112
46
"""
@@ -152,8 +86,6 @@ def benchmark(
152
86
Whether to display keypoint names on video frames in the saved video.
153
87
cmap : str, optional, default='bmy'
154
88
Colormap from the colorcet library for keypoint visualization.
155
- get_sys_info : bool, optional, default=True
156
- Whether to print system information.
157
89
save_video : bool, optional, default=False
158
90
Whether to save the labeled video.
159
91
@@ -268,9 +200,6 @@ def benchmark(
268
200
if save_video :
269
201
vwriter .release ()
270
202
271
- if get_sys_info :
272
- print (get_system_info ())
273
-
274
203
if save_poses :
275
204
individuals = dlc_live .read_config ()["metadata" ].get ("individuals" , [])
276
205
n_individuals = len (individuals ) or 1
0 commit comments