Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from flask import Flask, render_template, request, send_file
|
2 |
# Import your attendance model and processing functions
|
3 |
from run import predict_and_show
|
4 |
import pandas as pd
|
@@ -24,7 +24,15 @@ def upload():
|
|
24 |
# Process the image using your attendance model
|
25 |
data = predict_and_show(file)
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
|
30 |
if __name__ == '__main__':
|
|
|
1 |
+
from flask import Flask, render_template, request, send_file, make_response
|
2 |
# Import your attendance model and processing functions
|
3 |
from run import predict_and_show
|
4 |
import pandas as pd
|
|
|
24 |
# Process the image using your attendance model
|
25 |
data = predict_and_show(file)
|
26 |
|
27 |
+
html_content = "<html><body><h1>Uploaded Items</h1><ul>"
|
28 |
+
for item in data:
|
29 |
+
html_content += f"<li>{item}</li>"
|
30 |
+
html_content += "</ul></body></html>"
|
31 |
+
|
32 |
+
# Create a response object with the generated HTML
|
33 |
+
response = make_response(html_content)
|
34 |
+
response.headers['Content-Type'] = 'text/html'
|
35 |
+
return response
|
36 |
|
37 |
|
38 |
if __name__ == '__main__':
|