Skip to content

Instantly share code, notes, and snippets.

@poojatambe
Created June 6, 2022 16:23
Show Gist options
  • Save poojatambe/ec9126cc65a11c684602211b213f6191 to your computer and use it in GitHub Desktop.
Save poojatambe/ec9126cc65a11c684602211b213f6191 to your computer and use it in GitHub Desktop.
upload= st.file_uploader('Insert image for classification', type=['png','jpg'])
c1, c2= st.columns(2)
if upload is not None:
im= Image.open(upload)
img= np.asarray(im)
image= cv2.resize(img,(224, 224))
img= preprocess_input(image)
img= np.expand_dims(img, 0)
c1.header('Input Image')
c1.image(im)
c1.write(img.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment