diff --git a/.flaskenv b/.flaskenv deleted file mode 100644 index adfe7a48941f238a842cacea32c5d17cf4d9c60e..0000000000000000000000000000000000000000 --- a/.flaskenv +++ /dev/null @@ -1 +0,0 @@ -FLASK_APP=auto_augmentation \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index b125750ccc15f94f11db68afd39ebf0c9d898803..0000000000000000000000000000000000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,25 +0,0 @@ -build-job: - stage: build - script: - - echo "Hello, I'm Building" - - pip install pytest - - pip install flask - - pip install pandoc # for pdf making - - pip install weasyprint # for pdf making - -test-job: - stage: test - script: - - echo "Now I'm Testing!" - - python3 -m tests.test_query_processor - -deploy-job: - stage: deploy - script: - - echo "Now I'm Deploying to VM!" - - python3 -m venv venv - - . venv/bin/activate - - pip install -r requirements.txt - - flask run & - - echo "Now I'm Deploying to Heroku!" - - dpl --provider=heroku --app=metarl --api-key=5ccc3ae7-725e-4f9f-b441-0c9a28ebdc1b diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3ee025e601252084a1b6fcad8a6f72b1030a4d2a..0000000000000000000000000000000000000000 --- a/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM python:3 - -RUN pip3 install virtualenv - -RUN python3 -m venv venvs - -COPY requirements.txt requirements.txt - -RUN pip3 install -r requirements.txt - -COPY . . - -CMD ["flask", "run"] \ No newline at end of file diff --git a/Procfile b/Procfile deleted file mode 100644 index 05b126a4f3af13308397226e5c9cd881e2913083..0000000000000000000000000000000000000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: flask run --host=0.0.0.0 --port=$PORT diff --git a/auto_augmentation/.DS_Store b/auto_augmentation/.DS_Store deleted file mode 100644 index d425cd4dcb0261152a0f748a0c6c05c35c554588..0000000000000000000000000000000000000000 Binary files a/auto_augmentation/.DS_Store and /dev/null differ diff --git a/auto_augmentation/__init__.py b/auto_augmentation/__init__.py deleted file mode 100644 index da6ac6a46769c882614ff0940d1535877c4728d7..0000000000000000000000000000000000000000 --- a/auto_augmentation/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -import os - -from flask import Flask, render_template, request, flash - -from auto_augmentation import home, progress,result - -def create_app(test_config=None): - # create and configure the app - app = Flask(__name__, instance_relative_config=True) - app.config.from_mapping( - SECRET_KEY='dev', - ) - - if test_config is None: - # load the instance config, if it exists, when not testing - app.config.from_pyfile('config.py', silent=True) - else: - # load the test config if passed in - app.config.from_mapping(test_config) - - # ensure the instance folder exists - os.makedirs(app.instance_path, exist_ok=True) - - from auto_augmentation import download_file - - app.register_blueprint(home.bp) - app.register_blueprint(progress.bp) - app.register_blueprint(result.bp) - app.register_blueprint(download_file.bp) - - - return app diff --git a/auto_augmentation/download_file.py b/auto_augmentation/download_file.py deleted file mode 100644 index 35b9f5a9fdb8b37351cffdc8ccf8d7f51cb131ba..0000000000000000000000000000000000000000 --- a/auto_augmentation/download_file.py +++ /dev/null @@ -1,12 +0,0 @@ -from flask import Blueprint, request, render_template, flash, send_file - -bp = Blueprint("download_file", __name__) - -@bp.route("/download_file", methods=["GET"]) -@bp.route("/download", methods=["GET", "POST"]) -def download(): - # Setup for the 'return send_file()' function call at the end of this function - path = 'templates/CNN.zip' # e.g. 'templates/download.markdown' - - return send_file(path, - as_attachment=True) diff --git a/auto_augmentation/home.py b/auto_augmentation/home.py deleted file mode 100644 index 7b14acb5ecee2aea47d184117701959714d10894..0000000000000000000000000000000000000000 --- a/auto_augmentation/home.py +++ /dev/null @@ -1,7 +0,0 @@ -from flask import Blueprint, render_template - -bp = Blueprint("home", __name__) - -@bp.route("/") -def index(): - return render_template("home.html") diff --git a/auto_augmentation/progress.py b/auto_augmentation/progress.py deleted file mode 100644 index b95acdc19ded31e44c9a66dc922bc4eade7ecac6..0000000000000000000000000000000000000000 --- a/auto_augmentation/progress.py +++ /dev/null @@ -1,9 +0,0 @@ -from flask import Blueprint, request, render_template, flash, send_file -import subprocess - -bp = Blueprint("progress", __name__) - -@bp.route("/user_input", methods=["GET", "POST"]) -def response(): - - return render_template("progress.html") \ No newline at end of file diff --git a/auto_augmentation/result.py b/auto_augmentation/result.py deleted file mode 100644 index 965af5a298f5c22b51b2562a25a25769a0a2d96c..0000000000000000000000000000000000000000 --- a/auto_augmentation/result.py +++ /dev/null @@ -1,9 +0,0 @@ -from flask import Blueprint, request, render_template, flash, send_file -import subprocess - -bp = Blueprint("result", __name__) - -@bp.route("/show_result", methods=["GET", "POST"]) -def response(): - - return render_template("result.html") \ No newline at end of file diff --git a/auto_augmentation/static/.DS_Store b/auto_augmentation/static/.DS_Store deleted file mode 100644 index cbf9ce2f5606f2ec8e9da4a923b1306d7d64d602..0000000000000000000000000000000000000000 Binary files a/auto_augmentation/static/.DS_Store and /dev/null differ diff --git a/auto_augmentation/static/image/data_augment_cat.jpeg b/auto_augmentation/static/image/data_augment_cat.jpeg deleted file mode 100644 index 900b738c8375325e26d21c43eb3a5ccf3b3c2827..0000000000000000000000000000000000000000 Binary files a/auto_augmentation/static/image/data_augment_cat.jpeg and /dev/null differ diff --git a/auto_augmentation/static/image/training_plot.png b/auto_augmentation/static/image/training_plot.png deleted file mode 100644 index 1128a55103c47d7ec36b43bb83a1698ae01c44b3..0000000000000000000000000000000000000000 Binary files a/auto_augmentation/static/image/training_plot.png and /dev/null differ diff --git a/auto_augmentation/templates/basic.html b/auto_augmentation/templates/basic.html deleted file mode 100644 index db609ea5f49ca101d3394b2e1219c1488160908b..0000000000000000000000000000000000000000 --- a/auto_augmentation/templates/basic.html +++ /dev/null @@ -1,12 +0,0 @@ -<!doctype html> -<html> - <head> - {% block head %} - <title>{% block title %}{% endblock %} - Meta Reinforcement Learning for Data Augmentation</title> - {% endblock %} - </head> - <body> - {% block body %}{% endblock %} - </body> -</html> - diff --git a/auto_augmentation/templates/home.html b/auto_augmentation/templates/home.html deleted file mode 100644 index a1e7d3d03070c13fc055656ee64443424fb85609..0000000000000000000000000000000000000000 --- a/auto_augmentation/templates/home.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "basic.html" %} -{% block title%}Home{% endblock %} -{% block body %} -<h1>Meta Reinforcement Learning for Data Augmentation</h1> - - -<form action="/user_input"> - <!-- upload dataset --> - <label for="dataset">Please upload your dataset here:</label> - <input type="file" name="dataset" class="upload"><br><br> - - <!-- radio button --> - What task is your dataset used for?<br> - <input type="radio" id="outputtype1" - name="output" value="binary_cls"> - <label for="outputtype1">Binary Classification</label><br> - - <input type="radio" id="outputtype2" - name="output" value="multi_cls"> - <label for="outputtype2">Multi-classification</label><br> - - <input type="radio" id="outputtype3" - name="output" value="regression"> - <label for="outputtype3">Linear Regression</label><br><br> - - <label for="data_aug_method">Which data augmentation method you would like exclude?</label> - <select id="data_aug_method" name="data_aug_method"> - <option value="Translate">Translate</option> - <option value="Rotate">Rotate</option> - <option value="AutoContrast">AutoContrast</option> - <option value="Equalize">Equalize</option> - <option value="Solarize">Solarize</option> - <option value="Posterize">Posterize</option> - <option value="Contrast">Contrast</option> - <option value="Brightness">Brightness</option> - - </select><br><br> - - <input type="submit"> -</form> - -{% endblock %} diff --git a/auto_augmentation/templates/progress.html b/auto_augmentation/templates/progress.html deleted file mode 100644 index ea4c33d713224bd889f147ddcb5f8d2e6fb0b6f7..0000000000000000000000000000000000000000 --- a/auto_augmentation/templates/progress.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "basic.html" %} -{% block title%}Progress{% endblock %} -{% block body %} -Training the model... - -<div> - <img src="{{url_for('static', filename='image/training_plot.png')}}" class="img-thumbnail" /> - <form action="/show_result"> - <input type="submit" value='Show Result'> - </form> - -</div> - -{% endblock %} \ No newline at end of file diff --git a/auto_augmentation/templates/result.html b/auto_augmentation/templates/result.html deleted file mode 100644 index 6e127fdb1ed52f2abefc166f23dc7b8d25062f48..0000000000000000000000000000000000000000 --- a/auto_augmentation/templates/result.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "basic.html" %} -{% block title %}Result{% endblock %} -{% block body %} - -<div> - <b>Accuracy before data augmentation is: 64.6%</b><br> - <b>Accuracy after data augmentation is: 79.3%</b> - -</div> - -<div> - <form action="/download"> - <input type="submit" value='Download CNN'> - </form> -</div> - -{% endblock %} - diff --git a/conftest.py b/conftest.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/heroku.yml b/heroku.yml deleted file mode 100644 index 8a254e2e411577dcc5abec859535d28502c75e38..0000000000000000000000000000000000000000 --- a/heroku.yml +++ /dev/null @@ -1,3 +0,0 @@ -build: - docker: - web: Dockerfile # path to your Dockerfile diff --git a/old_templates/home.html b/old_templates/home.html deleted file mode 100644 index 25108159cdf9dc16ccaa77ade8fcb76e3dddf73c..0000000000000000000000000000000000000000 --- a/old_templates/home.html +++ /dev/null @@ -1,62 +0,0 @@ -{% extends "layout.html" %} - -{% block content %} - - <!-- Starts image section --> - <div class="row justify-content-md-center mb-4"> - <h2 class='text-primary'>Data Augmentation with Meta Reinforcement Learning</h2> - </div> - - <div> - <img src="{{url_for('autoaugmentation/static', filename='images/data augment cat.jpeg')}}" class="img-thumbnail" /> - <div class="caption"> - <p><strong>Data Augmentation</strong></p> - </div> - </div> - <!-- Ends image section --> - - <!-- Starts upload section --> - - <section> - - <div class="container-fluid details"> - <form action="/predict" method="post" enctype="multipart/form-data" onsubmit="showloading()"> - - <input type="file" name="image" class="upload"><br><br> - - <label for="user_classify">Which classfiication can best describe the uploading picutre:</label> - <select id="user_classify" name="user_classify"> - <option value="Not sure">Not sure</option> - <option value="Diseased Leaf">Diseased Leaf</option> - <option value="Diseased Plant">Diseased Plant</option> - <option value="Healthy Leaf">Healthy Leaf</option> - <option value="Healthy Plant">Healthy Plant</option> - </select><br><br> - - <label class="camera distance" for="Myheight"> Input yout height(m):</label> - <input type="text" id="Myheight" name="Myheight"><br> - - <label class="camera distance" for="camera_dist_left"> Camera predicted distance from the left pillar(m):</label> - <input type="text" id="camera_dist_left" name="camera_dist_left"><br> - - <label class="camera distance" for="camera_dist_right"> Camera predicted distance from the right pillar(m):</label> - <input type="text" id="camera_dist_right" name="camera_dist_right"><br><br> - - <h5>More information about this cotton plant (optional)</h5> - <label class='measurements' for='height'>Cotton plant height: </label> - <input type='text' id='height' name = 'height'><br> - <label class='measurements' for='width'>Cotton plant width:</label> - <input type='text' id='width' name = 'width'><br> - <label class='notes' for='added_notes'>Additional notes: </label> - <input type='text' id='added_notes' name = 'added_notes'><br><br> - - <input type="submit" value="Submit and Predict!"> <br><br><br> - </form> - </div> - </section> - - <!-- Ends upload section --> - - - -{% endblock %} \ No newline at end of file diff --git a/old_templates/layout.html b/old_templates/layout.html deleted file mode 100644 index 501b9e0767a95365af0317748cff5cad6e094b94..0000000000000000000000000000000000000000 --- a/old_templates/layout.html +++ /dev/null @@ -1,33 +0,0 @@ -<!doctype html> -<html> - - <head> - - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> - - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> - - - <title> Cotton Leaf Disease Detection </title> - - </head> - - <body> - <div class="container pt-3"> - - <div id="content">{% block content %}{% endblock %}</div> - - <div id="footer"> - {% block footer %} - <div class="row"> - - </div> - {% endblock %} - </div> - </div> - - </body> -</html> \ No newline at end of file diff --git a/old_templates/result.html b/old_templates/result.html deleted file mode 100644 index 4eca0b216866b09a2b48b0a1a69ee675874040e7..0000000000000000000000000000000000000000 --- a/old_templates/result.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "basic.html" %} -{% block title %}Result{% endblock %} -{% block body %} -Response to query:<br> - -<div> - <form action="/choose_file"> - <input type="radio" id="downloadTypeChoice1" - name="Filetype" value="html"> - <label for="downloadChoice1">HTML</label><br> - - <input type="radio" id="downloadTypeChoice2" - name="Filetype" value="markdown"> - <label for="downloadTypeChoice2">Markdown</label><br> - - <input type="radio" id="downloadTypeChoice3" - name="Filetype" value="pdf"> - <label for="downloadTypeChoice3">PDF</label><br> - - <input type="submit"> - </form> -</div> - -{% endblock %} diff --git a/progress.html b/progress.html deleted file mode 100644 index 9bad71aadb77c26e3887dfddaa00e38e25d0336a..0000000000000000000000000000000000000000 --- a/progress.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "structure.html" %} -{% block title%}Home{% endblock %} -{% block body %} -<h1>Loading</h1> - <progress value = "65" max = "100"/> - -{% endblock %} - diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 76b3ed54867825d4aadb3d219c376ee10576d1f3..0000000000000000000000000000000000000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -attrs -click==8.0.3 -Flask==2.0.2 -iniconfig==1.1.1 -itsdangerous==2.0.1 -Jinja2==3.0.3 -MarkupSafe==2.0.1 -packaging==21.3 -pandoc==2.0.1 -pdflatex -pluggy==1.0.0 -py==1.11.0 -pyparsing==3.0.6 -pytest -python-dotenv==0.19.2 -toml==0.10.2 -Werkzeug==2.0.2 -weasyprint==51 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 606849326a4002007fd42060b51e69a19c18675c..0000000000000000000000000000000000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/stdout.txt b/stdout.txt deleted file mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000