Spaces:
Sleeping
Sleeping
harshitface2003
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,14 @@
|
|
1 |
-
|
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 |
-
|
10 |
|
11 |
-
|
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 |
-
|
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)
|
|
|
|
|
|