anthony01 commited on
Commit
2425cda
·
1 Parent(s): 5c89bd6

update: bug fix

Browse files
Files changed (2) hide show
  1. generate_keypoints.py +5 -4
  2. inference.py +3 -2
generate_keypoints.py CHANGED
@@ -14,6 +14,7 @@ import gc
14
  import warnings
15
  import hashlib
16
  from contextlib import contextmanager
 
17
  import joblib
18
 
19
  from video_preprocess import PreprocessConfig, apply_darken_then_brighten
@@ -222,8 +223,8 @@ def process_video(
222
  use_holistic: bool = False,
223
  face_mode: str = "none",
224
  write_placeholders: bool = False,
225
- preprocess_config: PreprocessConfig | None = None,
226
- export_darkened_dir: str | None = None,
227
  uid_suffix: str = "",
228
  ):
229
  if not hasattr(mp, "solutions"):
@@ -574,8 +575,8 @@ def save_keypoints(
574
  limit: int,
575
  no_parallel: bool,
576
  write_placeholders: bool,
577
- preprocess_config: PreprocessConfig | None,
578
- export_darkened_dir: str | None,
579
  uid_suffix: str = "",
580
  ):
581
  save_dir = os.path.join(save_root, f"{dataset}_{mode}_keypoints")
 
14
  import warnings
15
  import hashlib
16
  from contextlib import contextmanager
17
+ from typing import Optional
18
  import joblib
19
 
20
  from video_preprocess import PreprocessConfig, apply_darken_then_brighten
 
223
  use_holistic: bool = False,
224
  face_mode: str = "none",
225
  write_placeholders: bool = False,
226
+ preprocess_config: Optional[PreprocessConfig] = None,
227
+ export_darkened_dir: Optional[str] = None,
228
  uid_suffix: str = "",
229
  ):
230
  if not hasattr(mp, "solutions"):
 
575
  limit: int,
576
  no_parallel: bool,
577
  write_placeholders: bool,
578
+ preprocess_config: Optional[PreprocessConfig],
579
+ export_darkened_dir: Optional[str],
580
  uid_suffix: str = "",
581
  ):
582
  save_dir = os.path.join(save_root, f"{dataset}_{mode}_keypoints")
inference.py CHANGED
@@ -3,6 +3,7 @@ import os
3
  import shutil
4
  import tempfile
5
  import cv2
 
6
 
7
  import numpy as np
8
  import pandas as pd
@@ -95,8 +96,8 @@ def load_model(
95
  dataset: str,
96
  model_type: str,
97
  transformer_size: str,
98
- checkpoint_path: str | None,
99
- label_map_path: str | None = None,
100
  ):
101
  label_map = load_json(label_map_path) if label_map_path else load_label_map(dataset)
102
  n_classes = len(label_map)
 
3
  import shutil
4
  import tempfile
5
  import cv2
6
+ from typing import Optional
7
 
8
  import numpy as np
9
  import pandas as pd
 
96
  dataset: str,
97
  model_type: str,
98
  transformer_size: str,
99
+ checkpoint_path: Optional[str],
100
+ label_map_path: Optional[str] = None,
101
  ):
102
  label_map = load_json(label_map_path) if label_map_path else load_label_map(dataset)
103
  n_classes = len(label_map)