Skip to content

Commit 7a415aa

Browse files
Lint
1 parent 017b222 commit 7a415aa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

benchmarks/benchmark_transforms.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
NORM_MEAN_CUDA_CV = cvcuda.as_tensor(torch.Tensor(NORM_MEAN).reshape(1, 1, 1, 3).cuda(), "NHWC")
6868
NORM_STD_CUDA_CV = cvcuda.as_tensor(torch.Tensor(NORM_STD).reshape(1, 1, 1, 3).cuda(), "NHWC")
6969

70+
7071
def torchvision_pipeline(images: torch.Tensor, target_size: int) -> torch.Tensor:
7172
images = F.resize(
7273
images, size=(target_size, target_size), interpolation=F.InterpolationMode.BILINEAR, antialias=True
@@ -114,12 +115,10 @@ def cudacv_pipeline(image: torch.Tensor, target_size: int) -> torch.Tensor:
114115
img: cvcuda.Tensor = cvcuda.convertto(
115116
src=img,
116117
dtype=np.float32,
117-
scale=1.0/255.0,
118-
)
119-
120-
img: cvcuda.Tensor = cvcuda.normalize(
121-
img, NORM_MEAN_CUDA_CV, NORM_STD_CUDA_CV
118+
scale=1.0 / 255.0,
122119
)
120+
121+
img: cvcuda.Tensor = cvcuda.normalize(img, NORM_MEAN_CUDA_CV, NORM_STD_CUDA_CV)
123122
out = torch.as_tensor(img.cuda())
124123
if channel_first:
125124
out = out.permute(0, 3, 1, 2)

0 commit comments

Comments
 (0)