Spaces:
Build error
Build error
tmp
Browse files
app.py
CHANGED
@@ -119,20 +119,18 @@ def generate_matching_superfeatures(im1, im2, scale_id=6, threshold=50):
|
|
119 |
fig1 = plt.figure(1)
|
120 |
plt.imshow(cv2.cvtColor(img1rsz, cv2.COLOR_BGR2RGB))
|
121 |
ax1 = plt.gca()
|
122 |
-
ax1.axis('scaled')
|
123 |
ax1.axis('off')
|
124 |
-
|
125 |
plt.tight_layout()
|
126 |
-
fig1.canvas.draw()
|
127 |
|
128 |
fig2 = plt.figure(2)
|
129 |
plt.imshow(cv2.cvtColor(img2rsz, cv2.COLOR_BGR2RGB))
|
130 |
ax2 = plt.gca()
|
131 |
-
ax2.axis('scaled')
|
132 |
ax2.axis('off')
|
133 |
-
|
134 |
plt.tight_layout()
|
135 |
-
fig2.canvas.draw()
|
136 |
|
137 |
# fig = plt.figure()
|
138 |
# grid = ImageGrid(fig, 111, nrows_ncols=(2, 1), axes_pad=0.1)
|
@@ -147,7 +145,7 @@ def generate_matching_superfeatures(im1, im2, scale_id=6, threshold=50):
|
|
147 |
# # Now we can save it to a numpy array.
|
148 |
# data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
|
149 |
# data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
150 |
-
return fig1,fig2
|
151 |
|
152 |
|
153 |
# GRADIO APP
|
|
|
119 |
fig1 = plt.figure(1)
|
120 |
plt.imshow(cv2.cvtColor(img1rsz, cv2.COLOR_BGR2RGB))
|
121 |
ax1 = plt.gca()
|
122 |
+
# ax1.axis('scaled')
|
123 |
ax1.axis('off')
|
|
|
124 |
plt.tight_layout()
|
125 |
+
# fig1.canvas.draw()
|
126 |
|
127 |
fig2 = plt.figure(2)
|
128 |
plt.imshow(cv2.cvtColor(img2rsz, cv2.COLOR_BGR2RGB))
|
129 |
ax2 = plt.gca()
|
130 |
+
# ax2.axis('scaled')
|
131 |
ax2.axis('off')
|
|
|
132 |
plt.tight_layout()
|
133 |
+
# fig2.canvas.draw()
|
134 |
|
135 |
# fig = plt.figure()
|
136 |
# grid = ImageGrid(fig, 111, nrows_ncols=(2, 1), axes_pad=0.1)
|
|
|
145 |
# # Now we can save it to a numpy array.
|
146 |
# data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
|
147 |
# data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
148 |
+
return fig1, fig2
|
149 |
|
150 |
|
151 |
# GRADIO APP
|