瀏覽代碼

Upload files to 'Attendence'

SadhulaSaiKumar 1 年之前
父節點
當前提交
f1b1032b12
共有 1 個文件被更改,包括 14 次插入12 次删除
  1. 14
    12
      Attendence/uat_attendence.py

+ 14
- 12
Attendence/uat_attendence.py 查看文件

8
 app = Flask(__name__)
8
 app = Flask(__name__)
9
 #CORS(app)
9
 #CORS(app)
10
 lst = []
10
 lst = []
11
-
11
+Gallery="Gallery"
12
+People='People'
12
 
13
 
13
 @app.route('/', methods=['GET'])
14
 @app.route('/', methods=['GET'])
14
 def resume():
15
 def resume():
40
     input=url_list
41
     input=url_list
41
 
42
 
42
     from pathlib import Path
43
     from pathlib import Path
43
-    Path("ppeople").mkdir(exist_ok=True)
44
-    Path("ppeople/" + input["FileName"]).mkdir(exist_ok=True)
44
+    Path(People).mkdir(exist_ok=True)
45
+    Path(People+"/" + input["FileName"]).mkdir(exist_ok=True)
45
 
46
 
46
     a = input
47
     a = input
47
     # print(a)
48
     # print(a)
66
 
67
 
67
     import base64
68
     import base64
68
 
69
 
69
-    with open("ppeople/" + input["FileName"] + "/" + name, "wb") as fh:
70
+    with open(People+"/" + input["FileName"] + "/" + name, "wb") as fh:
70
         fh.write(base64.decodebytes(img_data))
71
         fh.write(base64.decodebytes(img_data))
71
 
72
 
72
-    img = "ppeople/" + y + "/" + name
73
-    saveLocation = "ppeople/" + y + "/" + y + ".pickle"
73
+    img = People+"/" + y + "/" + name
74
+    saveLocation = People+"/" + y + "/" + y + ".pickle"
74
 
75
 
75
     ############ detecting no of faceses #######################
76
     ############ detecting no of faceses #######################
76
 
77
 
240
     import cv2
241
     import cv2
241
 
242
 
242
     from pathlib import Path
243
     from pathlib import Path
243
-    Path("GGallery/"+ India_Date).mkdir(exist_ok=True)
244
-    Path("GGallery/"+ India_Date +'/'+ input["FileName"]).mkdir(exist_ok=True)
244
+    Path(Gallery).mkdir(exist_ok=True)
245
+    Path(Gallery+"/"+ India_Date).mkdir(exist_ok=True)
246
+    Path(Gallery+"/"+ India_Date +'/'+ input["FileName"]).mkdir(exist_ok=True)
245
 
247
 
246
     a = input
248
     a = input
247
     # print(a)
249
     # print(a)
264
     import base64
266
     import base64
265
     
267
     
266
 
268
 
267
-    with open("GGallery/"+India_Date+'/' + input["FileName"] + "/" + name, "wb") as fh:
269
+    with open(Gallery+"/"+India_Date+'/' + input["FileName"] + "/" + name, "wb") as fh:
268
         fh.write(base64.decodebytes(img_data))
270
         fh.write(base64.decodebytes(img_data))
269
 
271
 
270
-    path = "GGallery/" +India_Date+'/'+ y + "/" + name
271
-    pickle_location = "ppeople/" + y + "/" + y + ".pickle"
272
+    path = Gallery+"/" +India_Date+'/'+ y + "/" + name
273
+    pickle_location = People+"/" + y + "/" + y + ".pickle"
272
     import pathlib
274
     import pathlib
273
     file = pathlib.Path(pickle_location)
275
     file = pathlib.Path(pickle_location)
274
     if file.exists ():
276
     if file.exists ():
278
         print(name)
280
         print(name)
279
         return "Face not found in profile (please change your profile)"
281
         return "Face not found in profile (please change your profile)"
280
 
282
 
281
-    check_faces="ppeople/" + y + "/" + y + ".jpg"
283
+    check_faces=People+"/" + y + "/" + y + ".jpg"
282
     print(check_faces)
284
     print(check_faces)
283
 
285
 
284
 
286
 

Loading…
取消
儲存