Skip to content

Commit e22d323

Browse files
committed
fix(directory): get cpu index on mac, or fail gracefully
1 parent fd17ae9 commit e22d323

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/python/pose_format/bin/directory.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def get_corresponding_pose_path(video_path: Path, keep_video_suffixes: bool = Fa
8484

8585

8686
def process_video(keep_video_suffixes: bool, pose_format: str, additional_config: dict, vid_path: Path) -> bool:
87-
print(f'Estimating {vid_path} on CPU {psutil.Process().cpu_num()}')
87+
cpu_num = psutil.cpu_num() if hasattr(psutil, "cpu_num") else (
88+
os.sched_getcpu()) if hasattr(os, 'sched_getcpu') else "N/A"
89+
print(f'Estimating {vid_path} on CPU {cpu_num}')
8890

8991
try:
9092
pose_path = get_corresponding_pose_path(video_path=vid_path, keep_video_suffixes=keep_video_suffixes)

0 commit comments

Comments
 (0)