Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import cv2
|
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
|
| 8 |
# Konfigurasi model
|
| 9 |
-
MODEL_PATH = "
|
| 10 |
CLASS_NAMES = ["bag", "person-static-object"] # Sesuaikan dengan kelas Anda
|
| 11 |
|
| 12 |
# Fungsi untuk memuat model
|
|
@@ -46,7 +46,7 @@ uploaded_file = st.file_uploader("Pilih gambar...", type=["jpg", "png", "jpeg"])
|
|
| 46 |
if uploaded_file is not None:
|
| 47 |
# Memuat gambar
|
| 48 |
image = Image.open(uploaded_file).convert("RGB")
|
| 49 |
-
st.image(image, caption="Gambar Input",
|
| 50 |
|
| 51 |
# Proses deteksi
|
| 52 |
if st.button("Deteksi Objek"):
|
|
|
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
|
| 8 |
# Konfigurasi model
|
| 9 |
+
MODEL_PATH = "best.pt" # Pastikan model ada di direktori ini
|
| 10 |
CLASS_NAMES = ["bag", "person-static-object"] # Sesuaikan dengan kelas Anda
|
| 11 |
|
| 12 |
# Fungsi untuk memuat model
|
|
|
|
| 46 |
if uploaded_file is not None:
|
| 47 |
# Memuat gambar
|
| 48 |
image = Image.open(uploaded_file).convert("RGB")
|
| 49 |
+
st.image(image, caption="Gambar Input", use_container_width=True)
|
| 50 |
|
| 51 |
# Proses deteksi
|
| 52 |
if st.button("Deteksi Objek"):
|