Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
from gradio_client import Client, file
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
client = Client("mariem2024/plantID")
|
| 5 |
-
|
| 6 |
-
def predict(image):
|
| 7 |
-
try:
|
| 8 |
-
result = client.predict(
|
| 9 |
-
file(image), # Yüklenen görsel dosyası
|
| 10 |
-
api_name="/predict" # mariem2024/plantID içinde "/predict" endpoint'i tanımlı
|
| 11 |
-
)
|
| 12 |
-
return result
|
| 13 |
-
except Exception as e:
|
| 14 |
-
return f"Hata oluştu: {str(e)}"
|
| 15 |
-
|
| 16 |
-
demo = gr.Interface(
|
| 17 |
-
fn=predict,
|
| 18 |
-
inputs=gr.Image(type="filepath"),
|
| 19 |
-
outputs="text",
|
| 20 |
-
title="Bitki Tanıma",
|
| 21 |
-
description="Bu arayüz Hugging Face Space üzerinden bitki türünü tahmin eder."
|
| 22 |
-
)
|
| 23 |
-
|
| 24 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|