Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
-
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
-
|
|
|
|
| 5 |
def predict(inp):
|
| 6 |
-
prediction =
|
| 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")
|