Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,11 +134,11 @@ def scaling(img,n=5):
|
|
| 134 |
def shearing(img,n=5):
|
| 135 |
for i in range(n):
|
| 136 |
sx=np.round(np.random.uniform(1,1.5),2)
|
| 137 |
-
shx=np.round(np.random.uniform(0,0.
|
| 138 |
-
tx=np.random.randint(1,
|
| 139 |
-
shy=np.round(np.random.uniform(0,0.
|
| 140 |
sy=np.round(np.random.uniform(1,1.2),2)
|
| 141 |
-
ty=np.random.randint(1,
|
| 142 |
shm=np.array([[sx,shx,tx],[shy,sy,ty]],dtype=np.float32)
|
| 143 |
img_shear=cv2.warpAffine(img,shm,(img.shape[1],img.shape[0]),borderMode=cv2.BORDER_REFLECT)
|
| 144 |
save_image_and_show(img_shear)
|
|
|
|
| 134 |
def shearing(img,n=5):
|
| 135 |
for i in range(n):
|
| 136 |
sx=np.round(np.random.uniform(1,1.5),2)
|
| 137 |
+
shx=np.round(np.random.uniform(0,0.5))
|
| 138 |
+
tx=np.random.randint(1,10)
|
| 139 |
+
shy=np.round(np.random.uniform(0,0.5))
|
| 140 |
sy=np.round(np.random.uniform(1,1.2),2)
|
| 141 |
+
ty=np.random.randint(1,15)
|
| 142 |
shm=np.array([[sx,shx,tx],[shy,sy,ty]],dtype=np.float32)
|
| 143 |
img_shear=cv2.warpAffine(img,shm,(img.shape[1],img.shape[0]),borderMode=cv2.BORDER_REFLECT)
|
| 144 |
save_image_and_show(img_shear)
|