Spaces:
Running
Running
nicolas-dufour
commited on
Commit
•
99dc3ef
1
Parent(s):
a9daee5
initial commit
Browse files
app.py
CHANGED
@@ -53,10 +53,10 @@ def predict_location(image, model_name, cfg=0.0, num_samples=256):
|
|
53 |
pipe = PIPES[model_name]
|
54 |
|
55 |
# Get regular predictions
|
56 |
-
predicted_gps = pipe(img, batch_size=num_samples, cfg=cfg, num_steps=
|
57 |
|
58 |
# Get single high-confidence prediction
|
59 |
-
high_conf_gps = pipe(img, batch_size=1, cfg=2.0, num_steps=
|
60 |
return {
|
61 |
"lat": predicted_gps[:, 0].astype(float).tolist(),
|
62 |
"lon": predicted_gps[:, 1].astype(float).tolist(),
|
@@ -174,7 +174,7 @@ def main():
|
|
174 |
# Header with custom styling
|
175 |
colored_header(
|
176 |
label="🗺️ Around the World in 80 Timesteps: A Generative Approach to Global Visual Geolocation",
|
177 |
-
description="Upload an image and our model, PLONK, will predict possible locations! In red we will sample one point with guidance scale 2.0 for the best guess.
|
178 |
color_name="red-70",
|
179 |
)
|
180 |
|
@@ -207,7 +207,7 @@ def main():
|
|
207 |
"🎲 Number of samples",
|
208 |
min_value=1,
|
209 |
max_value=5000,
|
210 |
-
value=
|
211 |
step=1,
|
212 |
help="Number of location predictions to generate. More samples give better coverage but take longer to compute.",
|
213 |
)
|
|
|
53 |
pipe = PIPES[model_name]
|
54 |
|
55 |
# Get regular predictions
|
56 |
+
predicted_gps = pipe(img, batch_size=num_samples, cfg=cfg, num_steps=16)
|
57 |
|
58 |
# Get single high-confidence prediction
|
59 |
+
high_conf_gps = pipe(img, batch_size=1, cfg=2.0, num_steps=16)
|
60 |
return {
|
61 |
"lat": predicted_gps[:, 0].astype(float).tolist(),
|
62 |
"lon": predicted_gps[:, 1].astype(float).tolist(),
|
|
|
174 |
# Header with custom styling
|
175 |
colored_header(
|
176 |
label="🗺️ Around the World in 80 Timesteps: A Generative Approach to Global Visual Geolocation",
|
177 |
+
description="Upload an image and our model, PLONK, will predict possible locations! In red we will sample one point with guidance scale 2.0 for the best guess. Project page: https://nicolas-dufour.github.io/plonk",
|
178 |
color_name="red-70",
|
179 |
)
|
180 |
|
|
|
207 |
"🎲 Number of samples",
|
208 |
min_value=1,
|
209 |
max_value=5000,
|
210 |
+
value=64,
|
211 |
step=1,
|
212 |
help="Number of location predictions to generate. More samples give better coverage but take longer to compute.",
|
213 |
)
|