This commit is contained in:
James Betker 2020-12-03 23:42:51 -07:00
parent ac7256d4a3
commit 711780126e
2 changed files with 5 additions and 12 deletions

View File

@ -125,13 +125,6 @@ def define_G(opt, opt_net, scale=None):
netG = stylegan2.StyleGan2GeneratorWithLatent(image_size=opt_net['image_size'], latent_dim=opt_net['latent_dim'], netG = stylegan2.StyleGan2GeneratorWithLatent(image_size=opt_net['image_size'], latent_dim=opt_net['latent_dim'],
style_depth=opt_net['style_depth'], structure_input=is_structured, style_depth=opt_net['style_depth'], structure_input=is_structured,
attn_layers=attn) attn_layers=attn)
elif which_model == 'srflow':
from models.archs.srflow import SRFlow_arch
netG = SRFlow_arch.SRFlowNet(in_nc=3, out_nc=3, nf=opt_net['nf'], nb=opt_net['nb'],
quant=opt_net['quant'], flow_block_maps=opt_net['rrdb_block_maps'],
noise_quant=opt_net['noise_quant'], hidden_channels=opt_net['nf'],
K=opt_net['K'], L=opt_net['L'], train_rrdb_at_step=opt_net['rrdb_train_step'],
hr_img_shape=opt_net['hr_shape'], scale=opt_net['scale'])
elif which_model == 'srflow_orig': elif which_model == 'srflow_orig':
from models.archs.srflow_orig import SRFlowNet_arch from models.archs.srflow_orig import SRFlowNet_arch
netG = SRFlowNet_arch.SRFlowNet(in_nc=3, out_nc=3, nf=opt_net['nf'], nb=opt_net['nb'], scale=opt_net['scale'], netG = SRFlowNet_arch.SRFlowNet(in_nc=3, out_nc=3, nf=opt_net['nf'], nb=opt_net['nb'], scale=opt_net['scale'],

View File

@ -13,15 +13,15 @@ import torch
def main(): def main():
split_img = False split_img = False
opt = {} opt = {}
opt['n_thread'] = 20 opt['n_thread'] = 10
opt['compression_level'] = 90 # JPEG compression quality rating. opt['compression_level'] = 90 # JPEG compression quality rating.
# CV_IMWRITE_PNG_COMPRESSION from 0 to 9. A higher value means a smaller size and longer # CV_IMWRITE_PNG_COMPRESSION from 0 to 9. A higher value means a smaller size and longer
# compression time. If read raw images during training, use 0 for faster IO speed. # compression time. If read raw images during training, use 0 for faster IO speed.
opt['dest'] = 'file' opt['dest'] = 'file'
opt['input_folder'] = ['F:\\4k6k\datasets\\images\\youtube\\videos\\4k_quote_unquote\\images'] opt['input_folder'] = ['F:\\4k6k\\datasets\\ns_images\\other_ns']
opt['save_folder'] = 'F:\\4k6k\\datasets\\images\\ge_full_1024' opt['save_folder'] = 'F:\\4k6k\\datasets\\ns_images\\512_unsupervised'
opt['imgsize'] = 1024 opt['imgsize'] = 512
save_folder = opt['save_folder'] save_folder = opt['save_folder']
if not osp.exists(save_folder): if not osp.exists(save_folder):
@ -53,7 +53,7 @@ class TiledDataset(data.Dataset):
return None return None
h, w, c = img.shape h, w, c = img.shape
# Uncomment to filter any image that doesnt meet a threshold size. # Uncomment to filter any image that doesnt meet a threshold size.
if min(h,w) < 1024: if min(h,w) < 512:
return None return None
# We must convert the image into a square. # We must convert the image into a square.