Adjust config and namings

This commit is contained in:
henryruhs
2025-03-11 14:43:10 +01:00
parent 176dced1f6
commit 430c71d031
7 changed files with 18 additions and 17 deletions
+4 -4
View File
@@ -169,15 +169,15 @@ class GazeLoss(nn.Module):
return gaze_loss, weighted_gaze_loss
def detect_gaze(self, input_tensor : Tensor) -> Gaze:
resolution = CONFIG.getint('training.dataset', 'resolution')
scale_factor = resolution / 256
scale_factor = CONFIG.getint('training.losses', 'gaze_scale_factor')
y_min = int(60 * scale_factor)
y_max = int(224 * scale_factor)
x_min = int(16 * scale_factor)
x_max = int(205 * scale_factor)
crop_tensor = input_tensor[:, :, y_min: y_max, x_min: x_max]
crop_tensor = input_tensor[:, :, y_min:y_max, x_min:x_max]
crop_tensor = (crop_tensor + 1) * 0.5
crop_tensor = transforms.Normalize(mean = [ 0.485, 0.456, 0.406 ], std = [ 0.229, 0.224, 0.225 ])(crop_tensor)
crop_tensor = nn.functional.interpolate(crop_tensor, size = (448, 448), mode = 'bicubic')
crop_tensor = nn.functional.interpolate(crop_tensor, size = 448, mode = 'bicubic')
pitch_tensor, yaw_tensor = self.gazer(crop_tensor)
return pitch_tensor, yaw_tensor