freealise commited on
Commit
9125fef
1 Parent(s): 7095767

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -14,6 +14,7 @@ import tempfile
14
  from functools import partial
15
  import spaces
16
  from zipfile import ZipFile
 
17
  import json
18
 
19
  from depth_anything.dpt import DepthAnything
@@ -879,10 +880,10 @@ with gr.Blocks(css=css) as demo:
879
  avg[0] = avg[0] / len(locations)
880
  avg[1] = avg[1] / len(locations)
881
  for k, location in enumerate(locations):
882
- lat = location["lat"] - avg[0]
883
- lng = location["lng"] - avg[1]
884
- locations[k]["lat"] = measure(0, 0, lat, 0) / 2.5 * 100 * np.sign(lat)
885
- locations[k]["lng"] = measure(0, 0, 0, lng) / 2.5 * 100 * np.sign(lng)
886
  print(locations)
887
 
888
  # Process the video and get the path of the output video
 
14
  from functools import partial
15
  import spaces
16
  from zipfile import ZipFile
17
+ from vincenty import vincenty
18
  import json
19
 
20
  from depth_anything.dpt import DepthAnything
 
880
  avg[0] = avg[0] / len(locations)
881
  avg[1] = avg[1] / len(locations)
882
  for k, location in enumerate(locations):
883
+ lat = vincenty((location["lat"], 0), (avg[0], 0)) * 1000
884
+ lng = vincenty((0, location["lng"]), (0, avg[1])) * 1000
885
+ locations[k]["lat"] = lat / 2.5 * 100 * np.sign(location["lat"]-avg[0])
886
+ locations[k]["lng"] = lng / 2.5 * 100 * np.sign(location["lng"]-avg[1])
887
  print(locations)
888
 
889
  # Process the video and get the path of the output video