Skip to content

Commit f47f414

Browse files
fixed images
1 parent 345199b commit f47f414

File tree

3 files changed

+63
-55
lines changed

3 files changed

+63
-55
lines changed

app.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import flask
2-
from flask import request
2+
from flask import request, redirect
33
from flask_cors import CORS
44
import draw_inference
55

@@ -12,6 +12,11 @@ def homepage():
1212
with open('index.html') as f:
1313
return f.read()
1414

15+
@app.route('/result/ios.png', methods=['GET'])
16+
def icon():
17+
with open('result/ios.png', 'rb') as f:
18+
return f.read()
19+
1520
@app.route('/', methods=['POST'])
1621
def upload_img():
1722
print(request.files)
@@ -21,4 +26,4 @@ def upload_img():
2126

2227
new_path = draw_inference.infrence('./uploaded_img.dng', 'ios')
2328
print(new_path)
24-
return "ok"
29+
return redirect('/')

index.html

+56-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,59 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<link rel="stylesheet" href="style.css">
6+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
7+
<style>
8+
body {
9+
margin: 0;
10+
}
11+
.Header {
12+
text-align: center;
13+
background: #2c2b2b;
14+
color: #fff;
15+
font-weight: bolder;
16+
font-size: 26px;
17+
padding: 10px 0;
18+
width: 100%;
19+
margin: 0;
20+
}
21+
22+
.fileuploader {
23+
width: 70px;
24+
height: 70px;
25+
padding: 32px 0 5px 0;
26+
display: flex;
27+
margin: 5px auto 0px auto;
28+
}
29+
input[type="file"] {
30+
display: none;
31+
}
32+
.icon {
33+
width: 100%;
34+
height: auto;
35+
}
36+
.upload_tag_line {
37+
text-align: center;
38+
margin: 0;
39+
font-size: 25px;
40+
}
41+
.submitbtn {
42+
background: black;
43+
color: white;
44+
padding: 10px;
45+
font-weight: 600;
46+
font-size: 15px;
47+
border-radius: 5px;
48+
width: 100%;
49+
position: absolute;
50+
bottom: 3px;
51+
}
52+
53+
#uploaded_img {
54+
width: 80%;
55+
display: flex;
56+
margin: auto;
57+
}
58+
</style>
759
<script>
860
let dataURL
961

@@ -57,14 +109,15 @@
57109
<h2 class="Header"> Nacto Vision </h2>
58110
<form method="POST" enctype=multipart/form-data>
59111
<label for="upload_img" class="fileuploader">
60-
<img src="./icons/upload-solid.svg" alt="" class="icon">
112+
<!-- <img src="./icons/upload-solid.svg" alt="" class="icon"> -->
113+
<i class="fas fa-upload icon"></i>
61114
<input type="file" name="upload_img" id="upload_img" onchange="read_file(event)">
62115
</label>
63116
<p class="upload_tag_line">Upload Your Files</p>
64117
<div>
65118
<input type="submit" class="submitbtn" value="Submit">
66119
</div>
67120
</form>
68-
<img src="" alt="" id="uploaded_img">
121+
<img src="result/ios.png" alt="" id="uploaded_img">
69122
</body>
70123
</html>

style.css

-50
Original file line numberDiff line numberDiff line change
@@ -1,50 +0,0 @@
1-
body {
2-
margin: 0;
3-
}
4-
.Header {
5-
text-align: center;
6-
background: #2c2b2b;
7-
color: #fff;
8-
font-weight: bolder;
9-
font-size: 26px;
10-
padding: 10px 0;
11-
width: 100%;
12-
margin: 0;
13-
}
14-
15-
.fileuploader {
16-
width: 70px;
17-
height: 70px;
18-
padding: 32px 0 5px 0;
19-
display: flex;
20-
margin: 5px auto 0px auto;
21-
}
22-
input[type="file"] {
23-
display: none;
24-
}
25-
.icon {
26-
width: 100%;
27-
height: auto;
28-
}
29-
.upload_tag_line {
30-
text-align: center;
31-
margin: 0;
32-
font-size: 25px;
33-
}
34-
.submitbtn {
35-
background: black;
36-
color: white;
37-
padding: 10px;
38-
font-weight: 600;
39-
font-size: 15px;
40-
border-radius: 5px;
41-
width: 100%;
42-
position: absolute;
43-
bottom: 3px;
44-
}
45-
46-
#uploaded_img {
47-
width: 80%;
48-
display: flex;
49-
margin: auto;
50-
}

0 commit comments

Comments
 (0)