Update app.py
Browse files
app.py
CHANGED
|
@@ -212,6 +212,7 @@ def load_model(checkpoint):
|
|
| 212 |
|
| 213 |
|
| 214 |
def get_mask_sam_process(
|
|
|
|
| 215 |
input_first_frame_image,
|
| 216 |
checkpoint,
|
| 217 |
tracking_points,
|
|
@@ -239,6 +240,8 @@ def get_mask_sam_process(
|
|
| 239 |
# scan all the JPEG frame names in this directory
|
| 240 |
frame_names = scanned_frames
|
| 241 |
|
|
|
|
|
|
|
| 242 |
# Init SAM2 inference_state
|
| 243 |
inference_state = predictor.init_state(video_path=video_dir)
|
| 244 |
print("NEW INFERENCE_STATE INITIATED")
|
|
@@ -506,6 +509,7 @@ with gr.Blocks() as demo:
|
|
| 506 |
submit_btn.click(
|
| 507 |
fn = get_mask_sam_process,
|
| 508 |
inputs = [
|
|
|
|
| 509 |
input_first_frame_image,
|
| 510 |
checkpoint,
|
| 511 |
tracking_points,
|
|
|
|
| 212 |
|
| 213 |
|
| 214 |
def get_mask_sam_process(
|
| 215 |
+
stored_inference_state,
|
| 216 |
input_first_frame_image,
|
| 217 |
checkpoint,
|
| 218 |
tracking_points,
|
|
|
|
| 240 |
# scan all the JPEG frame names in this directory
|
| 241 |
frame_names = scanned_frames
|
| 242 |
|
| 243 |
+
print(f"STORED INFERENCE STEP: {stored_inference_state}")
|
| 244 |
+
# if stored_inference_state is None:
|
| 245 |
# Init SAM2 inference_state
|
| 246 |
inference_state = predictor.init_state(video_path=video_dir)
|
| 247 |
print("NEW INFERENCE_STATE INITIATED")
|
|
|
|
| 509 |
submit_btn.click(
|
| 510 |
fn = get_mask_sam_process,
|
| 511 |
inputs = [
|
| 512 |
+
stored_inference_state,
|
| 513 |
input_first_frame_image,
|
| 514 |
checkpoint,
|
| 515 |
tracking_points,
|