Spaces:
Sleeping
Sleeping
Commit
·
ab899b5
1
Parent(s):
efb936a
back to gradio 4
Browse files- README.md +1 -1
- flagging.py +1 -1
- model_yolov5.py +2 -2
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🌈
|
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: agpl-3.0
|
|
|
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: agpl-3.0
|
flagging.py
CHANGED
|
@@ -3,7 +3,7 @@ import json
|
|
| 3 |
import uuid
|
| 4 |
from collections import OrderedDict
|
| 5 |
from pathlib import Path
|
| 6 |
-
from typing import
|
| 7 |
|
| 8 |
import filelock
|
| 9 |
import huggingface_hub
|
|
|
|
| 3 |
import uuid
|
| 4 |
from collections import OrderedDict
|
| 5 |
from pathlib import Path
|
| 6 |
+
from typing import Any, Sequence
|
| 7 |
|
| 8 |
import filelock
|
| 9 |
import huggingface_hub
|
model_yolov5.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
import numpy as np
|
| 3 |
import yolov5
|
| 4 |
from yolov5.utils.plots import Annotator, colors
|
|
@@ -12,7 +12,7 @@ def load_model(model_path, img_size=640):
|
|
| 12 |
return model
|
| 13 |
|
| 14 |
|
| 15 |
-
|
| 16 |
def inference(model, image):
|
| 17 |
"""Run inference on image and return annotated image."""
|
| 18 |
results = model(image, size=model.img_size)
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import numpy as np
|
| 3 |
import yolov5
|
| 4 |
from yolov5.utils.plots import Annotator, colors
|
|
|
|
| 12 |
return model
|
| 13 |
|
| 14 |
|
| 15 |
+
@spaces.GPU
|
| 16 |
def inference(model, image):
|
| 17 |
"""Run inference on image and return annotated image."""
|
| 18 |
results = model(image, size=model.img_size)
|