Skip to content

Unofficial implementation of Hierarchical Flow (image-to-image) for didactic purposes

Notifications You must be signed in to change notification settings

myscience/hierarchy-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hierarchy Flow in Easy PyTorch

This repo contains the unofficial implementation for Hierarchy Flow For High-Fidelity Image-to-Image Translation Fan et al. (2023), which I developed as a nice entry into the world of normalizing flows.

The authors release their official implementation which can be found here.

Usage

import torch
from src.hflow import HierarchyFlow

flow = HierarchyFlow(
    inp_channels=3,
    flow_channel_mult=[10, 4, 4], # Set channel mult of the hierarchy convs
    feat_channel_mult=[3, 3, 3],  # Set the channel mult factors of the style convs 
    pad_size = 10, # Input pad size
    pad_mode = 'reflect',
    style_out_dim = 8, # Number of channel of final style features
    style_conv_kw = [
        {'kernel_size' : 7, 'stride' : 1, 'padding' : 3},
        *[{'kernel_size' : 4, 'stride' : 2, 'padding' : 1}] * 2
    ] # Parameter for style convolutional layers, should match length of feat_channel_mult
)

x = torch.randn(1, 3, 256, 256)
y = flow(x)

About

Unofficial implementation of Hierarchical Flow (image-to-image) for didactic purposes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages