Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,13 +2,8 @@ import gradio as gr
|
|
| 2 |
import torch
|
| 3 |
from ultralyticsplus import YOLO
|
| 4 |
import numpy as np
|
| 5 |
-
from sahi.prediction import ObjectPrediction, PredictionScore
|
| 6 |
-
from sahi.utils.cv import (
|
| 7 |
-
get_bool_mask_from_coco_segmentation,
|
| 8 |
-
read_image_as_pil,
|
| 9 |
-
visualize_object_predictions,
|
| 10 |
-
)
|
| 11 |
|
|
|
|
| 12 |
from base64 import b64encode
|
| 13 |
from io import BytesIO
|
| 14 |
from gtts import gTTS
|
|
@@ -16,6 +11,13 @@ from mtranslate import translate
|
|
| 16 |
from speech_recognition import AudioFile, Recognizer
|
| 17 |
import time
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
model = YOLO('ultralyticsplus/yolov8s')
|
| 20 |
CLASS = model.model.names
|
| 21 |
|
|
|
|
| 2 |
import torch
|
| 3 |
from ultralyticsplus import YOLO
|
| 4 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
from PIL import Image
|
| 7 |
from base64 import b64encode
|
| 8 |
from io import BytesIO
|
| 9 |
from gtts import gTTS
|
|
|
|
| 11 |
from speech_recognition import AudioFile, Recognizer
|
| 12 |
import time
|
| 13 |
|
| 14 |
+
from sahi.prediction import ObjectPrediction, PredictionScore
|
| 15 |
+
from sahi.utils.cv import (
|
| 16 |
+
get_bool_mask_from_coco_segmentation,
|
| 17 |
+
read_image_as_pil,
|
| 18 |
+
visualize_object_predictions,
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
model = YOLO('ultralyticsplus/yolov8s')
|
| 22 |
CLASS = model.model.names
|
| 23 |
|