Turing311 commited on
Commit
c27490b
1 Parent(s): 3a473ae
Files changed (2) hide show
  1. app.py +1 -1
  2. gradio/demo.py +3 -1
app.py CHANGED
@@ -118,7 +118,7 @@ def compare_face():
118
  "data": {
119
  "result": result,
120
  "similarity": float(similarity),
121
- "face1": {"x1": int(feature2[0]), "y1": int(faceRect1[1]), "x2": int(faceRect1[2]), "y2" : int(faceRect1[3])},
122
  "face2": {"x1": int(faceRect2[0]), "y1": int(faceRect2[1]), "x2": int(faceRect2[2]), "y2" : int(faceRect2[3])},
123
  }
124
  })
 
118
  "data": {
119
  "result": result,
120
  "similarity": float(similarity),
121
+ "face1": {"x1": int(faceRect1[0]), "y1": int(faceRect1[1]), "x2": int(faceRect1[2]), "y2" : int(faceRect1[3])},
122
  "face2": {"x1": int(faceRect2[0]), "y1": int(faceRect2[1]), "x2": int(faceRect2[2]), "y2" : int(faceRect2[3])},
123
  }
124
  })
gradio/demo.py CHANGED
@@ -16,13 +16,14 @@ def compare_face(frame1, frame2):
16
  face1 = None
17
  face2 = None
18
  data = r.json().get('data')
 
19
  if data.get('face1') is not None:
20
  face = data.get('face1')
21
  x1 = face.get('x1')
22
  y1 = face.get('y1')
23
  x2 = face.get('x2')
24
  y2 = face.get('y2')
25
-
26
  if x1 < 0:
27
  x1 = 0
28
  if y1 < 0:
@@ -38,6 +39,7 @@ def compare_face(frame1, frame2):
38
  resized_h = 150
39
 
40
  face1 = face1.resize((int(resized_w), int(resized_h)))
 
41
 
42
  if data.get('face2') is not None:
43
  face = data.get('face2')
 
16
  face1 = None
17
  face2 = None
18
  data = r.json().get('data')
19
+ print("1------------")
20
  if data.get('face1') is not None:
21
  face = data.get('face1')
22
  x1 = face.get('x1')
23
  y1 = face.get('y1')
24
  x2 = face.get('x2')
25
  y2 = face.get('y2')
26
+ print("2------------", x1, x2, y1, y2)
27
  if x1 < 0:
28
  x1 = 0
29
  if y1 < 0:
 
39
  resized_h = 150
40
 
41
  face1 = face1.resize((int(resized_w), int(resized_h)))
42
+ print("3------------", face1)
43
 
44
  if data.get('face2') is not None:
45
  face = data.get('face2')