justin2341 commited on
Commit
ed8443d
·
verified ·
1 Parent(s): e735dec

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +16 -16
demo.py CHANGED
@@ -30,23 +30,23 @@ def face_crop(image, face_rect):
30
  return face_image
31
 
32
  def compare_face(image1, image2):
33
- try:
34
- img_bytes1 = io.BytesIO()
35
- image1.save(img_bytes1, format="JPEG")
36
- img_bytes1.seek(0)
37
- except:
38
- return ["Failed to open image1", {"resultCode": "Failed to open image1"}]
39
-
40
- try:
41
- img_bytes2 = io.BytesIO()
42
- image2.save(img_bytes2, format="JPEG")
43
- img_bytes2.seek(0)
44
- except:
45
- return ["Failed to open image2", {"resultCode": "Failed to open image2"}]
46
 
47
- url = "http://127.0.0.1:8080/compare_face"
48
- files = {'file1': img_bytes1, 'file2': img_bytes2}
49
- result = requests.post(url=url, files=files)
50
 
51
  return "abcdef"
52
 
 
30
  return face_image
31
 
32
  def compare_face(image1, image2):
33
+ # try:
34
+ # img_bytes1 = io.BytesIO()
35
+ # image1.save(img_bytes1, format="JPEG")
36
+ # img_bytes1.seek(0)
37
+ # except:
38
+ # return ["Failed to open image1", {"resultCode": "Failed to open image1"}]
39
+
40
+ # try:
41
+ # img_bytes2 = io.BytesIO()
42
+ # image2.save(img_bytes2, format="JPEG")
43
+ # img_bytes2.seek(0)
44
+ # except:
45
+ # return ["Failed to open image2", {"resultCode": "Failed to open image2"}]
46
 
47
+ # url = "http://127.0.0.1:8080/compare_face"
48
+ # files = {'file1': img_bytes1, 'file2': img_bytes2}
49
+ # result = requests.post(url=url, files=files)
50
 
51
  return "abcdef"
52