Update app.py
Browse files
app.py
CHANGED
|
@@ -735,8 +735,8 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
| 735 |
locations = json.loads(coordinates)
|
| 736 |
for k, location in enumerate(locations):
|
| 737 |
if "tiles" in locations[k]:
|
| 738 |
-
locations[k]["heading"] = locations[k]["tiles"]["originHeading"]
|
| 739 |
-
locations[k]["pitch"] = locations[k]["tiles"]["originPitch"]
|
| 740 |
elif not "heading" in locations[k] or not "pitch" in locations[k]:
|
| 741 |
locations[k]["heading"] = 0.0
|
| 742 |
locations[k]["pitch"] = 0.0
|
|
@@ -766,6 +766,8 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
| 766 |
locations[k]["lng"] = float(lng / 2.5 * 111 * np.sign(location["lng"]-avg[1]))
|
| 767 |
# 2.5m is height of camera on google street view car,
|
| 768 |
# distance from center of sphere to pavement roughly 255 - 144 = 111 units
|
|
|
|
|
|
|
| 769 |
print(locations)
|
| 770 |
|
| 771 |
for l, sec in enumerate(s):
|
|
|
|
| 735 |
locations = json.loads(coordinates)
|
| 736 |
for k, location in enumerate(locations):
|
| 737 |
if "tiles" in locations[k]:
|
| 738 |
+
locations[k]["heading"] = locations[k]["tiles"]["originHeading"]
|
| 739 |
+
locations[k]["pitch"] = locations[k]["tiles"]["originPitch"]
|
| 740 |
elif not "heading" in locations[k] or not "pitch" in locations[k]:
|
| 741 |
locations[k]["heading"] = 0.0
|
| 742 |
locations[k]["pitch"] = 0.0
|
|
|
|
| 766 |
locations[k]["lng"] = float(lng / 2.5 * 111 * np.sign(location["lng"]-avg[1]))
|
| 767 |
# 2.5m is height of camera on google street view car,
|
| 768 |
# distance from center of sphere to pavement roughly 255 - 144 = 111 units
|
| 769 |
+
locations[k]["heading"] = locations[k]["heading"] / 180 * np.pi
|
| 770 |
+
locations[k]["pitch"] = locations[k]["pitch"] / 180 * np.pi
|
| 771 |
print(locations)
|
| 772 |
|
| 773 |
for l, sec in enumerate(s):
|