Skip to content

umzi2/SPANPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

57944b8 · Aug 5, 2024

History

28 Commits
Jun 15, 2024
Jun 15, 2024
Aug 5, 2024
Jun 15, 2024
Jun 21, 2024
Jun 15, 2024
Jun 15, 2024
Jun 15, 2024
Jun 15, 2024
Jun 15, 2024
Aug 5, 2024
Jun 15, 2024
Jun 15, 2024
Jun 15, 2024

Repository files navigation

SPANPlus

This repository is not an official modernization of span. The main idea of ​​which is to clean the code from unused pieces of code, increase stability by removing rgb_mean and adding a more stable upsampler. Also, the number of spab blocks can now be changed

Training code from NeoSR

Name Upscaler blocks feature_channels
spanplus Dysample [4] 48
spanplus-s DySample [2] 32
spanplus-sts PixelShuffle [2] 32
spanplus-st PixelShuffle [4] 48

Detect:

def detect(state):
    n_feats = get_seq_len(state, "feats")-1
    blocks = [
        get_seq_len(state,f"feats.{n_feat+1}.block_n")
        for n_feat in range(n_feats)
    ]
    num_in_ch = state["feats.0.eval_conv.weight"].shape[1]
    feature_channels = state["feats.0.eval_conv.weight"].shape[0]
    if "upsampler.0.weight" in state:
        upsampler = "ps"
        num_out_ch = num_in_ch
        upscale = int((state["upsampler.0.weight"].shape[0] / num_in_ch) ** 0.5)
    else:
        upsampler = "dys"
        num_out_ch = state["upsampler.end_conv.weight"].shape[0]
        upscale = int((state["upsampler.offset.weight"].shape[0] // 8) ** 0.5)
    print(num_in_ch,
          num_out_ch,
          blocks,
          feature_channels,
          upscale,
          upsampler)

TODO:

  • release metrics and pretrain

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages