darpanaswal commited on
Commit
4f9177c
·
verified ·
1 Parent(s): d292544

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,6 +1,7 @@
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
 
5
  app = Flask("Ogs")
6
 
@@ -20,12 +21,10 @@ def upload():
20
  if file.filename == '':
21
  return "No selected file"
22
 
23
- file.save("image.jpeg")
24
-
25
  # Process the image using your attendance model
26
- predict_and_show("image.jpeg")
27
 
28
- return send_file("attendance.csv", as_attachment=True)
29
 
30
 
31
  if __name__ == '__main__':
 
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
5
 
6
  app = Flask("Ogs")
7
 
 
21
  if file.filename == '':
22
  return "No selected file"
23
 
 
 
24
  # Process the image using your attendance model
25
+ data = predict_and_show(file)
26
 
27
+ return send_file((pd.DataFrame(data,column="Name").to_csv("attachment.csv",index = False), as_attachment=True)
28
 
29
 
30
  if __name__ == '__main__':