freealise commited on
Commit
a0dc50f
·
verified ·
1 Parent(s): 252102c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -764,6 +764,9 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
764
  lng = vincenty((0, location["lng"]), (0, avg[1])) * 1000
765
  locations[k]["lat"] = float(lat / 2.5 * 111 * np.sign(location["lat"]-avg[0]))
766
  locations[k]["lng"] = float(lng / 2.5 * 111 * np.sign(location["lng"]-avg[1]))
 
 
 
767
 
768
  for l, sec in enumerate(s):
769
  s[l] = s[l] + 1
@@ -776,14 +779,14 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
776
 
777
  vtt = vtt + str(k+1) + "\n" + str(h[0]).zfill(2) + ":" + str(m[0]).zfill(2) + ":" + str(s[0]).zfill(2) + ".000 --> " + str(h[1]).zfill(2) + ":" + str(m[1]).zfill(2) + ":" + str(s[1]).zfill(2) + ".000\n" + str(locations[k]["lat"]) + "," + str(locations[k]["lng"]) + " " + str(locations[k]["heading"]) + "," + str(locations[k]["pitch"]) + "\n\n"
778
 
779
- print(locations)
780
- # 2.5m is height of camera on google street view car,
781
- # distance from center of sphere to pavement roughly 255 - 144 = 111 units
782
 
783
  # Process the video and get the path of the output video
784
  output_video_path = make_video(uploaded_video,encoder=model_type,blur_data=blurin,o=boffset,b=bsize)
785
 
786
- return output_video_path + (vtt[0:-2],) #(json.dumps(locations),)
787
 
788
  submit.click(on_submit, inputs=[input_video, model_type, blur_in, boffset, bsize, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
789
 
 
764
  lng = vincenty((0, location["lng"]), (0, avg[1])) * 1000
765
  locations[k]["lat"] = float(lat / 2.5 * 111 * np.sign(location["lat"]-avg[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
+ print(locations)
770
 
771
  for l, sec in enumerate(s):
772
  s[l] = s[l] + 1
 
779
 
780
  vtt = vtt + str(k+1) + "\n" + str(h[0]).zfill(2) + ":" + str(m[0]).zfill(2) + ":" + str(s[0]).zfill(2) + ".000 --> " + str(h[1]).zfill(2) + ":" + str(m[1]).zfill(2) + ":" + str(s[1]).zfill(2) + ".000\n" + str(locations[k]["lat"]) + "," + str(locations[k]["lng"]) + " " + str(locations[k]["heading"]) + "," + str(locations[k]["pitch"]) + "\n\n"
781
 
782
+ f = open("orig_result.vtt", "w")
783
+ f.write(vtt[0:-2])
784
+ f.close()
785
 
786
  # Process the video and get the path of the output video
787
  output_video_path = make_video(uploaded_video,encoder=model_type,blur_data=blurin,o=boffset,b=bsize)
788
 
789
+ return output_video_path + ("orig_result.vtt",) #(json.dumps(locations),)
790
 
791
  submit.click(on_submit, inputs=[input_video, model_type, blur_in, boffset, bsize, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
792