Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,10 +31,9 @@ def process_image(image):
|
|
| 31 |
results = model.predict(image_bgr, conf=0.25)
|
| 32 |
|
| 33 |
# 3. Gambar Kotak & Label Otomatis
|
| 34 |
-
#
|
| 35 |
-
#
|
| 36 |
-
|
| 37 |
-
annotated_bgr = results[0].plot(show_labels=True, show_conf=True)
|
| 38 |
|
| 39 |
# 4. Konversi Balik dari BGR ke RGB (Agar kulit tidak biru di Web)
|
| 40 |
annotated_rgb = cv2.cvtColor(annotated_bgr, cv2.COLOR_BGR2RGB)
|
|
@@ -43,7 +42,7 @@ def process_image(image):
|
|
| 43 |
|
| 44 |
# --- TAMPILAN WEB ---
|
| 45 |
with gr.Blocks() as demo:
|
| 46 |
-
gr.Markdown("# 👁️ Tes Model YOLO (
|
| 47 |
gr.Markdown("Pastikan wajah tidak biru dan label muncul.")
|
| 48 |
|
| 49 |
with gr.Row():
|
|
|
|
| 31 |
results = model.predict(image_bgr, conf=0.25)
|
| 32 |
|
| 33 |
# 3. Gambar Kotak & Label Otomatis
|
| 34 |
+
# PERBAIKAN DI SINI:
|
| 35 |
+
# Gunakan 'labels=True' dan 'conf=True' (bukan show_labels)
|
| 36 |
+
annotated_bgr = results[0].plot(labels=True, conf=True)
|
|
|
|
| 37 |
|
| 38 |
# 4. Konversi Balik dari BGR ke RGB (Agar kulit tidak biru di Web)
|
| 39 |
annotated_rgb = cv2.cvtColor(annotated_bgr, cv2.COLOR_BGR2RGB)
|
|
|
|
| 42 |
|
| 43 |
# --- TAMPILAN WEB ---
|
| 44 |
with gr.Blocks() as demo:
|
| 45 |
+
gr.Markdown("# 👁️ Tes Model YOLO (Final Fix)")
|
| 46 |
gr.Markdown("Pastikan wajah tidak biru dan label muncul.")
|
| 47 |
|
| 48 |
with gr.Row():
|