Spaces:
Runtime error
Runtime error
feat(model): add yolo model
Browse files
app.py
CHANGED
@@ -4,6 +4,8 @@ import gradio as gr
|
|
4 |
import numpy as np
|
5 |
import os
|
6 |
|
|
|
|
|
7 |
def predict(input_img) -> tuple[np.ndarray | PIL.Image.Image | str, list[tuple[np.ndarray | tuple[int, int, int, int], str]]]:
|
8 |
res = model(input_img)
|
9 |
if len(res) == 0:
|
@@ -38,5 +40,4 @@ gradio_app = gr.Interface(
|
|
38 |
|
39 |
|
40 |
if __name__ == "__main__":
|
41 |
-
|
42 |
-
gradio_app.launch(debug=True)
|
|
|
4 |
import numpy as np
|
5 |
import os
|
6 |
|
7 |
+
model = YOLO("best.pt")
|
8 |
+
|
9 |
def predict(input_img) -> tuple[np.ndarray | PIL.Image.Image | str, list[tuple[np.ndarray | tuple[int, int, int, int], str]]]:
|
10 |
res = model(input_img)
|
11 |
if len(res) == 0:
|
|
|
40 |
|
41 |
|
42 |
if __name__ == "__main__":
|
43 |
+
gradio_app.launch()
|
|