Spaces:
Build error
Build error
Fixed Imports and Added DDescriptions
Browse files
app.py
CHANGED
|
@@ -6,8 +6,11 @@ from common.logger import AverageMeter
|
|
| 6 |
from common.logger import Logger
|
| 7 |
from data import download
|
| 8 |
from model import chmnet
|
| 9 |
-
from
|
|
|
|
|
|
|
| 10 |
from matplotlib.patches import ConnectionPatch
|
|
|
|
| 11 |
from PIL import Image
|
| 12 |
import numpy as np
|
| 13 |
import os
|
|
@@ -139,11 +142,17 @@ def generate_correspondences(sousrce_image, target_image, min_x=1, max_x=100, mi
|
|
| 139 |
|
| 140 |
|
| 141 |
# GRADIO APP
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
iface = gr.Interface(fn=generate_correspondences,
|
| 143 |
inputs=[gr.inputs.Image(shape=(240, 240), type='pil'),
|
| 144 |
gr.inputs.Image(shape=(240, 240), type='pil'),
|
| 145 |
-
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=15, label='
|
| 146 |
-
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=215, label='
|
| 147 |
-
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=15, label='
|
| 148 |
-
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=215, label='
|
|
|
|
|
|
|
| 149 |
iface.launch()
|
|
|
|
| 6 |
from common.logger import Logger
|
| 7 |
from data import download
|
| 8 |
from model import chmnet
|
| 9 |
+
from itertools import product
|
| 10 |
+
import matplotlib
|
| 11 |
+
import matplotlib.patches as patches
|
| 12 |
from matplotlib.patches import ConnectionPatch
|
| 13 |
+
from matplotlib import pyplot as plt
|
| 14 |
from PIL import Image
|
| 15 |
import numpy as np
|
| 16 |
import os
|
|
|
|
| 142 |
|
| 143 |
|
| 144 |
# GRADIO APP
|
| 145 |
+
title = "Correspondence Matching with Convolutional Hough Matching Networks "
|
| 146 |
+
description = "Performs keypoint transform from on a 7x7 gird from the source image to the target image. Use the sliders to adjust the grid."
|
| 147 |
+
article = "<p style='text-align: center'><a href='https://github.com/juhongm999/chm' target='_blank'>Github Repo</a></p>"
|
| 148 |
+
|
| 149 |
iface = gr.Interface(fn=generate_correspondences,
|
| 150 |
inputs=[gr.inputs.Image(shape=(240, 240), type='pil'),
|
| 151 |
gr.inputs.Image(shape=(240, 240), type='pil'),
|
| 152 |
+
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=15, label='Min X'),
|
| 153 |
+
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=215, label='Max X'),
|
| 154 |
+
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=15, label='Min Y'),
|
| 155 |
+
gr.inputs.Slider(minimum=1, maximum=240, step=1, default=215, label='Max Y')], outputs="plot", enable_queue=True, title=title,
|
| 156 |
+
description=description,
|
| 157 |
+
article=article,)
|
| 158 |
iface.launch()
|