Skip to content
Snippets Groups Projects
Commit 70d8d4de authored by Sun Jin Kim's avatar Sun Jin Kim
Browse files

delete flask app stuff from repo. I forked them all to another repo

parent 51613552
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 260 deletions
FLASK_APP=auto_augmentation
\ No newline at end of file
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
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
web: flask run --host=0.0.0.0 --port=$PORT
File deleted
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
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)
from flask import Blueprint, render_template
bp = Blueprint("home", __name__)
@bp.route("/")
def index():
return render_template("home.html")
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
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
File deleted
auto_augmentation/static/image/data_augment_cat.jpeg

105 KiB

auto_augmentation/static/image/training_plot.png

26.5 KiB

<!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>
{% 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 %}
{% 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
{% 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 %}
build:
docker:
web: Dockerfile # path to your Dockerfile
{% 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
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