Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -241,9 +241,9 @@ def pano_depth_to_world_points(depth, location):
|
|
241 |
d_lat = lat + j/2 * np.pi / depth.shape[0] + location["pitch"] / 180 * np.pi
|
242 |
|
243 |
# Convert to cartesian coordinates
|
244 |
-
x = radius * np.cos(d_lon) * np.sin(d_lat) + location["
|
245 |
y = radius * np.cos(d_lat)
|
246 |
-
z = radius * np.sin(d_lon) * np.sin(d_lat) + location["
|
247 |
|
248 |
pts = np.stack([x, y, z], axis=1)
|
249 |
uvs = np.stack([lon, lat], axis=1)
|
@@ -873,8 +873,8 @@ with gr.Blocks(css=css) as demo:
|
|
873 |
for k, location in enumerate(locations):
|
874 |
lat = vincenty((location["lat"], 0), (avg[0], 0)) * 1000
|
875 |
lng = vincenty((0, location["lng"]), (0, avg[1])) * 1000
|
876 |
-
locations[k]["lat"] = lat / 2.5 *
|
877 |
-
locations[k]["lng"] = lng / 2.5 *
|
878 |
print(locations)
|
879 |
|
880 |
# Process the video and get the path of the output video
|
|
|
241 |
d_lat = lat + j/2 * np.pi / depth.shape[0] + location["pitch"] / 180 * np.pi
|
242 |
|
243 |
# Convert to cartesian coordinates
|
244 |
+
x = radius * np.cos(d_lon) * np.sin(d_lat) + location["lat"]
|
245 |
y = radius * np.cos(d_lat)
|
246 |
+
z = radius * np.sin(d_lon) * np.sin(d_lat) + location["lng"]
|
247 |
|
248 |
pts = np.stack([x, y, z], axis=1)
|
249 |
uvs = np.stack([lon, lat], axis=1)
|
|
|
873 |
for k, location in enumerate(locations):
|
874 |
lat = vincenty((location["lat"], 0), (avg[0], 0)) * 1000
|
875 |
lng = vincenty((0, location["lng"]), (0, avg[1])) * 1000
|
876 |
+
locations[k]["lat"] = lat / 2.5 * 95 * np.sign(location["lat"]-avg[0])
|
877 |
+
locations[k]["lng"] = lng / 2.5 * 95 * np.sign(location["lng"]-avg[1])
|
878 |
print(locations)
|
879 |
|
880 |
# Process the video and get the path of the output video
|