Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,9 +56,9 @@ def _dynGPU(
|
|
| 56 |
def dynGPU(
|
| 57 |
fn: Callable[P, R] | None = None,
|
| 58 |
duration: Callable[P, int] = lambda: 60,
|
| 59 |
-
min=
|
| 60 |
max=300,
|
| 61 |
-
step=
|
| 62 |
) -> Callable[P, R]:
|
| 63 |
if fn is None:
|
| 64 |
return partial(_dynGPU, duration=duration, min=min, max=max, step=step)
|
|
@@ -260,9 +260,7 @@ def process_images(images, threshold):
|
|
| 260 |
|
| 261 |
batch = batch.to(device)
|
| 262 |
with torch.no_grad():
|
| 263 |
-
|
| 264 |
-
probabilities = torch.nn.functional.sigmoid(logits)
|
| 265 |
-
|
| 266 |
for i, prob in enumerate(probabilities):
|
| 267 |
indices = torch.where(prob > threshold)[0]
|
| 268 |
values = prob[indices]
|
|
|
|
| 56 |
def dynGPU(
|
| 57 |
fn: Callable[P, R] | None = None,
|
| 58 |
duration: Callable[P, int] = lambda: 60,
|
| 59 |
+
min=10,
|
| 60 |
max=300,
|
| 61 |
+
step=5,
|
| 62 |
) -> Callable[P, R]:
|
| 63 |
if fn is None:
|
| 64 |
return partial(_dynGPU, duration=duration, min=min, max=max, step=step)
|
|
|
|
| 260 |
|
| 261 |
batch = batch.to(device)
|
| 262 |
with torch.no_grad():
|
| 263 |
+
probabilities = model(batch)[0]
|
|
|
|
|
|
|
| 264 |
for i, prob in enumerate(probabilities):
|
| 265 |
indices = torch.where(prob > threshold)[0]
|
| 266 |
values = prob[indices]
|