swami123 commited on
Commit
7a14c90
·
1 Parent(s): 36a10c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -53,18 +53,20 @@ def check_face(frame):
53
 
54
 
55
  def call(frame):
56
-
57
- img = frame.to_ndarray(format='bgr24')
58
-
59
- check_face(img)
60
-
61
- if face_match:
62
- cv2.putText(img, 'Match !', (20, 450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 0), 3)
63
-
 
 
 
 
64
  else:
65
- cv2.putText(img, 'No Match !', (20, 450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255), 3)
66
-
67
- return av.VideoFrame.from_ndarray(img, format="bgr24")
68
 
69
 
70
  webrtc_streamer(key='example', video_frame_callback=call)
 
53
 
54
 
55
  def call(frame):
56
+ if frame:
57
+ img = frame.to_ndarray(format='bgr24')
58
+
59
+ check_face(img)
60
+
61
+ if face_match:
62
+ cv2.putText(img, 'Match !', (20, 450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 0), 3)
63
+
64
+ else:
65
+ cv2.putText(img, 'No Match !', (20, 450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255), 3)
66
+
67
+ return av.VideoFrame.from_ndarray(img, format="bgr24")
68
  else:
69
+ st.write('not working ')
 
 
70
 
71
 
72
  webrtc_streamer(key='example', video_frame_callback=call)