MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / preprocess_data

Function preprocess_data

script/dm/pose_model.py:18–23  ·  view source on GitHub ↗
(inputs, device)

Source from the content-addressed store, hash-verified

16import pytorch3d.transforms as transforms
17
18def 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
25def filter_hook(m, g_in, g_out):
26 g_filtered = []

Callers 5

compute_error_in_qFunction · 0.85
eval_on_epochFunction · 0.85
train_on_epochFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected