diff --git a/Procfile b/Procfile deleted file mode 100644 index 9df3bff..0000000 --- a/Procfile +++ /dev/null @@ -1,3 +0,0 @@ -web: gunicorn cat_or_not -heroku ps:scale web=1 -export GOOGLE_APPLICATION_CREDENTIALS="authentication.json" diff --git a/Software-Requirements-Specification.docx b/Software-Requirements-Specification.docx deleted file mode 100644 index 9cb3dda..0000000 Binary files a/Software-Requirements-Specification.docx and /dev/null differ diff --git a/Test Plan(1).pdf b/Test Plan(1).pdf deleted file mode 100644 index 60311e2..0000000 Binary files a/Test Plan(1).pdf and /dev/null differ diff --git a/__pycache__/cat_or_not.cpython-36.pyc b/__pycache__/cat_or_not.cpython-36.pyc deleted file mode 100644 index 63f3e4d..0000000 Binary files a/__pycache__/cat_or_not.cpython-36.pyc and /dev/null differ diff --git a/__pycache__/cat_recognition.cpython-36.pyc b/__pycache__/cat_recognition.cpython-36.pyc deleted file mode 100644 index 5f0382d..0000000 Binary files a/__pycache__/cat_recognition.cpython-36.pyc and /dev/null differ diff --git a/__pycache__/config.cpython-36.pyc b/__pycache__/config.cpython-36.pyc deleted file mode 100644 index 442ed48..0000000 Binary files a/__pycache__/config.cpython-36.pyc and /dev/null differ diff --git a/__pycache__/forms.cpython-36.pyc b/__pycache__/forms.cpython-36.pyc deleted file mode 100644 index 18070b2..0000000 Binary files a/__pycache__/forms.cpython-36.pyc and /dev/null differ diff --git a/__pycache__/hello.cpython-36.pyc b/__pycache__/hello.cpython-36.pyc deleted file mode 100644 index 47f8c9f..0000000 Binary files a/__pycache__/hello.cpython-36.pyc and /dev/null differ diff --git a/app/__init__.py b/app/__init__.py deleted file mode 100644 index f5b34f4..0000000 --- a/app/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from flask import Flask -from config import Config - -app = Flask(__name__) -app.config.from_object(Config) - -from app import routes diff --git a/app/__pycache__/__init__.cpython-36.pyc b/app/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 10c727a..0000000 Binary files a/app/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/app/__pycache__/cat_recognition.cpython-36.pyc b/app/__pycache__/cat_recognition.cpython-36.pyc deleted file mode 100644 index 9289b2a..0000000 Binary files a/app/__pycache__/cat_recognition.cpython-36.pyc and /dev/null differ diff --git a/app/__pycache__/forms.cpython-36.pyc b/app/__pycache__/forms.cpython-36.pyc deleted file mode 100644 index 8e14a92..0000000 Binary files a/app/__pycache__/forms.cpython-36.pyc and /dev/null differ diff --git a/app/__pycache__/picture_downloader.cpython-36.pyc b/app/__pycache__/picture_downloader.cpython-36.pyc deleted file mode 100644 index 1fd1e52..0000000 Binary files a/app/__pycache__/picture_downloader.cpython-36.pyc and /dev/null differ diff --git a/app/__pycache__/routes.cpython-36.pyc b/app/__pycache__/routes.cpython-36.pyc deleted file mode 100644 index 32d5883..0000000 Binary files a/app/__pycache__/routes.cpython-36.pyc and /dev/null differ diff --git a/app/cat_recognition.py b/app/cat_recognition.py deleted file mode 100644 index b65d418..0000000 --- a/app/cat_recognition.py +++ /dev/null @@ -1,20 +0,0 @@ -# Imports the Google Cloud client library -from google.cloud import vision -from google.cloud.vision import types - -def is_cat(content): - labels = fetch_data(content) - if labels[0].description == "cat": - return True - else: - return False - -def fetch_data(content): - # Instantiates a client - client = vision.ImageAnnotatorClient() - # Tell Google Vision that our content is of type Image - image = types.Image(content=content) - # Performs label detection on the image file - response = client.label_detection(image=image) - # Return array of labels - return response.label_annotations diff --git a/app/forms.py b/app/forms.py deleted file mode 100644 index ab65d4c..0000000 --- a/app/forms.py +++ /dev/null @@ -1,7 +0,0 @@ -from flask_wtf import FlaskForm -from wtforms import StringField, PasswordField, BooleanField, SubmitField -from wtforms.validators import DataRequired - -class UploadForm(FlaskForm): - url = StringField('Link', validators=[DataRequired()]) - submit = SubmitField('Cat or not?') diff --git a/app/picture_downloader.py b/app/picture_downloader.py deleted file mode 100644 index 3304f35..0000000 --- a/app/picture_downloader.py +++ /dev/null @@ -1,10 +0,0 @@ -import requests - -def get_image_from_url(url): - f = open('pic.jpg','wb') - f.write(requests.get(url).content) - f.close() - f = open('pic.jpg','rb') - file = f.read() - f.close() - return file diff --git a/app/routes.py b/app/routes.py deleted file mode 100644 index feedcbd..0000000 --- a/app/routes.py +++ /dev/null @@ -1,18 +0,0 @@ -from flask import Flask -from flask import render_template -from app.forms import UploadForm -from app import app -from app import cat_recognition as cat -from app import picture_downloader as downloader - -@app.route('/', methods=['GET', 'POST']) -def index(): - form = UploadForm() - if form.validate_on_submit(): - content = downloader.get_image_from_url(form.url.data) - if cat.is_cat(content): - return "Cat!" - else: - return "Not!" - - return render_template('index.html', form=form) diff --git a/app/templates/base.html b/app/templates/base.html deleted file mode 100644 index 519c49c..0000000 --- a/app/templates/base.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - {% if title %} - {{ title }} | Cat or Not - {% else %} - Cat or Not - {% endif %} - - - - {% with messages = get_flashed_messages() %} - {% if messages %} - - {% endif %} - {% endwith %} - {% block content %}{% endblock %} - - diff --git a/app/templates/index.html b/app/templates/index.html deleted file mode 100644 index 18c65da..0000000 --- a/app/templates/index.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -

Check if the picture is cat or not!

-
- {{ form.hidden_tag() }} -

- {{ form.url.label }}
- {{ form.url }} -

-

{{ form.submit() }}

-
-{% endblock %} diff --git a/authentication.json b/authentication.json deleted file mode 100644 index c2beba1..0000000 --- a/authentication.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "quiet-odyssey-225116", - "private_key_id": "f2553a958e511debcf46d10957e3c7fbdb906aa1", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDfmChqO8VSfmEi\nSNeGhgq3jCe5iCk67yoaatQ9kYd10pmVST6OjJ3nmxd1iYAAYCB59wV4V19C67oj\n5x0bxhhKITilS94bNhZJFB4FjwMIGrDXe9SGcZwSwrB+ggFhvZGNQjYWDe7rrJ/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CVuyrekl+OAg96q/uTHiBqKSmbTMK7O59tQKBgCMD\n3f7eKySTrGbbmTBQOKBgP4fAJcnUfNCf09hMrq+Pz7AlTeoEGcNCHo4MiyH8P/pb\nOJsu/c58L8EidIaABowZBF2jvt10/qKnBmhg9jrbdylmXV2AaCsHeLLxcT9BUgM1\nYmI0Rvod2jqGfgUIHK+nRt3DhCR3kIG2kj5yvIXDAoGAVNd8sw08+U4JMg0TPK71\nhWNeXyNc9aLpehqdIVQPs6KdhlVcoFHKLCDASzMUxNtU27b3Nqgh5dBS4YbNKXoa\n5UZUvxa2Khw1/rT9wTcaIap0kfh1SOZseSfpNUy5mrSKnnVkIn1NKmI0a+mN0gcT\nD706pAo2V7oFEQFocuua1yY=\n-----END PRIVATE KEY-----\n", - "client_email": "c00lerxo@quiet-odyssey-225116.iam.gserviceaccount.com", - "client_id": "106421721962581253770", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/c00lerxo%40quiet-odyssey-225116.iam.gserviceaccount.com" -} diff --git a/cat_or_not.py b/cat_or_not.py deleted file mode 100644 index e13c02e..0000000 --- a/cat_or_not.py +++ /dev/null @@ -1 +0,0 @@ -from app import app as application diff --git a/config.py b/config.py deleted file mode 100644 index 5bf854f..0000000 --- a/config.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -class Config(object): - SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' diff --git a/pic.jpg b/pic.jpg deleted file mode 100644 index 773ae83..0000000 Binary files a/pic.jpg and /dev/null differ diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c6c1951..0000000 --- a/requirements.txt +++ /dev/null @@ -1,26 +0,0 @@ -cachetools==3.0.0 -certifi==2018.11.29 -chardet==3.0.4 -Click==7.0 -Flask==1.0.2 -Flask-WTF==0.14.2 -google-api-core==1.6.0 -google-auth==1.6.1 -google-cloud-vision==0.35.1 -googleapis-common-protos==1.5.5 -grpcio==1.17.0 -gunicorn==19.9.0 -idna==2.8 -itsdangerous==1.1.0 -Jinja2==2.10 -MarkupSafe==1.1.0 -protobuf==3.6.1 -pyasn1==0.4.4 -pyasn1-modules==0.2.2 -pytz==2018.7 -requests==2.21.0 -rsa==4.0 -six==1.12.0 -urllib3==1.24.1 -Werkzeug==0.14.1 -WTForms==2.2.1