Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
64ec997
1
Parent(s):
f195a6f
add spaces impl
Browse files- .gitignore +2 -1
- app.py +2 -0
- detect_faces.py +1 -0
.gitignore
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
venv
|
2 |
**/__pycache__/
|
3 |
**/.DS_Store
|
4 |
-
**/*.pt
|
|
|
|
1 |
venv
|
2 |
**/__pycache__/
|
3 |
**/.DS_Store
|
4 |
+
**/*.pt
|
5 |
+
*.MOV
|
app.py
CHANGED
@@ -1,7 +1,9 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from detect_faces import detect_faces
|
3 |
|
4 |
|
|
|
5 |
def process_image(input_image, box_margin):
|
6 |
if input_image is None:
|
7 |
return []
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
from detect_faces import detect_faces
|
4 |
|
5 |
|
6 |
+
@spaces.GPU
|
7 |
def process_image(input_image, box_margin):
|
8 |
if input_image is None:
|
9 |
return []
|
detect_faces.py
CHANGED
@@ -20,6 +20,7 @@ def check_and_download_model():
|
|
20 |
|
21 |
|
22 |
model = YOLO(check_and_download_model())
|
|
|
23 |
|
24 |
|
25 |
def adjust_box(b, image_shape, margin=10):
|
|
|
20 |
|
21 |
|
22 |
model = YOLO(check_and_download_model())
|
23 |
+
model.to("0")
|
24 |
|
25 |
|
26 |
def adjust_box(b, image_shape, margin=10):
|