mirror of
https://github.com/facefusion/facefusion-labs.git
synced 2026-07-28 16:08:50 +02:00
Remove UnetPro, make float values visible in README
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user