Spaces:
Sleeping
Sleeping
jovian
commited on
Commit
·
f4d4a0f
1
Parent(s):
2f7f476
login
Browse files
app.py
CHANGED
|
@@ -506,7 +506,7 @@ from sahi import AutoDetectionModel
|
|
| 506 |
from PIL import Image
|
| 507 |
import plotly.graph_objects as go
|
| 508 |
import torch
|
| 509 |
-
|
| 510 |
|
| 511 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 512 |
|
|
@@ -709,7 +709,7 @@ def upload_image(image):
|
|
| 709 |
"""Process the uploaded image (if needed) and display it."""
|
| 710 |
return image
|
| 711 |
|
| 712 |
-
|
| 713 |
def apply_detection(image):
|
| 714 |
"""Run object detection on the uploaded image and return the annotated image."""
|
| 715 |
# Convert image from PIL to NumPy array
|
|
|
|
| 506 |
from PIL import Image
|
| 507 |
import plotly.graph_objects as go
|
| 508 |
import torch
|
| 509 |
+
import spaces
|
| 510 |
|
| 511 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 512 |
|
|
|
|
| 709 |
"""Process the uploaded image (if needed) and display it."""
|
| 710 |
return image
|
| 711 |
|
| 712 |
+
@spaces.GPU
|
| 713 |
def apply_detection(image):
|
| 714 |
"""Run object detection on the uploaded image and return the annotated image."""
|
| 715 |
# Convert image from PIL to NumPy array
|