Spaces:
Sleeping
Sleeping
diffusionai
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import os.path
|
2 |
-
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
import plotly.graph_objects as go
|
@@ -20,7 +19,6 @@ ALL_GUESSR_ARGS = {
|
|
20 |
"embedder": DinoV2Embedder(
|
21 |
device="cpu"
|
22 |
),
|
23 |
-
# "embedder": RandomEmbedder(n_dim=384),
|
24 |
"retriever": Retriever(
|
25 |
embeddings_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
26 |
"resources/embeddings.npy"),
|
@@ -32,13 +30,12 @@ ALL_GUESSR_ARGS = {
|
|
32 |
"embedder": DinoV2Embedder(
|
33 |
device="cpu"
|
34 |
),
|
35 |
-
# "embedder": RandomEmbedder(n_dim=384),
|
36 |
"retriever": Retriever(
|
37 |
embeddings_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
38 |
"resources/embeddings.npy"),
|
39 |
),
|
40 |
"metadata_path": os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
41 |
-
|
42 |
"n_neighbors": 100,
|
43 |
"dbscan_eps": 0.5
|
44 |
}
|
@@ -83,7 +80,7 @@ if __name__ == "__main__":
|
|
83 |
label="Guessr type",
|
84 |
info="More Guessr types will be added soon!"
|
85 |
)
|
86 |
-
image = gr.Image(shape
|
87 |
button = gr.Button(text="Guess")
|
88 |
interactive_map = gr.Plot()
|
89 |
demo.load(create_map, [guessr_dropdown], interactive_map)
|
|
|
1 |
import os.path
|
|
|
2 |
import numpy as np
|
3 |
import gradio as gr
|
4 |
import plotly.graph_objects as go
|
|
|
19 |
"embedder": DinoV2Embedder(
|
20 |
device="cpu"
|
21 |
),
|
|
|
22 |
"retriever": Retriever(
|
23 |
embeddings_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
24 |
"resources/embeddings.npy"),
|
|
|
30 |
"embedder": DinoV2Embedder(
|
31 |
device="cpu"
|
32 |
),
|
|
|
33 |
"retriever": Retriever(
|
34 |
embeddings_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
35 |
"resources/embeddings.npy"),
|
36 |
),
|
37 |
"metadata_path": os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
38 |
+
"resources/metadatav3.csv"),
|
39 |
"n_neighbors": 100,
|
40 |
"dbscan_eps": 0.5
|
41 |
}
|
|
|
80 |
label="Guessr type",
|
81 |
info="More Guessr types will be added soon!"
|
82 |
)
|
83 |
+
image = gr.Image() # Removed shape argument
|
84 |
button = gr.Button(text="Guess")
|
85 |
interactive_map = gr.Plot()
|
86 |
demo.load(create_map, [guessr_dropdown], interactive_map)
|