vincentb25 commited on
Commit
110d581
·
1 Parent(s): 16477d5

Fixing copilot stuff

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -142,7 +142,7 @@ def inference(query, labels, n_supp=10,
142
  # it used to be a matplotlib figure, turning it into a PIL image
143
  fig.canvas.draw()
144
  w, h = fig.canvas.get_width_height()
145
- img = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8).reshape(h, w, 3)
146
  return {k: float(v) for k, v in zip(labels, probs[0, 0])}, Image.fromarray(img)
147
  #return {k: float(v) for k, v in zip(labels, probs[0, 0])}, fig
148
 
 
142
  # it used to be a matplotlib figure, turning it into a PIL image
143
  fig.canvas.draw()
144
  w, h = fig.canvas.get_width_height()
145
+ img = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8).reshape(h, w, 3)
146
  return {k: float(v) for k, v in zip(labels, probs[0, 0])}, Image.fromarray(img)
147
  #return {k: float(v) for k, v in zip(labels, probs[0, 0])}, fig
148