Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ def has_camera_exif(image):
|
|
| 40 |
# ----------------------------
|
| 41 |
# DETEKSI HYBRID
|
| 42 |
# ----------------------------
|
| 43 |
-
def detect_image(image):
|
| 44 |
output_lines = []
|
| 45 |
|
| 46 |
hf_score = 0
|
|
@@ -92,15 +92,17 @@ def detect_image(image):
|
|
| 92 |
return "\n".join(output_lines)
|
| 93 |
|
| 94 |
# ----------------------------
|
| 95 |
-
# Gradio Interface
|
| 96 |
# ----------------------------
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
if __name__ == "__main__":
|
| 106 |
-
|
|
|
|
| 40 |
# ----------------------------
|
| 41 |
# DETEKSI HYBRID
|
| 42 |
# ----------------------------
|
| 43 |
+
def detect_image(image: Image.Image):
|
| 44 |
output_lines = []
|
| 45 |
|
| 46 |
hf_score = 0
|
|
|
|
| 92 |
return "\n".join(output_lines)
|
| 93 |
|
| 94 |
# ----------------------------
|
| 95 |
+
# Gradio Interface (5.x syntax)
|
| 96 |
# ----------------------------
|
| 97 |
+
with gr.Blocks(title="AI vs Foto Asli Detector (Versi Akurat)") as demo:
|
| 98 |
+
gr.Markdown("Unggah gambar, sistem akan mendeteksi apakah gambar kemungkinan besar asli atau dihasilkan AI.")
|
| 99 |
+
|
| 100 |
+
with gr.Row():
|
| 101 |
+
img_input = gr.Image(type="pil", label="Unggah Gambar")
|
| 102 |
+
output_md = gr.Markdown(label="Hasil Deteksi")
|
| 103 |
+
|
| 104 |
+
detect_btn = gr.Button("Deteksi")
|
| 105 |
+
detect_btn.click(fn=detect_image, inputs=img_input, outputs=output_md)
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
| 108 |
+
demo.launch()
|