Philippe Weinzaepfel
commited on
Commit
·
a49c8fd
1
Parent(s):
3ef85e9
matplotlib clf, image input reshaping to None
Browse files
app.py
CHANGED
|
@@ -23,16 +23,18 @@ def pump_matching(img1, img2, trained_with_st=False, scale=300, max_scale=1, max
|
|
| 23 |
corres = Main().run_from_args_with_images(img1, img2, args)
|
| 24 |
|
| 25 |
fig1 = plt.figure(1)
|
| 26 |
-
plt.
|
| 27 |
ax1 = plt.gca()
|
|
|
|
| 28 |
ax1.axis('off')
|
| 29 |
-
plt.tight_layout()
|
| 30 |
|
| 31 |
fig2 = plt.figure(2)
|
| 32 |
-
plt.
|
| 33 |
ax2 = plt.gca()
|
|
|
|
| 34 |
ax2.axis('off')
|
| 35 |
-
plt.tight_layout()
|
| 36 |
|
| 37 |
from tools.viz import plot_grid
|
| 38 |
if corres.shape[-1] > 4:
|
|
@@ -54,8 +56,8 @@ article = "<p style='text-align: center'><a href='https://github.com/naver/pump'
|
|
| 54 |
iface = gr.Interface(
|
| 55 |
fn=pump_matching,
|
| 56 |
inputs=[
|
| 57 |
-
gr.inputs.Image(shape=
|
| 58 |
-
gr.inputs.Image(shape=
|
| 59 |
gr.inputs.Checkbox(default=False, label="Use the model trained with style transfer"),
|
| 60 |
#gr.inputs.Slider(minimum=300, maximum=600, default=400, step=1, label="Original test scale"),
|
| 61 |
#gr.inputs.Slider(minimum=1, maximum=4, default=1, step=0.1, label="Multi Scale Testing - maximum scale (makes it slower)"),
|
|
|
|
| 23 |
corres = Main().run_from_args_with_images(img1, img2, args)
|
| 24 |
|
| 25 |
fig1 = plt.figure(1)
|
| 26 |
+
plt.clf()
|
| 27 |
ax1 = plt.gca()
|
| 28 |
+
ax1.imshow(img1)
|
| 29 |
ax1.axis('off')
|
| 30 |
+
plt.tight_layout(pad=0)
|
| 31 |
|
| 32 |
fig2 = plt.figure(2)
|
| 33 |
+
plt.clf()
|
| 34 |
ax2 = plt.gca()
|
| 35 |
+
ax2.imshow(img2)
|
| 36 |
ax2.axis('off')
|
| 37 |
+
plt.tight_layout(pad=0)
|
| 38 |
|
| 39 |
from tools.viz import plot_grid
|
| 40 |
if corres.shape[-1] > 4:
|
|
|
|
| 56 |
iface = gr.Interface(
|
| 57 |
fn=pump_matching,
|
| 58 |
inputs=[
|
| 59 |
+
gr.inputs.Image(shape=None, type="pil", label="First Image"),
|
| 60 |
+
gr.inputs.Image(shape=None, type="pil", label="Second Image"),
|
| 61 |
gr.inputs.Checkbox(default=False, label="Use the model trained with style transfer"),
|
| 62 |
#gr.inputs.Slider(minimum=300, maximum=600, default=400, step=1, label="Original test scale"),
|
| 63 |
#gr.inputs.Slider(minimum=1, maximum=4, default=1, step=0.1, label="Multi Scale Testing - maximum scale (makes it slower)"),
|