Spaces:
Build error
Build error
temp
Browse files
app.py
CHANGED
|
@@ -3,43 +3,40 @@ import gradio as gr
|
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
-
iface.launch()
|
| 8 |
-
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
#
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Model to use
|
| 8 |
+
net_path = 'fire.pth'
|
| 9 |
|
| 10 |
+
# CPU / GPU
|
| 11 |
+
device = 'cpu'
|
| 12 |
|
| 13 |
+
# Images will be downscaled to this size prior processing with the network
|
| 14 |
+
image_size = 1024
|
| 15 |
|
| 16 |
+
# Wrapper
|
| 17 |
+
def generate_matching_superfeatures(im1, im2, scale=6):
|
| 18 |
|
| 19 |
+
# Possible Scales for multiscale inference
|
| 20 |
+
scales = [2.0, 1.414, 1.0, 0.707, 0.5, 0.353, 0.25]
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
# GRADIO APP
|
| 24 |
+
title = "Visualizing Super-features"
|
| 25 |
+
description = "TBD"
|
| 26 |
+
article = "<p style='text-align: center'><a href='https://github.com/naver/fire' target='_blank'>Original Github Repo</a></p>"
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
iface = gr.Interface(
|
| 30 |
+
fn=generate_matching_superfeatures,
|
| 31 |
+
inputs=[
|
| 32 |
+
gr.inputs.Image(shape=(240, 240), type="pil"),
|
| 33 |
+
gr.inputs.Image(shape=(240, 240), type="pil"),
|
| 34 |
+
gr.inputs.Slider(minimum=1, maximum=7, step=1, default=2, label="Scale")],
|
| 35 |
+
outputs="plot",
|
| 36 |
+
enable_queue=True,
|
| 37 |
+
title=title,
|
| 38 |
+
description=description,
|
| 39 |
+
article=article,
|
| 40 |
+
examples=[["chateau_1.png", "chateau_2.png", 6]],
|
| 41 |
+
)
|
| 42 |
+
iface.launch()
|