adithya12 commited on
Commit
f40a280
·
1 Parent(s): 7725e21

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import tensorflow as tf
2
+ import gradio as gr
3
+ import numpy as np
4
+ model = tf.keras.models.load_model('Model.h5')
5
+ def predict(inp):
6
+ prediction = model.predict(np.array([tf.keras.preprocessing.image.img_to_array(inp)]) )
7
+ return (1-prediction)*100
8
+ gr.Interface(fn=predict,inputs=gr.Image(shape=(224, 224)),outputs=gr.Number()).launch()