Tharun156 commited on
Commit
5708109
Β·
verified Β·
1 Parent(s): 0a59e35

Update hf_space/app.py

Browse files
Files changed (1) hide show
  1. hf_space/app.py +14 -0
hf_space/app.py CHANGED
@@ -72,6 +72,20 @@ if not any(smplx_dest.iterdir()):
72
  if not any(smplx_dest.iterdir()):
73
  print("[GestureLSM] WARNING: smplx_models directory missing; ensure the weights repo contains it.")
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  # Reuse the existing Gradio interface defined in demo.py.
76
  from demo import demo as gesture_demo # noqa: E402
77
 
 
72
  if not any(smplx_dest.iterdir()):
73
  print("[GestureLSM] WARNING: smplx_models directory missing; ensure the weights repo contains it.")
74
 
75
+ nested_smplx = smplx_dest / "smplx"
76
+ if nested_smplx.exists() and nested_smplx.is_dir():
77
+ for item in nested_smplx.iterdir():
78
+ target = smplx_dest / item.name
79
+ if item.is_dir():
80
+ shutil.copytree(item, target, dirs_exist_ok=True)
81
+ shutil.rmtree(item)
82
+ else:
83
+ shutil.move(str(item), str(target))
84
+ try:
85
+ nested_smplx.rmdir()
86
+ except OSError:
87
+ pass
88
+
89
  # Reuse the existing Gradio interface defined in demo.py.
90
  from demo import demo as gesture_demo # noqa: E402
91