Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,17 +4,5 @@ import av
|
|
| 4 |
|
| 5 |
st.title("Webcam Display Streamlit App")
|
| 6 |
|
| 7 |
-
|
| 8 |
-
def transform(frame: av.VideoFrame):
|
| 9 |
-
img = frame.to_ndarray(format="bgr24") # Convert to NumPy array (BGR format)
|
| 10 |
-
|
| 11 |
-
# Simply return the image without applying any filters
|
| 12 |
-
return av.VideoFrame.from_ndarray(img, format="bgr24")
|
| 13 |
-
|
| 14 |
-
# Display the video stream
|
| 15 |
-
webrtc_streamer(
|
| 16 |
-
key="streamer",
|
| 17 |
-
video_frame_callback=transform, # The transform function is only used to process frames
|
| 18 |
-
sendback_audio=False, # We don't need audio in this case
|
| 19 |
-
mode=WebRtcMode.SENDRECV, # Use WebRtcMode enum instead of string
|
| 20 |
)
|
|
|
|
| 4 |
|
| 5 |
st.title("Webcam Display Streamlit App")
|
| 6 |
|
| 7 |
+
webrtc_streamer(key="example")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
)
|