testspace / app.py
harshitface2003's picture
Update app.py
3e3c70f verified
raw
history blame
570 Bytes
import streamlit as st
from streamlit_webrtc import webrtc_streamer, VideoTransformerBase
import av
import cv2
st.title("KAISA APP HAI YEH BSDK")
# Function to process each video frame
class VideoTransforms(VideoTransformerBase):
def transform(self,frame):
img = frame.to_ndarray(format="bgr24")
# (Optional) Process the frame (e.g., apply filters)
img=cv2.flip(img,1)
# Return the processed frame
return img
# WebRTC streamer component
webrtc_streamer(
key="example",
video_transformer_factory=VideoTransforms,
)