Spaces:
Paused
Paused
session_hash
Browse files- .gitignore +2 -1
- app.py +6 -5
.gitignore
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
-
|
|
|
|
|
|
| 1 |
+
*.egg-info/
|
| 2 |
+
__pycache__/
|
app.py
CHANGED
|
@@ -16,6 +16,7 @@ import tempfile
|
|
| 16 |
import cv2
|
| 17 |
import matplotlib.pyplot as plt
|
| 18 |
import numpy as np
|
|
|
|
| 19 |
import spaces
|
| 20 |
import torch
|
| 21 |
|
|
@@ -97,7 +98,7 @@ def reset(
|
|
| 97 |
session_input_labels,
|
| 98 |
request: gr.Request,
|
| 99 |
):
|
| 100 |
-
session_id = request.
|
| 101 |
predictor.to("cpu")
|
| 102 |
session_input_points = []
|
| 103 |
session_input_labels = []
|
|
@@ -125,7 +126,7 @@ def clear_points(
|
|
| 125 |
session_input_labels,
|
| 126 |
request: gr.Request,
|
| 127 |
):
|
| 128 |
-
session_id = request.
|
| 129 |
predictor.to("cpu")
|
| 130 |
session_input_points = []
|
| 131 |
session_input_labels = []
|
|
@@ -148,7 +149,7 @@ def preprocess_video_in(
|
|
| 148 |
session_input_labels,
|
| 149 |
request: gr.Request,
|
| 150 |
):
|
| 151 |
-
session_id = request.
|
| 152 |
predictor.to("cpu")
|
| 153 |
if video_path is None:
|
| 154 |
return (
|
|
@@ -225,7 +226,7 @@ def segment_with_points(
|
|
| 225 |
evt: gr.SelectData,
|
| 226 |
request: gr.Request,
|
| 227 |
):
|
| 228 |
-
session_id = request.
|
| 229 |
if torch.cuda.get_device_properties(0).major >= 8:
|
| 230 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 231 |
torch.backends.cudnn.allow_tf32 = True
|
|
@@ -308,7 +309,7 @@ def propagate_to_all(
|
|
| 308 |
session_all_frames,
|
| 309 |
request: gr.Request,
|
| 310 |
):
|
| 311 |
-
session_id = request.
|
| 312 |
predictor.to("cuda")
|
| 313 |
if torch.cuda.get_device_properties(0).major >= 8:
|
| 314 |
torch.backends.cuda.matmul.allow_tf32 = True
|
|
|
|
| 16 |
import cv2
|
| 17 |
import matplotlib.pyplot as plt
|
| 18 |
import numpy as np
|
| 19 |
+
|
| 20 |
import spaces
|
| 21 |
import torch
|
| 22 |
|
|
|
|
| 98 |
session_input_labels,
|
| 99 |
request: gr.Request,
|
| 100 |
):
|
| 101 |
+
session_id = request.session_hash
|
| 102 |
predictor.to("cpu")
|
| 103 |
session_input_points = []
|
| 104 |
session_input_labels = []
|
|
|
|
| 126 |
session_input_labels,
|
| 127 |
request: gr.Request,
|
| 128 |
):
|
| 129 |
+
session_id = request.session_hash
|
| 130 |
predictor.to("cpu")
|
| 131 |
session_input_points = []
|
| 132 |
session_input_labels = []
|
|
|
|
| 149 |
session_input_labels,
|
| 150 |
request: gr.Request,
|
| 151 |
):
|
| 152 |
+
session_id = request.session_hash
|
| 153 |
predictor.to("cpu")
|
| 154 |
if video_path is None:
|
| 155 |
return (
|
|
|
|
| 226 |
evt: gr.SelectData,
|
| 227 |
request: gr.Request,
|
| 228 |
):
|
| 229 |
+
session_id = request.session_hash
|
| 230 |
if torch.cuda.get_device_properties(0).major >= 8:
|
| 231 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 232 |
torch.backends.cudnn.allow_tf32 = True
|
|
|
|
| 309 |
session_all_frames,
|
| 310 |
request: gr.Request,
|
| 311 |
):
|
| 312 |
+
session_id = request.session_hash
|
| 313 |
predictor.to("cuda")
|
| 314 |
if torch.cuda.get_device_properties(0).major >= 8:
|
| 315 |
torch.backends.cuda.matmul.allow_tf32 = True
|