Turing311 commited on
Commit
8d6f814
·
1 Parent(s): 9f7ae6b
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -18,9 +18,9 @@ def compare_face(frame1, frame2):
18
 
19
  face1 = None
20
  face2 = None
21
- image1 = r.json().get('image1')
22
- if image1 is not None:
23
- face = image1.get('detection')
24
  print("--------------", face)
25
  x1 = face.get('x')
26
  y1 = face.get('y')
@@ -42,9 +42,9 @@ def compare_face(frame1, frame2):
42
 
43
  face1 = face1.resize((int(resized_w), int(resized_h)))
44
 
45
- image2 = r.json().get('image2')
46
- if image2 is not None:
47
- face = image2.get('detection')
48
  print("++++++++++--------------", face)
49
  x1 = face.get('x')
50
  y1 = face.get('y')
@@ -88,7 +88,7 @@ def compare_face(frame1, frame2):
88
  pass
89
 
90
  print(face1, face2)
91
- return [r.json(), []]
92
 
93
  with gr.Blocks() as demo:
94
  gr.Markdown(
 
18
 
19
  face1 = None
20
  face2 = None
21
+ res1 = r.json().get('image1')
22
+ if res1 is not None:
23
+ face = res1.get('detection')
24
  print("--------------", face)
25
  x1 = face.get('x')
26
  y1 = face.get('y')
 
42
 
43
  face1 = face1.resize((int(resized_w), int(resized_h)))
44
 
45
+ res2 = r.json().get('image2')
46
+ if res2 is not None:
47
+ face = res2.get('detection')
48
  print("++++++++++--------------", face)
49
  x1 = face.get('x')
50
  y1 = face.get('y')
 
88
  pass
89
 
90
  print(face1, face2)
91
+ return [r.json(), [face1, face2]]
92
 
93
  with gr.Blocks() as demo:
94
  gr.Markdown(