Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive resolution plus review #43

Closed
wants to merge 19 commits into from

Conversation

henryruhs
Copy link
Contributor

@henryruhs henryruhs commented Mar 4, 2025

Since 2^8=256 and 2^9=512, you need 9 upsampling steps instead of 8.
This means adding one more AdaptiveFeatureModulation layer to the AAD class.

The rest has been generated via ChatGPT.

Edit: gaze_scale_factor was probably not a good idea, but try it first on different resolutions.

Finally, I used more self.properties and removed pointless passing to methods

@henryruhs henryruhs requested a review from harisreedhar March 4, 2025 21:23
@henryruhs henryruhs reopened this Mar 5, 2025
@@ -169,9 +169,15 @@ def forward(self, target_tensor : Tensor, output_tensor : Tensor) -> Tuple[Tenso
return gaze_loss, weighted_gaze_loss

def detect_gaze(self, input_tensor : Tensor) -> Gaze:
crop_tensor = input_tensor[:, :, 60: 224, 16: 205]
scale_factor = CONFIG.getint('training.losses', 'gaze_scale_factor')
y_min = int(60 * scale_factor)
Copy link
Contributor Author

@henryruhs henryruhs Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder where the magic numbers come from and if we could use a torchvision transform instead?

crop_tensor = F.interpolate(input_tensor, scale_factor = scale_factor, mode = 'bicubic')
crop_tensor = crop_tensor[:, :, 60:224, 16:205]

@henryruhs henryruhs closed this Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants