alexnasa commited on
Commit
ad7c9e8
Β·
verified Β·
1 Parent(s): 480e656

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -64,7 +64,7 @@ def get_video_info(video_path):
64
  return seconds_cfg, fps_cfg
65
 
66
  # Step 1: Trim video based on user-defined duration and fps based on user-defined duration and fps
67
- @space.GPU()
68
  def step1_trim(video_path, seconds, fps, state):
69
  session_id = str(uuid.uuid4())
70
  base_dir = os.path.join(os.environ["PIXEL3DMM_PREPROCESSED_DATA"], session_id)
@@ -82,7 +82,7 @@ def step1_trim(video_path, seconds, fps, state):
82
  return f"βœ… Step 1: Trimmed to {seconds}s @{fps}fps", state
83
 
84
  # Step 2: Preprocessing β†’ cropped video
85
- @space.GPU()
86
  def step2_preprocess(state):
87
  session_id = state["session_id"]
88
  base_dir = state["base_dir"]
@@ -99,7 +99,7 @@ def step2_preprocess(state):
99
  return "βœ… Step 2: Preprocessing complete", video, state
100
 
101
  # Step 3: Normals inference β†’ normals video
102
- @space.GPU()
103
  def step3_normals(state):
104
  session_id = state["session_id"]
105
  base_dir = state["base_dir"]
@@ -131,7 +131,7 @@ def step4_uv_map(state):
131
  return "βœ… Step 4: UV map inference complete", video, state
132
 
133
  # Step 5: Tracking β†’ final tracking video
134
- @space.GPU()
135
  def step5_track(state):
136
  session_id = state["session_id"]
137
  script = os.path.join(os.environ["PIXEL3DMM_CODE_BASE"], "scripts", "track.py")
 
64
  return seconds_cfg, fps_cfg
65
 
66
  # Step 1: Trim video based on user-defined duration and fps based on user-defined duration and fps
67
+ @spaces.GPU()
68
  def step1_trim(video_path, seconds, fps, state):
69
  session_id = str(uuid.uuid4())
70
  base_dir = os.path.join(os.environ["PIXEL3DMM_PREPROCESSED_DATA"], session_id)
 
82
  return f"βœ… Step 1: Trimmed to {seconds}s @{fps}fps", state
83
 
84
  # Step 2: Preprocessing β†’ cropped video
85
+ @spaces.GPU()
86
  def step2_preprocess(state):
87
  session_id = state["session_id"]
88
  base_dir = state["base_dir"]
 
99
  return "βœ… Step 2: Preprocessing complete", video, state
100
 
101
  # Step 3: Normals inference β†’ normals video
102
+ @spaces.GPU()
103
  def step3_normals(state):
104
  session_id = state["session_id"]
105
  base_dir = state["base_dir"]
 
131
  return "βœ… Step 4: UV map inference complete", video, state
132
 
133
  # Step 5: Tracking β†’ final tracking video
134
+ @spaces.GPU()
135
  def step5_track(state):
136
  session_id = state["session_id"]
137
  script = os.path.join(os.environ["PIXEL3DMM_CODE_BASE"], "scripts", "track.py")