root commited on
Commit
329d53d
·
1 Parent(s): 54edee1

fixing directory path

Browse files
Files changed (1) hide show
  1. handler.py +4 -1
handler.py CHANGED
@@ -273,6 +273,8 @@ class EndpointHandler():
273
  cfg = inputs.get("cfg", 3.5)
274
  seed = inputs.get("seed", 123)
275
 
 
 
276
  # Create a unique temporary directory for this request
277
  with tempfile.TemporaryDirectory() as temp_dir:
278
  print(f"Temporary directory created at {temp_dir}") # Debug statement
@@ -307,7 +309,8 @@ class EndpointHandler():
307
  pose_output_path = os.path.join(temp_dir, "pose_videos")
308
 
309
  # Run the extract_dwpose_from_vid.py script
310
- command = f'python3 extract_dwpose_from_vid.py --video_root {video_root}'
 
311
 
312
  # Run the command with shell=True
313
  result = subprocess.run(command, shell=True, capture_output=True, text=True)
 
273
  cfg = inputs.get("cfg", 3.5)
274
  seed = inputs.get("seed", 123)
275
 
276
+ base_dir = os.path.dirname(os.path.abspath(__file__))
277
+
278
  # Create a unique temporary directory for this request
279
  with tempfile.TemporaryDirectory() as temp_dir:
280
  print(f"Temporary directory created at {temp_dir}") # Debug statement
 
309
  pose_output_path = os.path.join(temp_dir, "pose_videos")
310
 
311
  # Run the extract_dwpose_from_vid.py script
312
+ extract_pose_path = os.path.join(base_dir, 'extract_dwpose_from_vid.py')
313
+ command = f'python3 {extract_pose_path} --video_root {video_root}'
314
 
315
  # Run the command with shell=True
316
  result = subprocess.run(command, shell=True, capture_output=True, text=True)