Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,7 +133,7 @@ def predict(image):
|
|
| 133 |
inputs = preprocess_image(image)
|
| 134 |
if inputs is None:
|
| 135 |
elapsed_ms = (time.perf_counter() - start) * 1000
|
| 136 |
-
return "Unknown", "
|
| 137 |
|
| 138 |
inputs = inputs.unsqueeze(0).to(device)
|
| 139 |
with torch.no_grad():
|
|
@@ -180,8 +180,8 @@ def predict(image):
|
|
| 180 |
# 9. Gradio UI
|
| 181 |
# -----------------------------
|
| 182 |
with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
| 183 |
-
gr.Markdown("#
|
| 184 |
-
gr.Markdown("
|
| 185 |
|
| 186 |
with gr.Row():
|
| 187 |
with gr.Column():
|
|
|
|
| 133 |
inputs = preprocess_image(image)
|
| 134 |
if inputs is None:
|
| 135 |
elapsed_ms = (time.perf_counter() - start) * 1000
|
| 136 |
+
return "Unknown", "Wajah tidak terdeteksi.", [], f"{elapsed_ms:.2f} ms"
|
| 137 |
|
| 138 |
inputs = inputs.unsqueeze(0).to(device)
|
| 139 |
with torch.no_grad():
|
|
|
|
| 180 |
# 9. Gradio UI
|
| 181 |
# -----------------------------
|
| 182 |
with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
| 183 |
+
gr.Markdown("# Program Rekomendasi Bentuk Kacamata")
|
| 184 |
+
gr.Markdown("Pastikan foto yang diunggah dapat terlihat jelas bagian wajah. Pastikan hanya menampilkan satu orang atau wajah untuk satu proses deteksi")
|
| 185 |
|
| 186 |
with gr.Row():
|
| 187 |
with gr.Column():
|