Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
882b974
1
Parent(s):
0009f89
wip - zero gpu test
Browse files
app.py
CHANGED
@@ -1,13 +1,24 @@
|
|
1 |
# Standard library imports
|
2 |
import os
|
3 |
import gradio as gr
|
|
|
|
|
|
|
4 |
|
5 |
# Local imports
|
6 |
-
from age_estimation.age_estimation import age_estimation
|
7 |
-
from detection.face_detection import face_detection
|
8 |
-
from detection.object_detection import object_detection
|
9 |
from utils.ui_utils import update_input_visibility
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
with gr.Blocks() as demo:
|
12 |
# Add a title to the interface
|
13 |
gr.Markdown("# Computer Vision Tools")
|
|
|
1 |
# Standard library imports
|
2 |
import os
|
3 |
import gradio as gr
|
4 |
+
import spaces
|
5 |
+
|
6 |
+
|
7 |
|
8 |
# Local imports
|
9 |
+
from age_estimation.age_estimation import age_estimation as _age_estimation
|
10 |
+
from detection.face_detection import face_detection as _face_detection
|
11 |
+
from detection.object_detection import object_detection as _object_detection
|
12 |
from utils.ui_utils import update_input_visibility
|
13 |
|
14 |
+
@spaces.GPU
|
15 |
+
def age_estimation(input_type, uploaded_image, image_url, base64_string):
|
16 |
+
return _age_estimation(input_type, uploaded_image, image_url, base64_string)
|
17 |
+
|
18 |
+
@spaces.GPU
|
19 |
+
def object_detection(input_type, uploaded_image, image_url, base64_string):
|
20 |
+
return _object_detection(input_type, uploaded_image, image_url, base64_string)
|
21 |
+
|
22 |
with gr.Blocks() as demo:
|
23 |
# Add a title to the interface
|
24 |
gr.Markdown("# Computer Vision Tools")
|