nexusbert commited on
Commit
6bbaf0d
·
1 Parent(s): 38b8889
Files changed (1) hide show
  1. smpl_generator.py +13 -13
smpl_generator.py CHANGED
@@ -38,16 +38,12 @@ class SMPLGenerator:
38
  model_files = list(models_source.glob("*.pkl"))
39
  print(f"Found {len(model_files)} model files in {models_source}: {[f.name for f in model_files]}")
40
 
41
- expected_smpl_dir = model_path_obj / "smpl"
 
 
42
  expected_models_dir = expected_smpl_dir / "models"
43
  expected_models_dir.mkdir(parents=True, exist_ok=True)
44
 
45
- name_mapping = {
46
- "basicmodel_m_lbs": "SMPL_MALE.pkl",
47
- "basicModel_f_lbs": "SMPL_FEMALE.pkl",
48
- "basicModel_neutral_lbs": "SMPL_NEUTRAL.pkl"
49
- }
50
-
51
  for model_file in model_files:
52
  file_lower = model_file.name.lower()
53
  target_name = None
@@ -60,15 +56,19 @@ class SMPLGenerator:
60
  target_name = "SMPL_NEUTRAL.pkl"
61
 
62
  if target_name:
63
- target_file = expected_models_dir / target_name
64
- if not target_file.exists():
65
- import shutil
66
- shutil.copy2(model_file, target_file)
67
- print(f"Copied {model_file.name} -> {target_name}")
 
 
 
 
 
68
  else:
69
  target_file = expected_models_dir / model_file.name
70
  if not target_file.exists():
71
- import shutil
72
  shutil.copy2(model_file, target_file)
73
  print(f"Copied {model_file.name} to {target_file}")
74
 
 
38
  model_files = list(models_source.glob("*.pkl"))
39
  print(f"Found {len(model_files)} model files in {models_source}: {[f.name for f in model_files]}")
40
 
41
+ import shutil
42
+
43
+ expected_smpl_dir = Path("smpl") / "smpl"
44
  expected_models_dir = expected_smpl_dir / "models"
45
  expected_models_dir.mkdir(parents=True, exist_ok=True)
46
 
 
 
 
 
 
 
47
  for model_file in model_files:
48
  file_lower = model_file.name.lower()
49
  target_name = None
 
56
  target_name = "SMPL_NEUTRAL.pkl"
57
 
58
  if target_name:
59
+ target_in_models = expected_models_dir / target_name
60
+ target_in_smpl = expected_smpl_dir / target_name
61
+
62
+ if not target_in_models.exists():
63
+ shutil.copy2(model_file, target_in_models)
64
+ print(f"Copied {model_file.name} -> {target_in_models}")
65
+
66
+ if not target_in_smpl.exists():
67
+ shutil.copy2(model_file, target_in_smpl)
68
+ print(f"Copied {model_file.name} -> {target_in_smpl}")
69
  else:
70
  target_file = expected_models_dir / model_file.name
71
  if not target_file.exists():
 
72
  shutil.copy2(model_file, target_file)
73
  print(f"Copied {model_file.name} to {target_file}")
74