Eye_tracking 1 |

Cargando...
Buscando...
Nada coincide
transforms.py
Ir a la documentación de este archivo.
1 from typing import Any
2
3 import cv2
4 import torchvision.transforms as T
5 from omegaconf import DictConfig
6
7
8 def create_transform(config: DictConfig) -> Any:
9 size = tuple(config.gaze_estimator.image_size)
10 transform = T.Compose([
11 T.Lambda(lambda x: cv2.resize(x, size)),
12 T.Lambda(lambda x: x[:, :, ::-1].copy()), # BGR -> RGB
13 T.ToTensor(),
14 T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224,
15 0.225]), # RGB
16 ])
17 return transform
pygaze.transforms.create_transform
Any create_transform(DictConfig config)
Definition transforms.py:8