Skip to content
Snippets Groups Projects
Commit 5e85b4f2 authored by Mia Wang's avatar Mia Wang
Browse files

demo finished

parent 6ea8858e
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -2,6 +2,8 @@ import os ...@@ -2,6 +2,8 @@ import os
from flask import Flask, render_template, request, flash from flask import Flask, render_template, request, flash
from auto_augmentation import home, progress, result, download_file
def create_app(test_config=None): def create_app(test_config=None):
# create and configure the app # create and configure the app
app = Flask(__name__, instance_relative_config=True) app = Flask(__name__, instance_relative_config=True)
...@@ -19,10 +21,10 @@ def create_app(test_config=None): ...@@ -19,10 +21,10 @@ def create_app(test_config=None):
# ensure the instance folder exists # ensure the instance folder exists
os.makedirs(app.instance_path, exist_ok=True) os.makedirs(app.instance_path, exist_ok=True)
from auto_augmentation import search_page, search_result, download_file app.register_blueprint(home.bp)
app.register_blueprint(progress.bp)
app.register_blueprint(search_page.bp) app.register_blueprint(result.bp)
app.register_blueprint(search_result.bp)
app.register_blueprint(download_file.bp) app.register_blueprint(download_file.bp)
return app return app
File moved
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
from flask import Blueprint, request, render_template, flash, send_file from flask import Blueprint, request, render_template, flash, send_file
import subprocess import subprocess
bp = Blueprint("search_result", __name__) bp = Blueprint("result", __name__)
@bp.route("/search_result", methods=["GET", "POST"]) @bp.route("/show_result", methods=["GET", "POST"])
@bp.route("/choose_type", methods=["GET", "POST"])
def response(): def response():
query = request.args["search_query"]
if not query:
flash("No query")
print('query', query)
return render_template("result.html") return render_template("result.html")
\ No newline at end of file
File added
auto_augmentation/static/image/training_plot.png

26.5 KiB

{% extends "basic.html" %} {% extends "basic.html" %}
{% block title%}Home{% endblock %} {% block title%}Home{% endblock %}
{% block body %} {% block body %}
Search some literature: <h1>Meta Reinforcement Learning for Data Augmentation</h1>
<form action="/search_result">
<label for="search_query">Query:</label>
<input type="text" id="search_query" name="search_query"><br> <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"> <input type="submit">
</form> </form>
{% endblock %} {% endblock %}
{% extends "basic.html" %} {% extends "basic.html" %}
{% block title%}Home{% endblock %} {% block title%}Progress{% endblock %}
{% block body %} {% block body %}
Training the model... 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 %} {% endblock %}
\ No newline at end of file
{% extends "basic.html" %} {% extends "basic.html" %}
{% block title %}Response{% endblock %} {% block title %}Result{% endblock %}
{% block body %} {% block body %}
Response to query:<br>
<ul>
{% for result in search_results %}
<li> {{ result }}
{% endfor %}
</ul>
<div> <div>
<form action="/choose_file"> <b>Accuracy before data augmentation is: 64.6%</b><br>
<input type="radio" id="downloadTypeChoice1" <b>Accuracy after data augmentation is: 79.3%</b>
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> </div>
<div>
<input type="submit" value='Download CNN'>
</div>
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment