fffiloni commited on
Commit
c4a81c0
·
verified ·
1 Parent(s): 00bb642

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -1,3 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from datetime import datetime
3
  import os
@@ -204,7 +222,7 @@ def sam_process(input_first_frame_image, checkpoint, tracking_points, trackings_
204
  inference_state = predictor.init_state(video_path=video_dir)
205
 
206
  # segment and track one object
207
- predictor.reset_state(inference_state) # if any previous tracking, reset
208
 
209
  # Add new point
210
  ann_frame_idx = 0 # the frame index we interact with
 
1
+ import subprocess
2
+
3
+ # Define the command to be executed
4
+ command = ["python", "setup.py", "build_ext", "--inplace"]
5
+
6
+ # Execute the command
7
+ result = subprocess.run(command, capture_output=True, text=True)
8
+
9
+ # Print the output and error (if any)
10
+ print("Output:\n", result.stdout)
11
+ print("Errors:\n", result.stderr)
12
+
13
+ # Check if the command was successful
14
+ if result.returncode == 0:
15
+ print("Command executed successfully.")
16
+ else:
17
+ print("Command failed with return code:", result.returncode)
18
+
19
  import gradio as gr
20
  from datetime import datetime
21
  import os
 
222
  inference_state = predictor.init_state(video_path=video_dir)
223
 
224
  # segment and track one object
225
+ # predictor.reset_state(inference_state) # if any previous tracking, reset
226
 
227
  # Add new point
228
  ann_frame_idx = 0 # the frame index we interact with