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 @@
-
Classify Bear Images 🐻
+
Check if social distancing is being followed or not.

- Use images of teddy bears, black bears, grizzly bears, or - all three! + Use images from drones, CCTV, etc!

diff --git a/requirements.txt b/requirements.txt index 0855d0de0..a93ae15d6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ -aiofiles==0.5.0 -aiohttp==3.6.2 +aiofiles==0.4.0 +aiohttp==3.5.4 asyncio==3.4.3 fastai==1.0.61 -torch==1.6.0 -torchvision==0.7.0 -numpy==1.19.0 -pillow~=7.2 +https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-linux_x86_64.whl +https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp37-cp37m-linux_x86_64.whl +numpy==1.16.3 +pillow~=7.1.0 python-multipart==0.0.5 -starlette==0.13.6 +starlette==0.12.0 uvicorn==0.11.7 diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 000000000..03a934b56 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.7.7