Pashtetuum commited on
Commit
0519ad3
1 Parent(s): 567dc83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -37,7 +37,10 @@ def predict(zip_bytes):
37
  predicted_class = np.argmax(prediction)
38
  decoded_class = label_encoder.inverse_transform([predicted_class])[0]
39
  predicted_class_translation = translator(decoded_class)
40
- predictions.append((filename, predicted_class_translation))
 
 
 
41
  return predictions
42
 
43
  interface = gr.Interface(
 
37
  predicted_class = np.argmax(prediction)
38
  decoded_class = label_encoder.inverse_transform([predicted_class])[0]
39
  predicted_class_translation = translator(decoded_class)
40
+ # Сохранение изображения в формате base64
41
+ _, img_encoded = cv2.imencode('.png', img_resized)
42
+ img_base64 = base64.b64encode(img_encoded).decode('utf-8')
43
+ predictions.append((filename,img_base64, predicted_class_translation))
44
  return predictions
45
 
46
  interface = gr.Interface(