SuperFeatures / app.py
YannisK's picture
temp state
9651aac
raw history blame
No virus
1.06 kB
import gradio as gr
def greet(name):
return "Hello " + name + "!!"
# Model to use
net_path = 'fire.pth'
# CPU / GPU
device = 'cpu'
# Images will be downscaled to this size prior processing with the network
image_size = 1024
# Wrapper
def generate_matching_superfeatures(im1, im2, scale=6):
# Possible Scales for multiscale inference
scales = [2.0, 1.414, 1.0, 0.707, 0.5, 0.353, 0.25]
# GRADIO APP
title = "Visualizing Super-features"
description = "TBD"
article = "<p style='text-align: center'><a href='https://github.com/naver/fire' target='_blank'>Original Github Repo</a></p>"
iface = gr.Interface(
fn=generate_matching_superfeatures,
inputs=[
gr.inputs.Image(shape=(240, 240), type="pil"),
gr.inputs.Image(shape=(240, 240), type="pil"),
gr.inputs.Slider(minimum=1, maximum=7, step=1, default=2, label="Scale")],
outputs="plot",
enable_queue=True,
title=title,
description=description,
article=article,
examples=[["chateau_1.png", "chateau_2.png", 6]],
)
iface.launch()