"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

May 22, 2021

Streamlit vision demo

 



import streamlit as st
import cv2
from PIL import Image,ImageEnhance
import numpy as np
import os
import PIL.ImageOps
imagefile = st.file_uploader("Upload Image",type=['jpg','png','jpeg'])
if imagefile is not None:
image = Image.open(imagefile)
opencvImage = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
st.text("Original Image")
st.image(image)
#Create Gray Scale Image
st.markdown('**Grey Image Genration:**')
greyimagetask = st.button('Generate grayscale image')
if greyimagetask:
gray = cv2.cvtColor(opencvImage, cv2.COLOR_BGR2GRAY)
st.image(gray)
st.markdown('**Negative Image Genration:**')
#Create Negative Image
negativeimagetask = st.button('Generate negative image')
if negativeimagetask:
inverted_image = PIL.ImageOps.invert(image)
st.image(inverted_image)


conda create --name visionexperiment
conda activate visionexperiment
conda install pip
pip install -r requirements.txt
anaconda-client
dlib==19.21.1
imutils==0.5.4
numpy
opencv-python==4.5.1.48
scikit-image==0.18.1
scipy==1.6.3
tensorboard
tensorboard-data-server
tensorboard-plugin-wit
tensorflow
tensorflow-estimator
streamlit

Happy Learning!!!!

No comments: