ducha-aiki
commited on
Commit
•
1f38ecb
1
Parent(s):
fbd009a
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import kornia as K
|
|
3 |
import numpy as np
|
4 |
import kornia.geometry as KG
|
5 |
import torch
|
6 |
-
|
7 |
|
8 |
def geometry_transform(images: list,
|
9 |
translation: float,
|
@@ -20,8 +20,8 @@ def geometry_transform(images: list,
|
|
20 |
affine_matrix: torch.Tensor = KG.get_affine_matrix2d(translation, center, scale, angle)
|
21 |
|
22 |
transformed: torch.Tensor = KG.transform.warp_affine(image_batch, affine_matrix[:, :2], dsize=image_batch.shape[2:])
|
23 |
-
|
24 |
-
final_images: np.ndarray =
|
25 |
|
26 |
return final_images
|
27 |
|
|
|
3 |
import numpy as np
|
4 |
import kornia.geometry as KG
|
5 |
import torch
|
6 |
+
|
7 |
|
8 |
def geometry_transform(images: list,
|
9 |
translation: float,
|
|
|
20 |
affine_matrix: torch.Tensor = KG.get_affine_matrix2d(translation, center, scale, angle)
|
21 |
|
22 |
transformed: torch.Tensor = KG.transform.warp_affine(image_batch, affine_matrix[:, :2], dsize=image_batch.shape[2:])
|
23 |
+
concat_images: list = torch.cat(transformed, dim=-1)
|
24 |
+
final_images: np.ndarray = K.tensor_to_image(concat_images*255).astype(np.uint8)
|
25 |
|
26 |
return final_images
|
27 |
|