Spaces:
Running
Running
Upload webapp.py
Browse files
webapp.py
CHANGED
@@ -122,7 +122,7 @@ def main():
|
|
122 |
faces = 0
|
123 |
|
124 |
FRAME_WINDOW = st.image([])
|
125 |
-
camera = cv2.VideoCapture(0)
|
126 |
|
127 |
|
128 |
|
@@ -130,15 +130,16 @@ def main():
|
|
130 |
|
131 |
# Capture frame-by-frame
|
132 |
# Grab a single frame of video
|
133 |
-
|
134 |
|
135 |
-
if
|
|
|
136 |
result, process_this_frame, face_locations, faces, face_names, score = demo.process_frame(frame, process_this_frame, face_locations, faces, face_names, score)
|
137 |
# Display the resulting image
|
138 |
FRAME_WINDOW.image(result)
|
139 |
else:
|
|
|
140 |
print("there is no frame detected")
|
141 |
-
st.write("No frames")
|
142 |
continue
|
143 |
|
144 |
print(score)
|
|
|
122 |
faces = 0
|
123 |
|
124 |
FRAME_WINDOW = st.image([])
|
125 |
+
# camera = cv2.VideoCapture(0)
|
126 |
|
127 |
|
128 |
|
|
|
130 |
|
131 |
# Capture frame-by-frame
|
132 |
# Grab a single frame of video
|
133 |
+
frame_buffer = st.camera_input("Take a picture")
|
134 |
|
135 |
+
if frame_buffer is not None:
|
136 |
+
frame = frame_buffer.getvalue()
|
137 |
result, process_this_frame, face_locations, faces, face_names, score = demo.process_frame(frame, process_this_frame, face_locations, faces, face_names, score)
|
138 |
# Display the resulting image
|
139 |
FRAME_WINDOW.image(result)
|
140 |
else:
|
141 |
+
st.write("No frames.")
|
142 |
print("there is no frame detected")
|
|
|
143 |
continue
|
144 |
|
145 |
print(score)
|