Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,9 +59,12 @@ scal = st.checkbox("Scaling")
|
|
| 59 |
shear=st.checkbox("Shearing")
|
| 60 |
crop=st.checkbox("Crop")
|
| 61 |
|
|
|
|
| 62 |
transformation=[]
|
| 63 |
btn=st.button("Preview Image")
|
| 64 |
|
|
|
|
|
|
|
| 65 |
def clear_folder(folder_name="output_images"):
|
| 66 |
if os.path.exists(folder_name):
|
| 67 |
for file in os.listdir(folder_name):
|
|
@@ -81,11 +84,11 @@ def save_image_and_show(image, folder_name="output_images"):
|
|
| 81 |
# Save the image
|
| 82 |
cv2.imwrite(image_path, image)
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
|
| 90 |
|
| 91 |
|
|
|
|
| 59 |
shear=st.checkbox("Shearing")
|
| 60 |
crop=st.checkbox("Crop")
|
| 61 |
|
| 62 |
+
|
| 63 |
transformation=[]
|
| 64 |
btn=st.button("Preview Image")
|
| 65 |
|
| 66 |
+
#sub=st.button("Preview Image")
|
| 67 |
+
|
| 68 |
def clear_folder(folder_name="output_images"):
|
| 69 |
if os.path.exists(folder_name):
|
| 70 |
for file in os.listdir(folder_name):
|
|
|
|
| 84 |
# Save the image
|
| 85 |
cv2.imwrite(image_path, image)
|
| 86 |
|
| 87 |
+
if btn:
|
| 88 |
+
# Showing the success message
|
| 89 |
+
st.success(f"Image saved to {image_path} (local path)")
|
| 90 |
+
# Show the image to the user (not the path)
|
| 91 |
+
st.image(image, caption="Saved Image", channels="BGR")
|
| 92 |
|
| 93 |
|
| 94 |
|