Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import tensorflow as tf
|
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import tensorflow.keras as keras
|
6 |
-
import keras.applications.vgg16 as vgg16
|
7 |
|
8 |
from tensorflow.keras.models import load_model
|
9 |
|
@@ -14,7 +14,7 @@ classnames=["Fire","Non-Fire"]
|
|
14 |
def predict_image(img):
|
15 |
img_4d=img.reshape(-1,180,180,3)
|
16 |
prediction=model.predict(img_4d)[0]
|
17 |
-
return {
|
18 |
|
19 |
image=gr.inputs.Image(shape=(180,180))
|
20 |
label=gr.outputs.Label(num_top_classes=2)
|
@@ -22,4 +22,4 @@ label=gr.outputs.Label(num_top_classes=2)
|
|
22 |
artice="<p style='text-align: center'>Made by Mahak xoxo</p>"
|
23 |
|
24 |
|
25 |
-
gr.Interface(fn=predict_image,inputs=image,title="Forest Fire Classifier",description="
|
|
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import tensorflow.keras as keras
|
6 |
+
#import keras.applications.vgg16 as vgg16
|
7 |
|
8 |
from tensorflow.keras.models import load_model
|
9 |
|
|
|
14 |
def predict_image(img):
|
15 |
img_4d=img.reshape(-1,180,180,3)
|
16 |
prediction=model.predict(img_4d)[0]
|
17 |
+
return {classnames[i]: float(prediction[i] for i in range(2))}
|
18 |
|
19 |
image=gr.inputs.Image(shape=(180,180))
|
20 |
label=gr.outputs.Label(num_top_classes=2)
|
|
|
22 |
artice="<p style='text-align: center'>Made by Mahak xoxo</p>"
|
23 |
|
24 |
|
25 |
+
gr.Interface(fn=predict_image,inputs=image,title="Forest Fire Classifier",description="This is a forest fire classification model ",outputs=label,article=article,enable_queue=True,interpretation='default').launch(share=True)
|