Spaces:
Sleeping
Sleeping
Jyotiyadav
commited on
Commit
•
74d1055
1
Parent(s):
f41915c
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import av
|
2 |
+
import cv2
|
3 |
+
import streamlit as st
|
4 |
+
from streamlit_webrtc import webrtc_streamer
|
5 |
+
st.title("Computer Vision Streamlit application")
|
6 |
+
class VideoProcessor:
|
7 |
+
def recv(self, frame):
|
8 |
+
image = frame.to_ndarray(format="bgr24")
|
9 |
+
image = cv2.cvtColor(cv2.Canny(image, 100, 200), cv2.COLOR_GRAY2BGR)
|
10 |
+
return av.VideoFrame.from_ndarray(image, format="bgr24")
|
11 |
+
webrtc_streamer(key="demo", video_processor_factory=VideoProcessor)
|