Skip to content

Instantly share code, notes, and snippets.

@shubham0204
Created June 27, 2022 01:18
Show Gist options
  • Save shubham0204/ffd3c0bffd2b517d34754fe52913b79b to your computer and use it in GitHub Desktop.
Save shubham0204/ffd3c0bffd2b517d34754fe52913b79b to your computer and use it in GitHub Desktop.
import streamlit as st
import cv2
vid = cv2.VideoCapture( 'http://<network_ip_Address>:8080/video' )
st.title( 'Using Mobile Camera with Streamlit' )
frame_window = st.image( [] )
take_picture_button = st.button( 'Take Picture' )
while True:
got_frame , frame = vid.read()
frame = cv2.cvtColor( frame , cv2.COLOR_BGR2RGB )
if got_frame:
frame_window.image(frame)
if take_picture_button:
# Pass the frame to a model
# And show the output here...
break
vid.release()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment