Spaces:
Runtime error
Runtime error
from flask import Flask, render_template,request | |
import os | |
async_mode = None | |
app = Flask(__name__) | |
#socket_ = SocketIO(app, async_mode=async_mode) | |
def main(): | |
dic = request.form.to_dict() | |
cam0_path = ['1.jpeg','2.jpeg','3.jpeg','4.jpeg','5.jpeg','6.jpeg','7.jpeg'] | |
cam2_path = ['1.jpeg','2.jpeg','3.jpeg','4.jpeg','5.jpeg','6.jpeg','7.jpeg'] | |
altitudeA = ['1.jpeg','2.jpeg','3.jpeg','4.jpeg','5.jpeg','6.jpeg','7.jpeg'] | |
altitudeB = ['1.jpeg','2.jpeg','3.jpeg','4.jpeg','5.jpeg','6.jpeg','7.jpeg'] | |
altitudeC = ['1.jpeg','2.jpeg','3.jpeg','4.jpeg','5.jpeg','6.jpeg','7.jpeg'] | |
a = 24.93469617660818 - 24.930030968834455 | |
incr = a / 3787 | |
b = 67.11389561813051-67.11555819607344 | |
long_incr = b/3787 | |
try: | |
startlong = float(dic['startlong']) | |
endlong = float(dic['endlong']) | |
startlat = float(dic['startlat']) | |
endlat = float(dic['endlat']) | |
cam1_path = [] | |
cam0_path = [] | |
cam2_path = [] | |
altitudeB = [] | |
latitudes = [] | |
longitudes = [] | |
img_path = [] | |
altitudeA = [] | |
j = startlat | |
k = startlong | |
while j < endlat: | |
cam1_path.append(str(j)+'.jpg') | |
cam0_path.append(str(j)+'.jpg') | |
img_path.append(str(j)+'.jpg') | |
altitudeA.append(str(j)+'.jpg') | |
latitudes.append(j) | |
longitudes.append(k) | |
print(j) | |
j = j+incr | |
k = k+long_incr | |
print(cam1_path) | |
print("This is start lat: ",startlat) | |
print("This is end lat: ",endlat) | |
except: | |
startlong = 67.11528342398769 | |
startlat = 24.93003937149469 | |
cam1_path = [] | |
cam0_path = [] | |
cam2_path = [] | |
altitudeA = [] | |
latitudes = [] | |
img_path = [] | |
longitudes = [] | |
print("not working") | |
return render_template('index.html',lat= startlat ,lng = startlong, img_path = img_path, | |
latitudes= latitudes,longitudes=longitudes, cam0_path= cam0_path, cam2_path= cam2_path,cam1_path=cam1_path, | |
altitudeA=altitudeA, altitudeB= altitudeB, altitudeC=altitudeC) | |
# lat= 24.93003937149469 ,lng = 67.11528342398769 | |
# 24.933053084144234, 67.09065411201489 | |
# 24.93297525276925, 67.08743546136783 | |
# 24.93469617660818, 67.11111809146837 | |
if __name__ == "__main__": | |
app.run(debug=True,host="0.0.0.0",port=5000) | |