adithya12 commited on
Commit
8efa671
·
1 Parent(s): f40a280

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,8 +1,10 @@
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()
 
1
+ from huggingface_hub import from_pretrained_keras
2
  import gradio as gr
3
+ import tensorflow as tf
4
  import numpy as np
5
+
6
+ m = from_pretrained_keras('adithya12/monkeypox-model-lin')
7
  def predict(inp):
8
+ prediction = m.predict(np.array([tf.keras.preprocessing.image.img_to_array(inp)]) )
9
  return (1-prediction)*100
10
+ gr.Interface(fn=predict,inputs=gr.Image(shape=(224, 224)),outputs=gr.Number()).launch(server_name="0.0.0.0")