Spaces:
No application file
No application file
Delete app.py
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142
import tensorflowfrom tensorflow import kerasfrom keras.models import load_modelmodel1 = load_model("inception.h5")
img_width, img_height = 180, 180class_names = ['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips']num_classes = len(class_names)
def predict_image(img): img_4d = img.reshape(-1, img_width, img_height, 3) # 4D coz model trained on multiple 3Ds prediction = model1.predict(img_4d)[0] return {class_names[i]: float(prediction[i]) for i in range(num_classes)}
import gradio as grimage = gr.inputs.Image(shape=(img_height, img_width))label = gr.outputs.Label(num_top_classes=num_classes)details = [ ["NAME: OLUMIDE TOLULOPE SAMUEL,"], ["MATRIC NO: HNDCOM/22/037"], ["CLASS: HND1"], ["LEVEL: 300L"], ["DEPARTMENT: COMPUTER SCIENCE"], ]
article = """<h4 style='text-align: center'><b>NAME: OLUMIDE TOLULOPE SAMUEL</b> </br> <b>MATRIC NO: HNDCOM/22/037</b> </br> <b>CLASS: HND1</b> </br> <b>LEVEL: 300L</b> </br> <b>DEPARTMENT: COMPUTER SCIENCE</b> </h4> <h4> Model Training and </h4> <div></br> <b>Image Preprocessing and Testing</b> <p>Preprocessing for Daisy flowers</p> <img src="https://huggingface.co/spaces/miracle01/Flower_Classification/blob/main/output_daisy.png" alt="daisy flower" width="500" height="600"> </div> """
gr.Interface(fn=predict_image, inputs=image, outputs=label, title="Flower Classification using InceptionV3", description="A flower classification app built using python and deployed using gradio/n" + "NAME: OLUMIDE TOLULOPE SAMUEL", article=article, interpretation='default').launch()app.pyDeleted-42