Remove UnetPro, make float values visible in README

This commit is contained in:
henryruhs
2025-03-11 14:43:10 +01:00
parent 6d805438ad
commit f9de4ce78a
5 changed files with 4 additions and 44 deletions
+2 -6
View File
@@ -3,7 +3,7 @@ import configparser
from torch import Tensor, nn
from ..networks.aad import AAD
from ..networks.unet import UNet, UNetPro
from ..networks.unet import UNet
from ..types import Attributes, Embedding
CONFIG = configparser.ConfigParser()
@@ -13,16 +13,12 @@ CONFIG.read('config.ini')
class Generator(nn.Module):
def __init__(self) -> None:
super().__init__()
encoder_type = CONFIG.get('training.model.generator', 'encoder_type')
identity_channels = CONFIG.getint('training.model.generator', 'identity_channels')
output_channels = CONFIG.getint('training.model.generator', 'output_channels')
output_size = CONFIG.getint('training.model.generator', 'output_size')
num_blocks = CONFIG.getint('training.model.generator', 'num_blocks')
if encoder_type == 'unet':
self.encoder = UNet(output_size)
if encoder_type == 'unet-pro':
self.encoder = UNetPro(output_size)
self.encoder = UNet(output_size)
self.generator = AAD(identity_channels, output_channels, output_size, num_blocks)
self.encoder.apply(init_weight)
self.generator.apply(init_weight)
+1 -1
View File
@@ -169,7 +169,7 @@ class GazeLoss(nn.Module):
return gaze_loss, weighted_gaze_loss
def detect_gaze(self, input_tensor : Tensor) -> Gaze:
scale_factor = CONFIG.getint('training.losses', 'gaze_scale_factor')
scale_factor = CONFIG.getfloat('training.losses', 'gaze_scale_factor')
y_min = int(60 * scale_factor)
y_max = int(224 * scale_factor)
x_min = int(16 * scale_factor)