Итак, вместо использования такой структуры:
Код: Выделить всё
def main():
app.run(host='0.0.0.0', debug=True)
@app.route('/')
def video_feed():
return Response(apply_detections(), mimetype='multipart/x-mixed-replace; boundary=frame')
if __name__ == '__main__':
main()
Код: Выделить всё
apply_detections()Код: Выделить всё
def main():
loaded_model = load_model() # this should load the model before-hand
loaded_tracker = load_tracker() # same here. This should load the model before-hand
app.run(host='0.0.0.0', debug=True)
@app.route('/')
def video_feed():
return Response(apply_detections(loaded_model, loaded_tracker), mimetype='multipart/x-mixed-replace; boundary=frame')
if __name__ == '__main__':
main()
Итак, мой вопрос: какой способ передачи аргумента является правильным?>
Подробнее здесь: https://stackoverflow.com/questions/798 ... ng-the-url
Мобильная версия