Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,11 @@ def shearing(img):
|
|
| 98 |
img_all=cv2.warpAffine(img,shm,(img.shape[1],img.shape[0]))
|
| 99 |
img_shear_rgb=cv2.cvtColor(img_all,cv2.COLOR_BGR2RGB)
|
| 100 |
st.image(img_shear_rgb, caption="Shearing Applied", use_container_width=True)
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
|
| 104 |
if uploaded_file is not None:
|
|
@@ -122,6 +126,7 @@ if uploaded_file is not None:
|
|
| 122 |
shearing(img)
|
| 123 |
transformation.append("Shearing")
|
| 124 |
if crop:
|
|
|
|
| 125 |
transformation.append("Crop")
|
| 126 |
|
| 127 |
|
|
|
|
| 98 |
img_all=cv2.warpAffine(img,shm,(img.shape[1],img.shape[0]))
|
| 99 |
img_shear_rgb=cv2.cvtColor(img_all,cv2.COLOR_BGR2RGB)
|
| 100 |
st.image(img_shear_rgb, caption="Shearing Applied", use_container_width=True)
|
| 101 |
+
|
| 102 |
+
def cropping(img):
|
| 103 |
+
img_crop=img[20:120,50:155]
|
| 104 |
+
img_crop_rgb=cv2.cvtColor(img_crop,cv2.COLOR_BGR2RGB)
|
| 105 |
+
st.image(img_crop_rgb, caption="Shearing Applied", use_container_width=True)
|
| 106 |
|
| 107 |
|
| 108 |
if uploaded_file is not None:
|
|
|
|
| 126 |
shearing(img)
|
| 127 |
transformation.append("Shearing")
|
| 128 |
if crop:
|
| 129 |
+
cropping(img)
|
| 130 |
transformation.append("Crop")
|
| 131 |
|
| 132 |
|