Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
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()
|