harshitface2003 commited on
Commit
e802280
·
verified ·
1 Parent(s): 3e3c70f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -16
app.py CHANGED
@@ -1,23 +1,14 @@
1
- import streamlit as st
2
- from streamlit_webrtc import webrtc_streamer, VideoTransformerBase
3
  import av
4
  import cv2
5
 
6
- st.title("KAISA APP HAI YEH BSDK")
7
 
 
 
8
 
9
- # Function to process each video frame
10
 
11
- class VideoTransforms(VideoTransformerBase):
12
- def transform(self,frame):
13
- img = frame.to_ndarray(format="bgr24")
14
- # (Optional) Process the frame (e.g., apply filters)
15
- img=cv2.flip(img,1)
16
- # Return the processed frame
17
- return img
18
 
19
- # WebRTC streamer component
20
- webrtc_streamer(
21
- key="example",
22
- video_transformer_factory=VideoTransforms,
23
- )
 
1
+ from streamlit_webrtc import webrtc_streamer
 
2
  import av
3
  import cv2
4
 
 
5
 
6
+ def video_frame_callback(frame):
7
+ img = frame.to_ndarray(format="bgr24")
8
 
9
+ img=cv2.circle(img,(90,90),80,(255,0,0),9)
10
 
11
+ return av.VideoFrame.from_ndarray(img, format="bgr24")
 
 
 
 
 
 
12
 
13
+
14
+ webrtc_streamer(key="example", video_frame_callback=video_frame_callback)