diff --git a/Procfile b/Procfile new file mode 100644 index 000000000..cf1213167 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: python app/server.py serve diff --git a/app/server.py b/app/server.py index fc713eaba..f41774bfa 100644 --- a/app/server.py +++ b/app/server.py @@ -1,6 +1,8 @@ import aiohttp import asyncio import uvicorn +import os +import requests from fastai import * from fastai.vision import * from io import BytesIO @@ -9,10 +11,12 @@ from starlette.responses import HTMLResponse, JSONResponse from starlette.staticfiles import StaticFiles -export_file_url = 'https://www.dropbox.com/s/6bgq8t6yextloqp/export.pkl?raw=1' +export_file_url = 'https://www.dropbox.com/s/2w5fwbf51ovz2aj/export.pkl?dl=1' export_file_name = 'export.pkl' -classes = ['black', 'grizzly', 'teddys'] +Port = int(os.environ.get('PORT', 50000)) + +classes = ['social dist', 'no social dist'] path = Path(__file__).parent app = Starlette() @@ -66,4 +70,4 @@ async def analyze(request): if __name__ == '__main__': if 'serve' in sys.argv: - uvicorn.run(app=app, host='0.0.0.0', port=5000, log_level="info") + uvicorn.run(app=app, host='0.0.0.0', port=Port, log_level="info") diff --git a/app/view/index.html b/app/view/index.html index 6642e26f5..66bd6b61f 100644 --- a/app/view/index.html +++ b/app/view/index.html @@ -7,10 +7,9 @@
- Use images of teddy bears, black bears, grizzly bears, or - all three! + Use images from drones, CCTV, etc!