Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# 1. Import the required dependencies
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
| 5 |
-
|
| 6 |
|
| 7 |
from PIL import Image, ImageDraw, ImageFont
|
| 8 |
|
|
@@ -44,7 +44,7 @@ color_dict = {
|
|
| 44 |
|
| 45 |
# 3. Create a function predict_on_image
|
| 46 |
# Use a GPU on a target function
|
| 47 |
-
|
| 48 |
def predict_on_image(image, conf_threshold):
|
| 49 |
model.eval()
|
| 50 |
|
|
|
|
| 2 |
# 1. Import the required dependencies
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
| 5 |
+
import spaces # for GPU usage
|
| 6 |
|
| 7 |
from PIL import Image, ImageDraw, ImageFont
|
| 8 |
|
|
|
|
| 44 |
|
| 45 |
# 3. Create a function predict_on_image
|
| 46 |
# Use a GPU on a target function
|
| 47 |
+
@spaces.GPU
|
| 48 |
def predict_on_image(image, conf_threshold):
|
| 49 |
model.eval()
|
| 50 |
|