YannisK commited on
Commit
8ff5253
1 Parent(s): 5530a67
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -246,16 +246,14 @@ def generate_matching_superfeatures(im1, im2, Imagenet_model=False, scale_id=6,
246
  f = lambda m,c: plt.plot([],[],marker=m, color=c, ls="none")[0]
247
  handles = [f("s", col.colors[i]) for i in range(n_sf_ids)]
248
  labels = sf_idx_
249
- legend = plt.legend(handles, sf_idx_, loc=3, framealpha=1, frameon=False)
250
-
251
- def export_legend(legend, filename="legend.png"):
252
- fig = legend.figure
253
- fig.canvas.draw()
254
- # bbox = legend.get_window_extent().transformed(fig.dpi_scale_trans.inverted())
255
- # fig.savefig(filename, dpi="figure", bbox_inches=bbox)
256
- return fig
257
 
258
- return fig1, fig2, export_legend(legend)
259
  # ','.join(map(str, sf_idx_))
260
 
261
 
 
246
  f = lambda m,c: plt.plot([],[],marker=m, color=c, ls="none")[0]
247
  handles = [f("s", col.colors[i]) for i in range(n_sf_ids)]
248
  labels = sf_idx_
249
+ fig_leg = plt.figure(3)
250
+ legend = plt.legend(handles, sf_idx_, loc=3, framealpha=1, frameon=False, facecolor='w')
251
+ # fig_leg = legend.figure
252
+ fig_leg.canvas.draw()
253
+ # bbox = legend.get_window_extent().transformed(fig.dpi_scale_trans.inverted())
254
+
 
 
255
 
256
+ return fig1, fig2, fig_leg
257
  # ','.join(map(str, sf_idx_))
258
 
259