Spaces:
Runtime error
Runtime error
Plat
commited on
Commit
·
89bb1fd
1
Parent(s):
37faef4
chore: update examples
Browse files- app.py +19 -5
- examples/sample_01.jpg +3 -0
- examples/sample_02.jpg +3 -0
- examples/sample_03.jpg +3 -0
- examples/sample_04.jpg +3 -0
- examples/sample_05.jpg +3 -0
- examples/sample_06.jpg +3 -0
- examples/sample_07.jpg +3 -0
- examples/sample_08.jpg +3 -0
app.py
CHANGED
|
@@ -69,18 +69,32 @@ def calculate_similarity(model_name: str, image_1: Image.Image, image_2: Image.I
|
|
| 69 |
|
| 70 |
with gr.Blocks() as demo:
|
| 71 |
with gr.Row():
|
| 72 |
-
with gr.Column():
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
|
|
|
| 76 |
model_name = gr.Dropdown(
|
| 77 |
label="Model",
|
| 78 |
choices=list(MODELS.keys()),
|
| 79 |
value=list(MODELS.keys())[0],
|
| 80 |
)
|
| 81 |
submit_btn = gr.Button("Submit", variant="primary")
|
| 82 |
-
|
| 83 |
-
with gr.Column():
|
| 84 |
similarity = gr.Label(label="Similarity")
|
| 85 |
|
| 86 |
gr.on(
|
|
|
|
| 69 |
|
| 70 |
with gr.Blocks() as demo:
|
| 71 |
with gr.Row():
|
| 72 |
+
with gr.Column(scale=2):
|
| 73 |
+
with gr.Row():
|
| 74 |
+
image_1 = gr.Image(label="Image 1", type="pil")
|
| 75 |
+
|
| 76 |
+
image_2 = gr.Image(label="Image 2", type="pil")
|
| 77 |
+
|
| 78 |
+
gr.Examples(
|
| 79 |
+
examples=[
|
| 80 |
+
["./examples/sample_01.jpg", "./examples/sample_02.jpg"],
|
| 81 |
+
["./examples/sample_01.jpg", "./examples/sample_05.jpg"],
|
| 82 |
+
["./examples/sample_01.jpg", "./examples/sample_06.jpg"],
|
| 83 |
+
["./examples/sample_01.jpg", "./examples/sample_03.jpg"],
|
| 84 |
+
["./examples/sample_04.jpg", "./examples/sample_03.jpg"],
|
| 85 |
+
["./examples/sample_01.jpg", "./examples/sample_07.jpg"],
|
| 86 |
+
["./examples/sample_07.jpg", "./examples/sample_08.jpg"],
|
| 87 |
+
],
|
| 88 |
+
inputs=[image_1, image_2],
|
| 89 |
+
)
|
| 90 |
|
| 91 |
+
with gr.Column():
|
| 92 |
model_name = gr.Dropdown(
|
| 93 |
label="Model",
|
| 94 |
choices=list(MODELS.keys()),
|
| 95 |
value=list(MODELS.keys())[0],
|
| 96 |
)
|
| 97 |
submit_btn = gr.Button("Submit", variant="primary")
|
|
|
|
|
|
|
| 98 |
similarity = gr.Label(label="Similarity")
|
| 99 |
|
| 100 |
gr.on(
|
examples/sample_01.jpg
ADDED
|
Git LFS Details
|
examples/sample_02.jpg
ADDED
|
Git LFS Details
|
examples/sample_03.jpg
ADDED
|
Git LFS Details
|
examples/sample_04.jpg
ADDED
|
Git LFS Details
|
examples/sample_05.jpg
ADDED
|
Git LFS Details
|
examples/sample_06.jpg
ADDED
|
Git LFS Details
|
examples/sample_07.jpg
ADDED
|
Git LFS Details
|
examples/sample_08.jpg
ADDED
|
Git LFS Details
|