Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,11 +50,15 @@ def fetch_streetview(address):
|
|
| 50 |
}
|
| 51 |
sv_res = requests.get(sv_url, params=sv_params)
|
| 52 |
|
| 53 |
-
|
| 54 |
gr.Info("Image successfully loaded!")
|
| 55 |
return Image.open(BytesIO(sv_res.content))
|
| 56 |
else:
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
# --- 3. Spatial Drawing Engine ---
|
| 59 |
def draw_forensic_targets(image, report_text):
|
| 60 |
annotated_img = image.copy()
|
|
|
|
| 50 |
}
|
| 51 |
sv_res = requests.get(sv_url, params=sv_params)
|
| 52 |
|
| 53 |
+
if sv_res.status_code == 200:
|
| 54 |
gr.Info("Image successfully loaded!")
|
| 55 |
return Image.open(BytesIO(sv_res.content))
|
| 56 |
else:
|
| 57 |
+
# This will expose the exact JSON text Google sends back with the 403
|
| 58 |
+
error_msg = sv_res.text if sv_res.text else "No reason provided."
|
| 59 |
+
raise gr.Error(f"Maps 403 Error: {error_msg}")
|
| 60 |
+
|
| 61 |
+
|
| 62 |
# --- 3. Spatial Drawing Engine ---
|
| 63 |
def draw_forensic_targets(image, report_text):
|
| 64 |
annotated_img = image.copy()
|