From 711780126e292ffca984e42005dcfc2e4bc735c5 Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 3 Dec 2020 23:42:51 -0700 Subject: [PATCH] Cleanup --- codes/models/networks.py | 7 ------- codes/scripts/extract_square_images.py | 10 +++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/codes/models/networks.py b/codes/models/networks.py index 3205dd54..c77d435e 100644 --- a/codes/models/networks.py +++ b/codes/models/networks.py @@ -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'], style_depth=opt_net['style_depth'], structure_input=is_structured, 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': 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'], diff --git a/codes/scripts/extract_square_images.py b/codes/scripts/extract_square_images.py index f037733e..4f60cab8 100644 --- a/codes/scripts/extract_square_images.py +++ b/codes/scripts/extract_square_images.py @@ -13,15 +13,15 @@ import torch def main(): split_img = False opt = {} - opt['n_thread'] = 20 + opt['n_thread'] = 10 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 # compression time. If read raw images during training, use 0 for faster IO speed. opt['dest'] = 'file' - opt['input_folder'] = ['F:\\4k6k\datasets\\images\\youtube\\videos\\4k_quote_unquote\\images'] - opt['save_folder'] = 'F:\\4k6k\\datasets\\images\\ge_full_1024' - opt['imgsize'] = 1024 + opt['input_folder'] = ['F:\\4k6k\\datasets\\ns_images\\other_ns'] + opt['save_folder'] = 'F:\\4k6k\\datasets\\ns_images\\512_unsupervised' + opt['imgsize'] = 512 save_folder = opt['save_folder'] if not osp.exists(save_folder): @@ -53,7 +53,7 @@ class TiledDataset(data.Dataset): return None h, w, c = img.shape # Uncomment to filter any image that doesnt meet a threshold size. - if min(h,w) < 1024: + if min(h,w) < 512: return None # We must convert the image into a square.