Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,2 +1,25 @@
|
|
| 1 |
from datasets import load_dataset
|
| 2 |
-
dataset = load_dataset("juppy44/gbif-plants-raw", split="train", streaming=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from datasets import load_dataset
|
| 2 |
+
dataset = load_dataset("juppy44/gbif-plants-raw", split="train", streaming=True)
|
| 3 |
+
|
| 4 |
+
import gradio as gr
|
| 5 |
+
from datasets import load_dataset
|
| 6 |
+
from sklearn.model_selection import train_test_split
|
| 7 |
+
import numpy as np
|
| 8 |
+
|
| 9 |
+
# Load a small sample (this is conceptual - you'd need to implement proper sampling)
|
| 10 |
+
dataset = load_dataset("juppy44/gbif-plants-raw", split="train[:1000]", streaming=True)
|
| 11 |
+
|
| 12 |
+
# Your ML model training and inference code here
|
| 13 |
+
def classify_plant(image):
|
| 14 |
+
# Your classification logic
|
| 15 |
+
return "Species prediction"
|
| 16 |
+
|
| 17 |
+
demo = gr.Interface(
|
| 18 |
+
fn=classify_plant,
|
| 19 |
+
inputs=gr.Image(type="pil"),
|
| 20 |
+
outputs="text",
|
| 21 |
+
title="Plant Species Classifier"
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
if __name__ == "__main__":
|
| 25 |
+
demo.launch()
|