zklee98 commited on
Commit
fedae66
·
verified ·
1 Parent(s): f876e21

Update app.py

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