This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b61568a
commit 98f4023
Showing
23 changed files
with
194 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.env | ||
.venv | ||
dist | ||
.eggs | ||
*.egg-info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM nvidia/cuda:11.0-base | ||
RUN apt-get update && apt-get install -y python3-pip wget | ||
WORKDIR / | ||
COPY . / | ||
RUN python3 -m pip install -U pip && python3 -m pip install -r requirements.txt | ||
EXPOSE 5000 | ||
CMD ["python3","app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import os | ||
import pandas as pd | ||
import pickle | ||
import flask | ||
from flask import Flask, request, jsonify, make_response | ||
from boken.ensemble import Ensemble as boken_Ensemble | ||
from eighteen.ensemble import Ensemble as eighteen_Ensemble | ||
from medics.ensemble import Ensemble as medics_Ensemble | ||
from ntech.ensemble import Ensemble as ntech_Ensemble | ||
from selimsef.ensemble import Ensemble as selimsef_Ensemble | ||
from wm.ensemble import Ensemble as wm_Ensemble | ||
import boto3 | ||
|
||
app = Flask(__name__) | ||
|
||
models = { | ||
"boken": boken_Ensemble, | ||
"eighteen": eighteen_Ensemble, | ||
"medics": medics_Ensemble, | ||
"ntech": ntech_Ensemble, | ||
"selimsef": selimsef_Ensemble, | ||
"wm": wm_Ensemble, | ||
} | ||
|
||
|
||
@app.route('/healthcheck') | ||
def starting_url(): | ||
status_code = flask.Response(status=201) | ||
return status_code | ||
|
||
@app.route('/predict', methods=['POST']) | ||
def predict(): | ||
model_names = request.get_json(force=True)['model_names'] | ||
video_list = request.get_json(force=True)['video_list'] | ||
predictions = [] | ||
for filename in video_list: | ||
for modelname in model_names: | ||
score = 0.5 | ||
video = '' | ||
model = models[modelname]() | ||
try: | ||
validate_filename(filename) | ||
video = sanitize_filename(filename, platform="auto") | ||
video_path = os.path.join('/uploads/', video) | ||
if os.path.exists(video_path): | ||
score = model.inference(video_path) | ||
pred={'filename': video} | ||
pred[modelname]=score | ||
else: | ||
return make_response(f"File {video} not found.", 400) | ||
except ValidationError as e: | ||
print(f'{e}') | ||
return make_response(f"{e}", 400) | ||
except Exception as err: | ||
print(f'{err}') | ||
return make_response(f"{err}", 500) | ||
|
||
result = pd.DataFrame(predictions) | ||
return result.to_json() | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0') |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
pathvalidate==2.5.0 | ||
numpy==1.18.1 | ||
opencv_python==4.2.0.34 | ||
torch==1.4.0 | ||
torchvision==0.5.0 | ||
albumentations==0.5.2 | ||
efficientnet_pytorch==0.7.0 | ||
facenet_pytorch==2.5.1 | ||
Pillow==8.1.1 | ||
pretrainedmodels==0.7.4 | ||
Flask==1.1.2 | ||
easydict==1.8 | ||
PyYAML==5.3.1 | ||
tensorboardX==2.0 | ||
pandas==1.0.4 | ||
pydocs==0.2 | ||
boto3==1.17.5 | ||
scipy==1.4.1 | ||
scikit_image==0.18.1 | ||
Cython==0.29.21 | ||
decord==0.4.2 | ||
einops==0.3.0 | ||
lmdb==1.0.0 | ||
scikit_learn==0.24.1 | ||
timm==0.3.4 | ||
appdirs==1.4.3 | ||
attrs==19.3.0 | ||
autopep8==1.5.2 | ||
backcall==0.1.0 | ||
bleach==3.1.4 | ||
certifi==2020.4.5.1 | ||
chardet==3.0.4 | ||
cycler==0.10.0 | ||
decorator==4.4.2 | ||
defusedxml==0.6.0 | ||
distlib==0.3.0 | ||
docopt==0.6.2 | ||
entrypoints==0.3 | ||
filelock==3.0.12 | ||
flake8==3.7.9 | ||
idna==2.9 | ||
imageio==2.9.0 | ||
importlib-metadata==1.5.0 | ||
jedi==0.16.0 | ||
Jinja2==2.11.1 | ||
jsonschema==3.2.0 | ||
mccabe==0.6.1 | ||
mistune==0.8.4 | ||
nbconvert==5.6.1 | ||
nbformat==5.0.4 | ||
networkx==2.5 | ||
notebook==6.0.3 | ||
olefile==0.46 | ||
pandocfilters==1.4.2 | ||
parso==0.6.2 | ||
pexpect==4.8.0 | ||
pickleshare==0.7.5 | ||
pipreqs==0.4.10 | ||
prometheus-client==0.7.1 | ||
prompt-toolkit==3.0.4 | ||
ptyprocess==0.6.0 | ||
pycodestyle==2.5.0 | ||
pyflakes==2.1.1 | ||
Pygments==2.6.1 | ||
pyparsing==2.4.6 | ||
pyrsistent==0.16.0 | ||
python-dateutil==2.8.1 | ||
pytz==2019.3 | ||
PyWavelets==1.1.1 | ||
pyzmq==18.1.1 | ||
requests==2.23.0 | ||
scikit-image==0.18.1 | ||
Send2Trash==1.5.0 | ||
sip | ||
six==1.14.0 | ||
terminado==0.8.3 | ||
testpath==0.4.4 | ||
tifffile==2021.1.14 | ||
|
||
tornado==6.0.4 | ||
tqdm==4.44.1 | ||
traitlets==4.3.3 | ||
urllib3==1.25.9 | ||
virtualenv==20.0.18 | ||
wcwidth==0.1.9 | ||
webencodings==0.5.1 | ||
widgetsnbextension==3.5.1 | ||
yarg==0.1.9 | ||
zipp==2.2.0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule EfficientNet-PyTorch
deleted from
7e8b0d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters