(inputs, device)
| 16 | import pytorch3d.transforms as transforms |
| 17 | |
| 18 | def preprocess_data(inputs, device): |
| 19 | # normalize inputs according to https://pytorch.org/hub/pytorch_vision_mobilenet_v2/ |
| 20 | mean = torch.Tensor([0.485, 0.456, 0.406]).to(device) # per channel subtraction |
| 21 | std = torch.Tensor([0.229, 0.224, 0.225]).to(device) # per channel division |
| 22 | inputs = (inputs - mean[None,:,None,None])/std[None,:,None,None] |
| 23 | return inputs |
| 24 | |
| 25 | def filter_hook(m, g_in, g_out): |
| 26 | g_filtered = [] |
no outgoing calls
no test coverage detected