Mpavan45 commited on
Commit
04cb461
·
verified ·
1 Parent(s): 590e386

Update Image Augmentation.py

Browse files
Files changed (1) hide show
  1. Image Augmentation.py +11 -9
Image Augmentation.py CHANGED
@@ -98,12 +98,14 @@ if uploaded_file:
98
 
99
  st.image(cv2.cvtColor(transformed_image, cv2.COLOR_BGR2RGB), caption="Transformed Image", use_column_width=True)
100
 
101
- st.markdown("### Download Transformed Image:")
102
- download_format = st.radio("Select Download Format:", ["JPG", "PNG", "PDF"])
103
-
104
- if download_format == "JPG":
105
- st.markdown(download_image(transformed_image, download_format), unsafe_allow_html=True)
106
- elif download_format == "PNG":
107
- st.markdown(download_image(transformed_image, download_format), unsafe_allow_html=True)
108
- elif download_format == "PDF":
109
- st.markdown(download_pdf(transformed_image), unsafe_allow_html=True)
 
 
 
98
 
99
  st.image(cv2.cvtColor(transformed_image, cv2.COLOR_BGR2RGB), caption="Transformed Image", use_column_width=True)
100
 
101
+ # Provide download options after transformations
102
+ if transformed_image is not None:
103
+ st.markdown("### Download Transformed Image:")
104
+ download_format = st.radio("Select Download Format:", ["JPG", "PNG", "PDF"], key="download_format")
105
+
106
+ if download_format == "JPG":
107
+ st.markdown(download_image(transformed_image, download_format), unsafe_allow_html=True)
108
+ elif download_format == "PNG":
109
+ st.markdown(download_image(transformed_image, download_format), unsafe_allow_html=True)
110
+ elif download_format == "PDF":
111
+ st.markdown(download_pdf(transformed_image, download_format), unsafe_allow_html=True)