Skip to content

Instantly share code, notes, and snippets.

View shubham0204's full-sized avatar
🎯
Focusing

Shubham Panchal shubham0204

🎯
Focusing
View GitHub Profile
@shubham0204
shubham0204 / ml_notebooks.md
Last active February 25, 2024 05:27
A compilation of Google Colab notebooks made for teaching various interesting topics on TensorFlow and Keras.
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:
import streamlit as st
import cv2
import numpy as np
import requests
st.title( 'Mobile Camera Preview in Streamlit' )
frame_window = st.image( [] )
take_picture_button = st.button( 'Take Picture' )
while True:
class Classifier( private var positiveBagOfWords : Array<String> , private var negativeBagOfWords : Array<String>) {
companion object {
val CLASS_POSITIVE = 0
val CLASS_NEGATIVE = 1
private val englishStopWords = arrayOf(
"i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you", "your", "yours", "yourself", "yourselves",
"he", "him", "his", "himself", "she", "her", "hers", "herself", "it", "its", "itself", "they", "them", "their",
while True:
# Request the image from the server
response = requests.get(url="http://<network_ip_address>:<port>/photo.jpg")
imgNp = np.array(bytearray(response.content), dtype=np.uint8)
frame = cv2.imdecode(imgNp, cv2.IMREAD_UNCHANGED )
# As OpenCV decodes images in BGR format, we'd convert it to the RGB format
frame = cv2.cvtColor( frame , cv2.COLOR_BGR2RGB )
frame_window.image(frame)
import streamlit as st
import cv2
import numpy as np
import requests
# Title of the app
st.title( 'Mobile Camera Preview in Streamlit' )
# An empty image container that will hold the frames we'll fetch from the server
frame_window = st.image( [] )