diff --git a/auto_augmentation/.DS_Store b/auto_augmentation/.DS_Store index 122d7a06c1978c57c195ced3ced40a85ba4129d7..d425cd4dcb0261152a0f748a0c6c05c35c554588 100644 Binary files a/auto_augmentation/.DS_Store and b/auto_augmentation/.DS_Store differ diff --git a/auto_augmentation/__init__.py b/auto_augmentation/__init__.py index 81b6f0c720cdd6715e62cd374e381a30e40ef934..163f63b6b858fbd8600c16d3b57cfb9879bf386b 100644 --- a/auto_augmentation/__init__.py +++ b/auto_augmentation/__init__.py @@ -2,6 +2,8 @@ import os from flask import Flask, render_template, request, flash +from auto_augmentation import home, progress, result, download_file + def create_app(test_config=None): # create and configure the app app = Flask(__name__, instance_relative_config=True) @@ -19,10 +21,10 @@ def create_app(test_config=None): # ensure the instance folder exists os.makedirs(app.instance_path, exist_ok=True) - from auto_augmentation import search_page, search_result, download_file - - app.register_blueprint(search_page.bp) - app.register_blueprint(search_result.bp) + 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/search_page.py b/auto_augmentation/home.py similarity index 100% rename from auto_augmentation/search_page.py rename to auto_augmentation/home.py diff --git a/auto_augmentation/progress.py b/auto_augmentation/progress.py new file mode 100644 index 0000000000000000000000000000000000000000..b95acdc19ded31e44c9a66dc922bc4eade7ecac6 --- /dev/null +++ b/auto_augmentation/progress.py @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..965af5a298f5c22b51b2562a25a25769a0a2d96c --- /dev/null +++ b/auto_augmentation/result.py @@ -0,0 +1,9 @@ +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/search_result.py b/auto_augmentation/search_result.py deleted file mode 100644 index d4e26c92df198d37d988b6fbecb0c0535b84bbd8..0000000000000000000000000000000000000000 --- a/auto_augmentation/search_result.py +++ /dev/null @@ -1,14 +0,0 @@ -from flask import Blueprint, request, render_template, flash, send_file -import subprocess - -bp = Blueprint("search_result", __name__) - -@bp.route("/search_result", methods=["GET", "POST"]) -@bp.route("/choose_type", methods=["GET", "POST"]) -def response(): - query = request.args["search_query"] - if not query: - flash("No query") - print('query', query) - - 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 new file mode 100644 index 0000000000000000000000000000000000000000..cbf9ce2f5606f2ec8e9da4a923b1306d7d64d602 Binary files /dev/null and b/auto_augmentation/static/.DS_Store differ diff --git a/auto_augmentation/static/image/training_plot.png b/auto_augmentation/static/image/training_plot.png new file mode 100644 index 0000000000000000000000000000000000000000..1128a55103c47d7ec36b43bb83a1698ae01c44b3 Binary files /dev/null and b/auto_augmentation/static/image/training_plot.png differ diff --git a/auto_augmentation/templates/home.html b/auto_augmentation/templates/home.html index 981fe46c5d0713afe1827796cad78df11c7a3ceb..a1e7d3d03070c13fc055656ee64443424fb85609 100644 --- a/auto_augmentation/templates/home.html +++ b/auto_augmentation/templates/home.html @@ -1,12 +1,42 @@ {% extends "basic.html" %} {% block title%}Home{% endblock %} {% block body %} -Search some literature: -<form action="/search_result"> - <label for="search_query">Query:</label> - <input type="text" id="search_query" name="search_query"><br> +<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 index 2b9bdc3e708f0f99f5849da4d608c15376584624..ea4c33d713224bd889f147ddcb5f8d2e6fb0b6f7 100644 --- a/auto_augmentation/templates/progress.html +++ b/auto_augmentation/templates/progress.html @@ -1,6 +1,14 @@ {% extends "basic.html" %} -{% block title%}Home{% endblock %} +{% 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 index 79a2729b4ab104d3bb597828bf080abf0deed297..62c8a456352c7f262b78965c4ec7117cf655d487 100644 --- a/auto_augmentation/templates/result.html +++ b/auto_augmentation/templates/result.html @@ -1,31 +1,16 @@ {% extends "basic.html" %} -{% block title %}Response{% endblock %} +{% block title %}Result{% endblock %} {% block body %} -Response to query:<br> -<ul> -{% for result in search_results %} -<li> {{ result }} -{% endfor %} -</ul> <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> + <b>Accuracy before data augmentation is: 64.6%</b><br> + <b>Accuracy after data augmentation is: 79.3%</b> </div> +<div> + <input type="submit" value='Download CNN'> +</div> + {% endblock %}