grixelle commited on
Commit
108875a
·
verified ·
1 Parent(s): 79540f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -50,11 +50,15 @@ def fetch_streetview(address):
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
- raise gr.Error(f"Street View Download Error: {sv_res.status_code}")
 
 
 
 
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()