Skip to content
Snippets Groups Projects
Commit 66d7d957 authored by dw927's avatar dw927
Browse files

Merge branch 'dwelsh' into 'main'

Staging for Q2 Work

See merge request !1
parents 468d79f7 1c1fdd5f
No related branches found
No related tags found
1 merge request!1Staging for Q2 Work
venv/
__pycache__
\ No newline at end of file
from flask import Flask, render_template, url_for, flash, redirect
from flask import jsonify
from flask import request
import test_data_provider as provider
import requests
import urllib.request
import os
......@@ -48,9 +47,3 @@ def upload_image():
def display_image(filename):
#print('display_image filename: ' + filename)
return redirect(url_for('static', filename='uploads/' + filename), code=301)
\ No newline at end of file
@app.route("/report/<int:report_id>")
def get_report(report_id) :
return jsonify(provider.get_report(report_id))
front_end/static/uploads/c1471950-71a5-11ed-9ddb-1267f16e00ed.png

94.5 KiB

<div class="progress w-50">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-label="Animated striped example" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
</div>
{% if filename %}
<div>
<img src="{{ url_for('display_image', filename=filename) }}">
</div>
{% endif %}
<h2>
Sample id: c1471950-71a5-11ed-9ddb-1267f16e00ed
</h2>
<h2>
Time of completion: 01/12/2022 18:27:04
</h2>
<h2>
Diagnosis: Severe
</h2>
<h2>
Chip Predictions:
Mild: 806
Severe: 846
</h2>
\ No newline at end of file
<!doctype html>
<html lang="en">
<center>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Slide Analyzer</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body>
<h1>Welcome to the Digital Pathology Slide Analyzer.</h1>
<br>
<h2>Please select a file to upload.</h2>
<br>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<form method="post" action="/" enctype="multipart/form-data">
<div class="input-group w-25">
<input type="file" class="form-control" id="file" name="file" aria-describedby="inputGroupFileAddon04" aria-label="Upload">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
<br>
<h2>
Sample id: c1471950-71a5-11ed-9ddb-1267f16e00ed
</h2>
<h2>
Time of completion: 01/12/2022 18:27:04
</h2>
<h2>
Diagnosis: Severe
</h2>
<h2>
Chip Predictions:
Mild: 806
Severe: 846
</h2>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
</body>
</center>
</html>
\ No newline at end of file
......@@ -2,7 +2,7 @@ from flask import Flask
from flask import jsonify
from flask import request
from flask import render_template
from s3provider import Provider
from s3_provider import Provider as provider
from fake_model import LearningModel as Model
import uuid
......@@ -18,10 +18,6 @@ VALID_EXTENSIONS = [
PREFIX = 'dpath'
@app.route(f'/{PREFIX}/ping', methods=['GET'])
def ping() :
return 'pong'
@app.route(f'/{PREFIX}/')
def home():
return render_template('home.html')
......@@ -36,7 +32,7 @@ def upload_image():
if response.status_code == 400:
return response
provider = Provider()
provider = provider()
id = uuid.uuid1()
provider.save_binary(request.files['file'], id)
response = jsonify(Model(id).start())
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment