Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
Title: Neural style transfer | |
Author: [fchollet](https://twitter.com/fchollet) | |
Date created: 2016/01/11 | |
Last modified: 2020/05/02 | |
Description: Transfering the style of a reference image to target image using gradient descent. | |
""" | |
# https://github.com/keras-team/keras-io/blob/master/examples/generative/neural_style_transfer.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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:AttachRolePolicy", | |
"iam:GetRole", | |
"iam:CreateRole", | |
"iam:PassRole", |
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
FROM python:3.7 | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
ENV PYTHONUNBUFFERED=1 | |
ENV FLASK_APP=app.py | |
ENV FLASK_ENV=development | |
# install system dependencies | |
RUN apt-get update \ | |
&& apt-get -y install gcc make \ | |
&& rm -rf /var/lib/apt/lists/*s | |
RUN python3 --version |
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
def pre_process(df): | |
cols_too_many_missing = ['new_tests', | |
'new_tests_per_thousand', | |
'total_tests_per_thousand', | |
'total_tests', | |
'tests_per_case', | |
'positive_rate', | |
'new_tests_smoothed', | |
'new_tests_smoothed_per_thousand', | |
'tests_units', |
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
@app.route('/predict',methods=['POST']) | |
def predict(): | |
input_val = [x for x in request.form.values()][0] | |
rf = load_model(BUCKET_NAME, MODEL_FILE_NAME, MODEL_LOCAL_PATH) | |
if input_val not in available_countries: | |
return f'Country {input_val} is not in available list. Try one from the list! Go back in your browser', 400 | |
to_pred = get_prediction_params(input_val, url_to_covid) | |
prediction = rf.predict(to_pred)[0] | |
return render_template('home.html',pred=f'New cases will be {prediction}') |
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
import os | |
import glob | |
import shutil | |
import typing | |
import numpy as np | |
from PIL import Image, ImageStat, ImageChops | |
from pathlib import Path | |
def pre_processsing(input_dir: str, output_dir: str, logfile: str) -> int: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import numpy as np | |
one_dim = np.ones(shape=(5), dtype=np.int) | |
# print(one_dim) | |
# [1 1 1 1 1] | |
two_dim = np.ones(shape=(5, 2), dtype=np.int) | |
# print(two_dim) |
NewerOlder