shubham680 commited on
Commit
e5fd138
·
verified ·
1 Parent(s): 950f7c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -47,10 +47,15 @@ st.markdown("<br><br>", unsafe_allow_html=True)
47
  uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
48
 
49
  if uploaded_file is not None:
50
- img=cv2.imread(uploaded_file)
 
 
 
 
 
51
 
52
-
53
- st.image(cv2.imshow("jf",img), caption="Uploaded Image (OpenCV)", use_column_width=True)
54
 
55
  # output=cv2.imshow("bgr",img)
56
  cv2.waitKey(100)
 
47
  uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
48
 
49
  if uploaded_file is not None:
50
+ # Converting the image into array
51
+ img_array=np.asarray(bytearray(uploaded_file.read()),dtype=np.uint8)
52
+ # Decode or converting the array back to image
53
+ img=cv2.imdecode(img_array,cv2.IMREAD_COLOR)
54
+ # Convert BGR to RGB
55
+ img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
56
 
57
+ # Displaying image in streamlit
58
+ st.image(, caption="Uploaded Image (OpenCV)", use_column_width=True)
59
 
60
  # output=cv2.imshow("bgr",img)
61
  cv2.waitKey(100)