Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -241,10 +241,12 @@ def get_mask_sam_process(
|
|
241 |
frame_names = scanned_frames
|
242 |
|
243 |
print(f"STORED INFERENCE STEP: {stored_inference_state}")
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
|
|
|
|
248 |
|
249 |
# segment and track one object
|
250 |
# predictor.reset_state(inference_state) # if any previous tracking, reset
|
|
|
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")
|
248 |
+
else:
|
249 |
+
inference_state = stored_inference_state
|
250 |
|
251 |
# segment and track one object
|
252 |
# predictor.reset_state(inference_state) # if any previous tracking, reset
|