Spaces:
Sleeping
Sleeping
File size: 790 Bytes
64d14f7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# Import the libraries
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from tensorflow.keras.models import load_model # type: ignore
from tensorflow.keras.preprocessing.image import load_img, img_to_array # type: ignore
from tensorflow.keras.applications.convnext import preprocess_input # type: ignore
import gradio as gr
# Define the Gradio interface
interface = gr.Interface(
fn=make_prediction, # Function to be called for predictions
inputs=gr.Image(type="pil"), # Input type: Image (PIL format)
outputs="html", # Output type: HTML for formatting
title="Amazon arboreal species classification",
description="Upload an image to classify the species."
)
# Launch the Gradio interface
interface.launch() |