Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -87,7 +87,7 @@ def predict(classification_mode, image):
|
|
87 |
|
88 |
labels = model.dls.vocab
|
89 |
# Classification model prediction
|
90 |
-
|
91 |
pred, pred_idx, probs = model.predict(image)
|
92 |
|
93 |
seg_img = None
|
@@ -132,7 +132,7 @@ description = """
|
|
132 |
gr.Interface(fn=predict,
|
133 |
inputs= [gr.Dropdown(choices=['Binary Classification', 'Multiclass Classification'], label='Classification Mode:',
|
134 |
info='Choose to classify between anomaly and no-anomaly OR between 12 different types of anomalies.'),
|
135 |
-
gr.Image(
|
136 |
outputs=[gr.outputs.Label(num_top_classes=3, label='Detected:').style(container=False),
|
137 |
gr.Image(type='pil', label=' ').style(height=240, width=144),
|
138 |
gr.Textbox(label='Affected area:').style(container=False)],
|
|
|
87 |
|
88 |
labels = model.dls.vocab
|
89 |
# Classification model prediction
|
90 |
+
image = PILImage.create(image)
|
91 |
pred, pred_idx, probs = model.predict(image)
|
92 |
|
93 |
seg_img = None
|
|
|
132 |
gr.Interface(fn=predict,
|
133 |
inputs= [gr.Dropdown(choices=['Binary Classification', 'Multiclass Classification'], label='Classification Mode:',
|
134 |
info='Choose to classify between anomaly and no-anomaly OR between 12 different types of anomalies.'),
|
135 |
+
gr.Image(label='Input infrared image: ')],
|
136 |
outputs=[gr.outputs.Label(num_top_classes=3, label='Detected:').style(container=False),
|
137 |
gr.Image(type='pil', label=' ').style(height=240, width=144),
|
138 |
gr.Textbox(label='Affected area:').style(container=False)],
|