Anuj-Panthri commited on
Commit
6e8bf22
·
1 Parent(s): ea3b21c

testing api

Browse files
Files changed (1) hide show
  1. app/api/routes.py +9 -7
app/api/routes.py CHANGED
@@ -226,10 +226,11 @@ def face_recognition(username):
226
 
227
  objs_found=face_detector.predict(image)
228
  h,w=image.shape[:2]
229
- all_crops=fd_get_crops(image,objs_found)
230
- all_crops_base64=[]
231
- for i,aligned_crop in enumerate(all_crops):
232
- all_crops_base64.append(image_to_base64(aligned_crop))
 
233
 
234
  tree=fr_helper.objs_found_to_xml("test.jpg",w,h,objs_found)
235
 
@@ -243,8 +244,9 @@ def face_recognition(username):
243
 
244
  pred_img=fr_helper.show_pred_image(tree,image)
245
  pred_img=image_to_base64(pred_img)
246
- objs_found=fr_helper.xml_to_objs_found(tree) # everything is okay till here
247
 
248
- person_ids=[obj_found['class'] for obj_found in objs_found]
249
 
250
- return jsonify({"message":"success","pred_image":pred_img,"person_ids":person_ids,"crops":all_crops_base64,"objs_found":objs_found})
 
 
226
 
227
  objs_found=face_detector.predict(image)
228
  h,w=image.shape[:2]
229
+
230
+ # all_crops=fd_get_crops(image,objs_found)
231
+ # all_crops_base64=[]
232
+ # for i,aligned_crop in enumerate(all_crops):
233
+ # all_crops_base64.append(image_to_base64(aligned_crop))
234
 
235
  tree=fr_helper.objs_found_to_xml("test.jpg",w,h,objs_found)
236
 
 
244
 
245
  pred_img=fr_helper.show_pred_image(tree,image)
246
  pred_img=image_to_base64(pred_img)
247
+ # objs_found=fr_helper.xml_to_objs_found(tree) # everything is okay till here
248
 
249
+ # person_ids=[obj_found['class'] for obj_found in objs_found]
250
 
251
+ return jsonify({"message":"success","pred_image":pred_img})
252
+ # return jsonify({"message":"success","pred_image":pred_img,"person_ids":person_ids,"crops":all_crops_base64,"objs_found":objs_found})