Spaces:
Runtime error
Runtime error
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 |
-
image = PILImage.create(image)
|
| 91 |
pred, pred_idx, probs = model.predict(image)
|
| 92 |
|
| 93 |
seg_img = None
|
|
@@ -132,11 +132,11 @@ 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(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)],
|
| 139 |
title='Solar Panel Anomaly Detector',
|
| 140 |
description=description,
|
| 141 |
-
examples=[[], []],
|
| 142 |
article= '<center>by <a href="https://www.linkedin.com/in/lzk/">Lee Zhe Kaai</a></center>').launch()
|
|
|
|
| 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(type='pil', 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)],
|
| 139 |
title='Solar Panel Anomaly Detector',
|
| 140 |
description=description,
|
| 141 |
+
#examples=[[], []],
|
| 142 |
article= '<center>by <a href="https://www.linkedin.com/in/lzk/">Lee Zhe Kaai</a></center>').launch()
|