Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
st.image(
|
| 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)
|