-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.py
More file actions
22 lines (19 loc) · 719 Bytes
/
run.py
File metadata and controls
22 lines (19 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from flask import redirect
from app import create_app
from app.api.monodepth import monodepth_api_v1
from app.api.api_v1 import root_api_v1
from waitress import serve
from app.cnns.monodepth.monodepth_bridge import MonodepthBridge as mb
import tensorflow as tf
app = create_app(os.getenv('FLASK_CONFIG_TYPE') or 'dev')
app.register_blueprint(monodepth_api_v1)
app.register_blueprint(root_api_v1)
@app.route('/')
def root():
return redirect('/v1/cnns')
if __name__ == '__main__':
mb.init_env()
host = os.environ.get('IP', '0.0.0.0')
port = int(os.environ.get("PORT", 5000))
serve(app, host=host, port=port) if (os.getenv('FLASK_CONFIG_TYPE') == 'prod') else app.run(host=host, port=port)