Spaces:
Build error
Build error
Mnjar commited on
Commit ·
b953c12
1
Parent(s): d1684c9
Edit requirements.txt and app.py
Browse files- app.py +6 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -3,9 +3,14 @@ import numpy as np
|
|
| 3 |
import pandas as pd
|
| 4 |
from PIL import Image, ImageDraw, ImageFont
|
| 5 |
from ultralytics import YOLO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Load YOLO model
|
| 8 |
-
model = YOLO(
|
| 9 |
|
| 10 |
def predict(image):
|
| 11 |
"""
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
from PIL import Image, ImageDraw, ImageFont
|
| 5 |
from ultralytics import YOLO
|
| 6 |
+
from huggingface_hub import hf_hub_download
|
| 7 |
+
from ultralytics import YOLO
|
| 8 |
+
|
| 9 |
+
# Download model dari Hugging Face
|
| 10 |
+
model_path = hf_hub_download(repo_id="Mnjar/TrashDetection", filename="trash_detection.pt")
|
| 11 |
|
| 12 |
# Load YOLO model
|
| 13 |
+
model = YOLO(model_path)
|
| 14 |
|
| 15 |
def predict(image):
|
| 16 |
"""
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
gradio
|
| 2 |
ultralytics
|
| 3 |
pandas
|
| 4 |
-
Pillow
|
|
|
|
|
|
| 1 |
gradio
|
| 2 |
ultralytics
|
| 3 |
pandas
|
| 4 |
+
Pillow
|
| 5 |
+
huggingface_hub
|