diff --git a/app.py b/app.py index ccaf80a3c5d29334ef322fca30a1e113a16a6802..163456b5e37b4a8937ce9fd303b6dfcafc874e24 100644 --- a/app.py +++ b/app.py @@ -167,15 +167,15 @@ class Tester(TesterBase): sampled_code = tex_seg[:, tex_idx, :] rec_tex = sampled_code.view(1, -1, 1, 1).repeat(1, 1, tex_size, tex_size) - sine_wave = self.model.get_sine_wave(rec_tex, 'rec') + sine_wave = self.model.get_sine_wave(rec_tex, 'rec')[:1] H = tex_size // 8; W = tex_size // 8 noise = torch.randn(B, self.model.sine_wave_dim, H, W).to(tex_code.device) dec_input = torch.cat((sine_wave, noise), dim = 1) - weight = self.model.ChannelWeight(rec_tex) - weight = F.adaptive_avg_pool2d(weight, output_size = (1)).view(weight.shape[0], -1, 1, 1) - weight = torch.sigmoid(weight) - dec_input *= weight + #weight = self.model.ChannelWeight(rec_tex) + #weight = F.adaptive_avg_pool2d(weight, output_size = (1)).view(weight.shape[0], -1, 1, 1) + #weight = torch.sigmoid(weight) + #dec_input *= weight rep_rec = self.model.G(dec_input, rec_tex) rep_rec = (rep_rec + 1) / 2.0 @@ -256,6 +256,7 @@ class Tester(TesterBase): given_mask = torch.from_numpy(given_mask) H, W = given_mask.shape[0], given_mask.shape[1] given_mask = label2one_hot_torch(given_mask.view(1, 1, H, W), C = (given_mask.max()+1)) + given_mask = F.interpolate(given_mask, size = (512, 512), mode = 'bilinear', align_corners = False) mask_img_list = [] for i in range(given_mask.shape[1]): part_img = self.to_pil(given_mask[0, i]) @@ -291,22 +292,26 @@ class Tester(TesterBase): #tex_size = (tex_size // 8) * 8 with torch.no_grad(): edited = self.model_forward_editing(self.data, self.slic, options=options, given_mask=given_mask, return_type = 'edited') - col1, col2, col3, col4 = st.columns([1, 1, 4, 1]) + col1, col2, col3 = st.columns([1, 1, 1]) with col1: - st.markdown("") - - with col2: st.markdown("Input image") img = F.interpolate(self.data, size = edited.shape[-2:], mode = 'bilinear', align_corners = False) st.image(self.to_pil((img + 1) / 2.0)) print(img.shape, edited.shape) + with col2: + st.markdown("Given mask") + seg = Image.open(mask_path).convert("L") + seg = np.asarray(seg) + seg = torch.from_numpy(seg).view(1, 1, seg.shape[0], seg.shape[1]) + color_vq = self.draw_color_seg(seg) + color_vq = F.interpolate(color_vq, size = (512, 512), mode = 'bilinear', align_corners = False) + st.image(self.to_pil(color_vq)) + with col3: st.markdown("Synthesized texture image") st.image(self.to_pil(edited)) - with col4: - st.markdown("") st.markdown('
You can choose another image from the examplar images on the top and start again!
', unsafe_allow_html=True) def model_forward_editing(self, rgb_img, slic, epoch = 1000, test_time = False, @@ -334,23 +339,17 @@ class Tester(TesterBase): tex_seg = poolfeat(conv_feats, softmax, avg = True) seg = label2one_hot_torch(torch.argmax(softmax, dim = 1).unsqueeze(1), C = softmax.shape[1]) - given_mask = F.interpolate(given_mask, size = (512, 512), mode = 'bilinear', align_corners = False) rec_tex = torch.zeros((1, tex_seg.shape[-1], 512, 512)) for i in range(given_mask.shape[1]): label = options[i] code = tex_seg[0, label, :].view(1, -1, 1, 1).repeat(1, 1, 512, 512) rec_tex += code * given_mask[:, i:i+1] tex_size = 512 - sine_wave = self.model.get_sine_wave(rec_tex, 'rec') + sine_wave = self.model.get_sine_wave(rec_tex, 'rec')[:1] H = tex_size // 8; W = tex_size // 8 noise = torch.randn(B, self.model.sine_wave_dim, H, W).to(tex_code.device) dec_input = torch.cat((sine_wave, noise), dim = 1) - weight = self.model.ChannelWeight(rec_tex) - weight = F.adaptive_avg_pool2d(weight, output_size = (1)).view(weight.shape[0], -1, 1, 1) - weight = torch.sigmoid(weight) - dec_input *= weight - rep_rec = self.model.G(dec_input, rec_tex) rep_rec = (rep_rec + 1) / 2.0 return rep_rec @@ -359,6 +358,7 @@ class Tester(TesterBase): rgb_img = Image.open(data_path) crop_size = self.args.crop_size i = 40; j = 40; h = crop_size; w = crop_size + rgb_img = transforms.Resize(size=320)(rgb_img) rgb_img = TF.crop(rgb_img, i, j, h, w) # compute superpixel diff --git a/data/images/108073.jpg b/data/images/108073.jpg deleted file mode 100755 index b4a23e5c18c7120d2cfc11996e2ce87fa6f04389..0000000000000000000000000000000000000000 Binary files a/data/images/108073.jpg and /dev/null differ diff --git a/data/test_images/130014.jpg b/data/images/130014.jpg similarity index 100% rename from data/test_images/130014.jpg rename to data/images/130014.jpg diff --git a/data/images/134008.jpg b/data/images/134008.jpg deleted file mode 100755 index 234fc1552fb1974c3989b4b20d91520d1196a099..0000000000000000000000000000000000000000 Binary files a/data/images/134008.jpg and /dev/null differ diff --git a/data/images/25098.jpg b/data/images/25098.jpg deleted file mode 100755 index db3519e0a6ce14ebcc2953b25d33242f8e272806..0000000000000000000000000000000000000000 Binary files a/data/images/25098.jpg and /dev/null differ diff --git a/data/images/45077.jpg b/data/images/45077.jpg deleted file mode 100755 index 98ff1e6fc3180e44f6fd1d450bd912dd43eee8b8..0000000000000000000000000000000000000000 Binary files a/data/images/45077.jpg and /dev/null differ diff --git a/data/images/corn.jpg b/data/images/corn.jpg new file mode 100755 index 0000000000000000000000000000000000000000..cff62686b62cf8435b1e373c24c93b951e3fab5e Binary files /dev/null and b/data/images/corn.jpg differ diff --git a/data/test_images/108004.jpg b/data/test_images/108004.jpg deleted file mode 100755 index 8bd18d4d03a21c49415e9e35fa53edb6fe2370f3..0000000000000000000000000000000000000000 Binary files a/data/test_images/108004.jpg and /dev/null differ diff --git a/data/test_images/130066.jpg b/data/test_images/130066.jpg deleted file mode 100755 index 93bfa47bd0b6d169520b4c243dc61f2b02322856..0000000000000000000000000000000000000000 Binary files a/data/test_images/130066.jpg and /dev/null differ diff --git a/data/test_images/16068.jpg b/data/test_images/16068.jpg deleted file mode 100755 index 2017deaa09810b9a6da5c61fcddb5eb3c356334b..0000000000000000000000000000000000000000 Binary files a/data/test_images/16068.jpg and /dev/null differ diff --git a/data/test_images/208078.jpg b/data/test_images/208078.jpg deleted file mode 100755 index eed41933c8766c4c296dce5602ce123376b52f15..0000000000000000000000000000000000000000 Binary files a/data/test_images/208078.jpg and /dev/null differ diff --git a/data/test_images/223060.jpg b/data/test_images/223060.jpg deleted file mode 100755 index 690053020784601009e05b8844cdddf437fa1e7b..0000000000000000000000000000000000000000 Binary files a/data/test_images/223060.jpg and /dev/null differ diff --git a/data/test_images/388006.jpg b/data/test_images/388006.jpg deleted file mode 100755 index 49d70f0f37c5f8b1435ac1f25aa6946dda2bef89..0000000000000000000000000000000000000000 Binary files a/data/test_images/388006.jpg and /dev/null differ diff --git a/data/test_images/78098.jpg b/data/test_images/78098.jpg deleted file mode 100755 index 8b3cb4d82fce65f184a3504175453d5a898c6da7..0000000000000000000000000000000000000000 Binary files a/data/test_images/78098.jpg and /dev/null differ diff --git a/models/week0417/__pycache__/loss.cpython-38.pyc b/models/week0417/__pycache__/loss.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e896c59f911a2a3ec7ef33e1f898298ecd387598 Binary files /dev/null and b/models/week0417/__pycache__/loss.cpython-38.pyc differ diff --git a/models/week0417/__pycache__/meanshift_utils.cpython-37.pyc b/models/week0417/__pycache__/meanshift_utils.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5992781e70a1099a1c75a00c97aa1bcd31cd8065 Binary files /dev/null and b/models/week0417/__pycache__/meanshift_utils.cpython-37.pyc differ diff --git a/models/week0417/__pycache__/meanshift_utils.cpython-38.pyc b/models/week0417/__pycache__/meanshift_utils.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b2b74e1270b2f018170f38a23b35ee51539039b Binary files /dev/null and b/models/week0417/__pycache__/meanshift_utils.cpython-38.pyc differ diff --git a/models/week0417/__pycache__/model.cpython-37.pyc b/models/week0417/__pycache__/model.cpython-37.pyc index 08941e675a771198163b3d725e065c2f561f7fed..aee7f129489f2617708cb87a979b0ead4b0785c6 100644 Binary files a/models/week0417/__pycache__/model.cpython-37.pyc and b/models/week0417/__pycache__/model.cpython-37.pyc differ diff --git a/models/week0417/__pycache__/model.cpython-38.pyc b/models/week0417/__pycache__/model.cpython-38.pyc index 9bc322a5e947bf9b0b4813168d88e9aaad541b93..cd452ebaa346be6da72477b8e1599360359735da 100644 Binary files a/models/week0417/__pycache__/model.cpython-38.pyc and b/models/week0417/__pycache__/model.cpython-38.pyc differ diff --git a/models/week0417/__pycache__/nnutils.cpython-38.pyc b/models/week0417/__pycache__/nnutils.cpython-38.pyc index 789841ac94321ed5e9130c388cedc5f3b2f41c47..ece91d7a8ed2f02d776503fc8a6acd716b167281 100644 Binary files a/models/week0417/__pycache__/nnutils.cpython-38.pyc and b/models/week0417/__pycache__/nnutils.cpython-38.pyc differ diff --git a/models/week0417/__pycache__/taming_blocks.cpython-38.pyc b/models/week0417/__pycache__/taming_blocks.cpython-38.pyc index 58764590e88f070da9f03c7565d9ed618ef9c398..089615e8e2cbe61b84503cc08f9f0a8582f4fc28 100644 Binary files a/models/week0417/__pycache__/taming_blocks.cpython-38.pyc and b/models/week0417/__pycache__/taming_blocks.cpython-38.pyc differ diff --git a/models/week0417/meanshift_utils.py b/models/week0417/meanshift_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..8d7d131565d770429215cbf02e2ff14be5c98947 --- /dev/null +++ b/models/week0417/meanshift_utils.py @@ -0,0 +1,62 @@ +import torch +import numpy as np + +def pairwise_distances(x, y): + #Input: x is a Nxd matrix + # y is an optional Mxd matirx + #Output: dist is a NxM matrix where dist[i,j] is the square norm between x[i,:] and y[j,:] + # if y is not given then use 'y=x'. + #i.e. dist[i,j] = ||x[i,:]-y[j,:]||^2 + x_norm = (x ** 2).sum(1).view(-1, 1) + y_t = torch.transpose(y, 0, 1) + y_norm = (y ** 2).sum(1).view(1, -1) + dist = x_norm + y_norm - 2.0 * torch.mm(x, y_t) + return torch.clamp(dist, 0.0, np.inf) + +def meanshift_cluster(pts, bandwidth, weights = None, meanshift_step = 15, step_size = 0.3): + """ + meanshift written in pytorch + :param pts: input points + :param weights: weight per point during clustering + :return: clustered points + """ + pts_steps = [] + for i in range(meanshift_step): + Y = pairwise_distances(pts, pts) + K = torch.nn.functional.relu(bandwidth ** 2 - Y) + if weights is not None: + K = K * weights + P = torch.nn.functional.normalize(K, p=1, dim=0, eps=1e-10) + P = P.transpose(0, 1) + pts = step_size * (torch.matmul(P, pts) - pts) + pts + pts_steps.append(pts) + return pts_steps + +def distance(a,b): + return torch.sqrt(((a-b)**2).sum()) + +def meanshift_assign(points, bandwidth): + cluster_ids = [] + cluster_idx = 0 + cluster_centers = [] + + for i, point in enumerate(points): + if(len(cluster_ids) == 0): + cluster_ids.append(cluster_idx) + cluster_centers.append(point) + cluster_idx += 1 + else: + # assign to nearest cluster + #for j,center in enumerate(cluster_centers): + # dist = distance(point, center) + # if(dist < bandwidth): + # cluster_ids.append(j) + cdist = torch.cdist(point.unsqueeze(0), torch.stack(cluster_centers), p = 2) + nearest_idx = torch.argmin(cdist, dim = 1) + if cdist[0, nearest_idx] < bandwidth: + cluster_ids.append(nearest_idx) + else: + cluster_ids.append(cluster_idx) + cluster_centers.append(point) + cluster_idx += 1 + return cluster_ids, cluster_centers diff --git a/models/week0417/model.py b/models/week0417/model.py index 23c2c8045979894495158fb5406cbfd240094c79..1d2cb81f1024b31e3213b4d4365ddaf0a63d2e51 100644 --- a/models/week0417/model.py +++ b/models/week0417/model.py @@ -7,21 +7,26 @@ import torchvision.transforms as transforms import torchvision.transforms.functional as TF from .taming_blocks import Encoder +from .loss import styleLossMaskv3 from .nnutils import SPADEResnetBlock, get_edges, initWave from libs.nnutils import poolfeat, upfeat from libs.utils import label2one_hot_torch +from .meanshift_utils import meanshift_cluster, meanshift_assign from swapae.models.networks.stylegan2_layers import ConvLayer from torch_geometric.nn import GCNConv from torch_geometric.utils import softmax -from .loss import styleLossMaskv3 + +import sys +sys.path.append('models/third_party/cython') +from connectivity import enforce_connectivity class GCN(nn.Module): - def __init__(self, n_cluster, temperature = 1, add_self_loops = True, hidden_dim = 256): + def __init__(self, n_cluster, temperature = 1, hidden_dim = 256): super().__init__() - self.gcnconv1 = GCNConv(hidden_dim, hidden_dim, add_self_loops = add_self_loops) - self.gcnconv2 = GCNConv(hidden_dim, hidden_dim, add_self_loops = add_self_loops) + self.gcnconv1 = GCNConv(hidden_dim, hidden_dim, add_self_loops = True) + self.gcnconv2 = GCNConv(hidden_dim, hidden_dim, add_self_loops = True) self.pool1 = nn.Sequential(nn.Conv2d(hidden_dim, n_cluster, 3, 1, 1)) self.temperature = temperature @@ -65,10 +70,7 @@ class GCN(nn.Module): # compute texture code w.r.t grouping pool_feat = poolfeat(conv_feat, s_, avg = True) - # hard upsampling - #hard_s_ = label2one_hot_torch(torch.argmax(s_, dim = 1).unsqueeze(1), C = s_.shape[1]) feat = upfeat(pool_feat, s_) - #feat = upfeat(pool_feat, hard_s_) prop_code.append(feat) sp_assign.append(pred_mask) @@ -137,10 +139,7 @@ class AE(nn.Module): # encoder & decoder self.enc = Encoder(ch=64, out_ch=3, ch_mult=[1,2,4,8], num_res_blocks=1, attn_resolutions=[], in_channels=3, resolution=args.crop_size, z_channels=args.hidden_dim, double_z=False) - if args.dec_input_mode == 'sine_wave_noise': - self.G = SPADEGenerator(args.spatial_code_dim * 2, args.hidden_dim) - else: - self.G = SPADEGenerator(args.spatial_code_dim, args.hidden_dim) + self.G = SPADEGenerator(args.spatial_code_dim + 32, args.hidden_dim) self.add_module( "ToTexCode", @@ -150,40 +149,61 @@ class AE(nn.Module): ConvLayer(args.tex_code_dim, args.hidden_dim, kernel_size=1, activate=False, bias=False) ) ) - self.gcn = GCN(n_cluster = args.n_cluster, temperature = args.temperature, add_self_loops = (args.add_self_loops == 1), hidden_dim = args.hidden_dim) + self.gcn = GCN(n_cluster = args.n_cluster, temperature = args.temperature, hidden_dim = args.hidden_dim) self.add_gcn_epoch = args.add_gcn_epoch self.add_clustering_epoch = args.add_clustering_epoch self.add_texture_epoch = args.add_texture_epoch self.patch_size = args.patch_size + self.style_loss = styleLossMaskv3(device = args.device) self.sine_wave_dim = args.spatial_code_dim + self.noise_dim = 32 + self.spatial_code_dim = args.spatial_code_dim # inpainting network - self.learnedWN = Waver(args.hidden_dim, zPeriodic = args.spatial_code_dim) - self.dec_input_mode = args.dec_input_mode - self.style_loss = styleLossMaskv3(device = args.device) - - if args.sine_weight: - if args.dec_input_mode == 'sine_wave_noise': - self.add_module( - "ChannelWeight", - nn.Sequential( - ConvLayer(args.hidden_dim, args.hidden_dim//2, kernel_size=3, activate=True, bias=True, downsample=True), - ConvLayer(args.hidden_dim//2, args.hidden_dim//4, kernel_size=3, activate=True, bias=True, downsample=True), - ConvLayer(args.hidden_dim//4, args.spatial_code_dim*2, kernel_size=1, activate=False, bias=False, downsample=True))) - else: - self.add_module( - "ChannelWeight", - nn.Sequential( - ConvLayer(args.hidden_dim, args.hidden_dim//2, kernel_size=3, activate=True, bias=True, downsample=True), - ConvLayer(args.hidden_dim//2, args.hidden_dim//4, kernel_size=3, activate=True, bias=True, downsample=True), - ConvLayer(args.hidden_dim//4, args.spatial_code_dim, kernel_size=1, activate=False, bias=False, downsample=True))) - - def get_sine_wave(self, GL, offset_mode = 'random'): - img_size = GL.shape[-1] // 8 - GL = F.interpolate(GL, size = (img_size, img_size), mode = 'nearest') - xv, yv = np.meshgrid(np.arange(img_size), np.arange(img_size),indexing='ij') + if args.spatial_code_dim > 0: + self.learnedWN = Waver(args.hidden_dim, zPeriodic = args.spatial_code_dim) + + self.add_module( + "Amplitude", + nn.Sequential( + nn.Conv2d(args.hidden_dim, args.hidden_dim//2, 1, 1, 0), + nn.Conv2d(args.hidden_dim//2, args.hidden_dim//4, 1, 1, 0), + nn.Conv2d(args.hidden_dim//4, args.spatial_code_dim, 1, 1, 0) + ) + ) + + self.bandwidth = 3.0 + + def sample_patch_from_mask(self, mask, patch_num = 10, patch_size = 64): + """ + - Sample `patch_num` patches of size `patch_size*patch_size` w.r.t given mask + """ + nonzeros = torch.nonzero(mask.view(-1)).squeeze() + n = len(nonzeros) + xys = [] + imgH, imgW = mask.shape + half_patch = patch_size // 2 + iter_num = 0 + while len(xys) < patch_num: + id = (torch.ones(n)*1.0/n).multinomial(num_samples=1, replacement=False) + rx = nonzeros[id] // imgW + ry = nonzeros[id] % imgW + top = max(0, rx - half_patch) + bot = min(imgH, rx + half_patch) + left = max(0, ry - half_patch) + right = min(imgW, ry + half_patch) + patch_mask = mask[top:bot, left:right] + if torch.sum(patch_mask) / (patch_size ** 2) > 0.5 or iter_num > 20: + xys.append([top, bot, left, right]) + iter_num += 1 + return xys + + def get_sine_wave(self, GL, offset_mode = 'rec'): + imgH, imgW = GL.shape[-2]//8, GL.shape[-1] // 8 + GL = F.interpolate(GL, size = (imgH, imgW), mode = 'nearest') + xv, yv = np.meshgrid(np.arange(imgH), np.arange(imgW),indexing='ij') c = torch.FloatTensor(np.concatenate([xv[np.newaxis], yv[np.newaxis]], 0)[np.newaxis]) c = c.to(GL.device) # c: 1, 2, 28, 28 @@ -192,13 +212,170 @@ class AE(nn.Module): period = self.learnedWN(GL) # period: 1, 64, 28, 28 raw = period * c - if offset_mode == 'random': - offset = torch.zeros((GL.shape[0], self.sine_wave_dim, 1, 1)).to(GL.device).uniform_(-1, 1) * 6.28 - offset = offset.repeat(1, 1, img_size, img_size) - wave = torch.sin(raw[:, ::2] + raw[:, 1::2] + offset) - elif offset_mode == 'rec': - wave = torch.sin(raw[:, ::2] + raw[:, 1::2]) + + # random offset + roffset = torch.zeros((GL.shape[0], self.sine_wave_dim, 1, 1)).to(GL.device).uniform_(-1, 1) * 6.28 + roffset = roffset.repeat(1, 1, imgH, imgW) + rwave = torch.sin(raw[:, ::2] + raw[:, 1::2] + roffset) + + # zero offset + zwave = torch.sin(raw[:, ::2] + raw[:, 1::2]) + A = self.Amplitude(GL) + A = torch.sigmoid(A) + wave = torch.cat((zwave, rwave)) * A.repeat(2, 1, 1, 1) return wave + def syn_tex(self, tex_code, mask, imgH, imgW, offset_mode = 'rec', tex_idx = None): + # synthesize all textures + # spatial: B x 256 x 14 x 14 + # tex_code: B x N x 256 + B, N, _ = tex_code.shape + H = imgH // 8 + W = imgW // 8 + + # randomly sample a texture and synthesize it + # throw away small texture segments + areas = torch.sum(mask, dim=(2, 3)) + valid_idxs = torch.nonzero(areas[0] / (imgH * imgW) > 0.01).squeeze(-1) + if tex_idx is None or tex_idx >= tex_code.shape[1]: + tex_idx = valid_idxs[torch.multinomial(areas[0, valid_idxs], 1).squeeze()] + else: + sorted_list = torch.argsort(areas, dim = 1, descending = True) + tex_idx = sorted_list[0, tex_idx] + sampled_code = tex_code[:, tex_idx, :] + rec_tex = sampled_code.view(1, -1, 1, 1).repeat(1, 1, imgH, imgW) + + # Decoder: Spatial & Texture code -> Image + if self.noise_dim == 0: + dec_input = self.get_sine_wave(rec_tex, offset_mode) + elif self.spatial_code_dim == 0: + dec_input = torch.randn(rec_tex.shape[0], self.noise_dim, H, W).to(tex_code.device) + else: + sine_wave = self.get_sine_wave(rec_tex, offset_mode) + noise = torch.randn(sine_wave.shape[0], self.noise_dim, H, W).to(tex_code.device) + dec_input = torch.cat((sine_wave, noise), dim = 1) + + tex_syn = self.G(dec_input, rec_tex.repeat(dec_input.shape[0], 1, 1, 1)) + + return tex_syn, tex_idx + + def sample_tex_patches(self, tex_idx, rgb_img, rep_rec, mask, patch_num = 10): + patches = [] + masks = [] + patch_masks = [] + # sample patches from input image and reconstruction + for i in range(rgb_img.shape[0]): + # WARNING: : This only works for batch_size = 1 for now + maski = mask[i, tex_idx] + masks.append(maski.unsqueeze(0)) + xys = self.sample_patch_from_mask(maski, patch_num = patch_num, patch_size = self.patch_size) + # sample 10 patches from input image & reconstruction w.r.t group mask + for k in range(patch_num): + top, bot, left, right = xys[k] + patch_ = rgb_img[i, :, top:bot, left:right] + patch_mask_ = maski[top:bot, left:right] + + # In case the patch is on the boundary and smaller than patch_size + # We put the patch at some random place of a black image + h, w = patch_.shape[-2:] + x = 0; y = 0 + if h < self.patch_size: + x = np.random.randint(0, self.patch_size - h) + if w < self.patch_size: + y = np.random.randint(0, self.patch_size - w) + patch = torch.zeros(1, 3, self.patch_size, self.patch_size).to(patch_.device) + patch_mask = torch.zeros(1, 1, self.patch_size, self.patch_size).to(patch_.device) + patch[:, :, x:x+h, y:y+w] = patch_ + patch_mask[:, :, x:x+h, y:y+w] = patch_mask_ + patches.append(patch) + patch_masks.append(patch_mask) + patches = torch.cat(patches) + masks = torch.stack(masks) + patch_masks = torch.cat(patch_masks) + + # sample patches from synthesized texture + tex_patch_size = self.patch_size + rep_patches = [] + for k in range(patch_num): + i, j, h, w = transforms.RandomCrop.get_params(rep_rec, output_size=(tex_patch_size, tex_patch_size)) + rep_rec_patch = TF.crop(rep_rec, i, j, h, w) + rep_patches.append(rep_rec_patch) + rep_patches = torch.stack(rep_patches, dim = 1) + rep_patches = rep_patches.view(-1, 3, tex_patch_size, tex_patch_size) + return masks, patch_masks, patches, rep_patches + def forward(self, rgb_img, slic, epoch = 0, test_time = False, test = False, tex_idx = None): - return + #self.patch_size = np.random.randint(64, 160) + B, _, imgH, imgW = rgb_img.shape + outputs = {} + rec_feat_list = [] + seg_map = [torch.argmax(slic.cpu(), dim = 1)] + + # Encoder: img (B, 3, H, W) -> feature (B, C, imgH//8, imgW//8) + conv_feat, layer_feats = self.enc(rgb_img) + B, C, H, W = conv_feat.shape + + # Texture code for each superpixel + tex_code = self.ToTexCode(conv_feat) + + code = F.interpolate(tex_code, size = (imgH, imgW), mode = 'bilinear', align_corners = False) + pool_code = poolfeat(code, slic, avg = True) + + if epoch >= self.add_gcn_epoch: + prop_code, sp_assign, conv_feats = self.gcn(pool_code, slic, (self.add_clustering_epoch <= epoch)) + softmax = F.softmax(sp_assign * self.gcn.temperature, dim = 1) + rec_feat_list.append(prop_code) + seg_map = [torch.argmax(sp_assign.cpu(), dim = 1)] + else: + rec_code = upfeat(pool_code, slic) + rec_feat_list.append(rec_code) + softmax = slic + + # Texture synthesis + if epoch >= self.add_texture_epoch: + sp_feat = poolfeat(conv_feats, slic, avg = True).squeeze(0) + pts = meanshift_cluster(sp_feat, self.bandwidth, meanshift_step = 15)[-1] + with torch.no_grad(): + sp_assign, _ = meanshift_assign(pts, self.bandwidth) + sp_assign = torch.tensor(sp_assign).unsqueeze(-1).to(slic.device).float() + sp_assign = upfeat(sp_assign, slic) + seg = label2one_hot_torch(sp_assign, C = sp_assign.max().long() + 1) + seg_map = [torch.argmax(seg.cpu(), dim = 1)] + + # texture code for each connected group + tex_seg = poolfeat(conv_feats, seg, avg = True) + if test: + rep_rec, tex_idx = self.syn_tex(tex_seg, seg, 564, 564, tex_idx = tex_idx) + #rep_rec, tex_idx = self.syn_tex(tex_seg, seg, 1024, 1024, tex_idx = tex_idx) + else: + rep_rec, tex_idx = self.syn_tex(tex_seg, seg, imgH, imgW, tex_idx = tex_idx) + rep_rec = (rep_rec + 1) / 2.0 + rgb_img = (rgb_img + 1) / 2.0 + + # sample patches from input image, reconstruction & synthesized texture + # zero offset + zmasks, zpatch_masks, zpatches, zrep_patches = self.sample_tex_patches(tex_idx, rgb_img, rep_rec[:1], seg) + # random offset + rmasks, rpatch_masks, rpatches, rrep_patches = self.sample_tex_patches(tex_idx, rgb_img, rep_rec[1:], seg) + masks = torch.cat((zmasks, rmasks)) + patch_masks = torch.cat((zpatch_masks, rpatch_masks)) + patches = torch.cat((zpatches, rpatches)) + rep_patches = torch.cat((zrep_patches, rrep_patches)) + + # Gram matrix matching loss between: + # - patches from synthesized texture v.s. patches from input image + # - patches from reconstruction v.s. patches from input image + outputs['style_loss'] = self.style_loss.forward_patch_img(rep_patches, rgb_img.repeat(2, 1, 1, 1), masks) + + outputs['rep_rec'] = rep_rec + outputs['masks'] = masks + outputs['patches'] = patches.view(-1, 3, self.patch_size, self.patch_size) + outputs['patch_masks'] = patch_masks + outputs['rep_patches'] = rep_patches * patch_masks + patches * (1 - patch_masks) + + outputs['gt'] = rgb_img + bp_tex = rep_rec[:1, :, :imgH, :imgW] * masks[:1] + rgb_img * (1 - masks[:1]) + outputs['rec'] = bp_tex + + outputs['HA'] = torch.cat(seg_map) + return outputs diff --git a/models/week0417/model_bk.py b/models/week0417/model_bk.py new file mode 100644 index 0000000000000000000000000000000000000000..23c2c8045979894495158fb5406cbfd240094c79 --- /dev/null +++ b/models/week0417/model_bk.py @@ -0,0 +1,204 @@ +import numpy as np + +import torch +import torch.nn as nn +import torch.nn.functional as F +import torchvision.transforms as transforms +import torchvision.transforms.functional as TF + +from .taming_blocks import Encoder +from .nnutils import SPADEResnetBlock, get_edges, initWave + +from libs.nnutils import poolfeat, upfeat +from libs.utils import label2one_hot_torch + +from swapae.models.networks.stylegan2_layers import ConvLayer +from torch_geometric.nn import GCNConv +from torch_geometric.utils import softmax +from .loss import styleLossMaskv3 + +class GCN(nn.Module): + def __init__(self, n_cluster, temperature = 1, add_self_loops = True, hidden_dim = 256): + super().__init__() + self.gcnconv1 = GCNConv(hidden_dim, hidden_dim, add_self_loops = add_self_loops) + self.gcnconv2 = GCNConv(hidden_dim, hidden_dim, add_self_loops = add_self_loops) + self.pool1 = nn.Sequential(nn.Conv2d(hidden_dim, n_cluster, 3, 1, 1)) + self.temperature = temperature + + def compute_edge_score_softmax(self, raw_edge_score, edge_index, num_nodes): + return softmax(raw_edge_score, edge_index[1], num_nodes=num_nodes) + + def compute_edge_weight(self, node_feature, edge_index): + src_feat = torch.gather(node_feature, 0, edge_index[0].unsqueeze(1).repeat(1, node_feature.shape[1])) + tgt_feat = torch.gather(node_feature, 0, edge_index[1].unsqueeze(1).repeat(1, node_feature.shape[1])) + raw_edge_weight = nn.CosineSimilarity(dim=1, eps=1e-6)(src_feat, tgt_feat) + edge_weight = self.compute_edge_score_softmax(raw_edge_weight, edge_index, node_feature.shape[0]) + return raw_edge_weight.squeeze(), edge_weight.squeeze() + + def forward(self, sp_code, slic, clustering = False): + edges, aff = get_edges(torch.argmax(slic, dim = 1).unsqueeze(1), sp_code.shape[1]) + prop_code = [] + sp_assign = [] + edge_weights = [] + conv_feats = [] + for i in range(sp_code.shape[0]): + # compute edge weight + edge_index = edges[i] + raw_edge_weight, edge_weight = self.compute_edge_weight(sp_code[i], edge_index) + feat = self.gcnconv1(sp_code[i], edge_index, edge_weight = edge_weight) + raw_edge_weight, edge_weight = self.compute_edge_weight(feat, edge_index) + edge_weights.append(raw_edge_weight) + feat = F.leaky_relu(feat, 0.2) + feat = self.gcnconv2(feat, edge_index, edge_weight = edge_weight) + + # maybe clustering + conv_feat = upfeat(feat, slic[i:i+1]) + conv_feats.append(conv_feat) + if not clustering: + feat = conv_feat + pred_mask = slic[i:i+1] + else: + pred_mask = self.pool1(conv_feat) + # enforce pixels belong to the same superpixel to have same grouping label + pred_mask = upfeat(poolfeat(pred_mask, slic[i:i+1]), slic[i:i+1]) + s_ = F.softmax(pred_mask * self.temperature, dim = 1) + + # compute texture code w.r.t grouping + pool_feat = poolfeat(conv_feat, s_, avg = True) + # hard upsampling + #hard_s_ = label2one_hot_torch(torch.argmax(s_, dim = 1).unsqueeze(1), C = s_.shape[1]) + feat = upfeat(pool_feat, s_) + #feat = upfeat(pool_feat, hard_s_) + + prop_code.append(feat) + sp_assign.append(pred_mask) + prop_code = torch.cat(prop_code) + conv_feats = torch.cat(conv_feats) + return prop_code, torch.cat(sp_assign), conv_feats + +class SPADEGenerator(nn.Module): + def __init__(self, in_dim, hidden_dim): + super().__init__() + nf = hidden_dim // 16 + + self.head_0 = SPADEResnetBlock(in_dim, 16 * nf) + + self.G_middle_0 = SPADEResnetBlock(16 * nf, 16 * nf) + self.G_middle_1 = SPADEResnetBlock(16 * nf, 16 * nf) + + self.up_0 = SPADEResnetBlock(16 * nf, 8 * nf) + self.up_1 = SPADEResnetBlock(8 * nf, 4 * nf) + self.up_2 = SPADEResnetBlock(4 * nf, 2 * nf) + self.up_3 = SPADEResnetBlock(2 * nf, 1 * nf) + + final_nc = nf + + self.conv_img = nn.Conv2d(final_nc, 3, 3, padding=1) + + self.up = nn.Upsample(scale_factor=2) + + def forward(self, sine_wave, texon): + + x = self.head_0(sine_wave, texon) + + x = self.up(x) + x = self.G_middle_0(x, texon) + x = self.G_middle_1(x, texon) + + x = self.up(x) + x = self.up_0(x, texon) + x = self.up(x) + x = self.up_1(x, texon) + #x = self.up(x) + x = self.up_2(x, texon) + #x = self.up(x) + x = self.up_3(x, texon) + + x = self.conv_img(F.leaky_relu(x, 2e-1)) + return x + +class Waver(nn.Module): + def __init__(self, tex_code_dim, zPeriodic): + super(Waver, self).__init__() + K = tex_code_dim + layers = [nn.Conv2d(tex_code_dim, K, 1)] + layers += [nn.ReLU(True)] + layers += [nn.Conv2d(K, 2 * zPeriodic, 1)] + self.learnedWN = nn.Sequential(*layers) + self.waveNumbers = initWave(zPeriodic) + + def forward(self, GLZ=None): + return (self.waveNumbers.to(GLZ.device) + self.learnedWN(GLZ)) + +class AE(nn.Module): + def __init__(self, args, **ignore_kwargs): + super(AE, self).__init__() + + # encoder & decoder + self.enc = Encoder(ch=64, out_ch=3, ch_mult=[1,2,4,8], num_res_blocks=1, attn_resolutions=[], + in_channels=3, resolution=args.crop_size, z_channels=args.hidden_dim, double_z=False) + if args.dec_input_mode == 'sine_wave_noise': + self.G = SPADEGenerator(args.spatial_code_dim * 2, args.hidden_dim) + else: + self.G = SPADEGenerator(args.spatial_code_dim, args.hidden_dim) + + self.add_module( + "ToTexCode", + nn.Sequential( + ConvLayer(args.hidden_dim, args.hidden_dim, kernel_size=3, activate=True, bias=True), + ConvLayer(args.hidden_dim, args.tex_code_dim, kernel_size=3, activate=True, bias=True), + ConvLayer(args.tex_code_dim, args.hidden_dim, kernel_size=1, activate=False, bias=False) + ) + ) + self.gcn = GCN(n_cluster = args.n_cluster, temperature = args.temperature, add_self_loops = (args.add_self_loops == 1), hidden_dim = args.hidden_dim) + + self.add_gcn_epoch = args.add_gcn_epoch + self.add_clustering_epoch = args.add_clustering_epoch + self.add_texture_epoch = args.add_texture_epoch + + self.patch_size = args.patch_size + self.sine_wave_dim = args.spatial_code_dim + + # inpainting network + self.learnedWN = Waver(args.hidden_dim, zPeriodic = args.spatial_code_dim) + self.dec_input_mode = args.dec_input_mode + self.style_loss = styleLossMaskv3(device = args.device) + + if args.sine_weight: + if args.dec_input_mode == 'sine_wave_noise': + self.add_module( + "ChannelWeight", + nn.Sequential( + ConvLayer(args.hidden_dim, args.hidden_dim//2, kernel_size=3, activate=True, bias=True, downsample=True), + ConvLayer(args.hidden_dim//2, args.hidden_dim//4, kernel_size=3, activate=True, bias=True, downsample=True), + ConvLayer(args.hidden_dim//4, args.spatial_code_dim*2, kernel_size=1, activate=False, bias=False, downsample=True))) + else: + self.add_module( + "ChannelWeight", + nn.Sequential( + ConvLayer(args.hidden_dim, args.hidden_dim//2, kernel_size=3, activate=True, bias=True, downsample=True), + ConvLayer(args.hidden_dim//2, args.hidden_dim//4, kernel_size=3, activate=True, bias=True, downsample=True), + ConvLayer(args.hidden_dim//4, args.spatial_code_dim, kernel_size=1, activate=False, bias=False, downsample=True))) + + def get_sine_wave(self, GL, offset_mode = 'random'): + img_size = GL.shape[-1] // 8 + GL = F.interpolate(GL, size = (img_size, img_size), mode = 'nearest') + xv, yv = np.meshgrid(np.arange(img_size), np.arange(img_size),indexing='ij') + c = torch.FloatTensor(np.concatenate([xv[np.newaxis], yv[np.newaxis]], 0)[np.newaxis]) + c = c.to(GL.device) + # c: 1, 2, 28, 28 + c = c.repeat(GL.shape[0], self.sine_wave_dim, 1, 1) + # c: 1, 64, 28, 28 + period = self.learnedWN(GL) + # period: 1, 64, 28, 28 + raw = period * c + if offset_mode == 'random': + offset = torch.zeros((GL.shape[0], self.sine_wave_dim, 1, 1)).to(GL.device).uniform_(-1, 1) * 6.28 + offset = offset.repeat(1, 1, img_size, img_size) + wave = torch.sin(raw[:, ::2] + raw[:, 1::2] + offset) + elif offset_mode == 'rec': + wave = torch.sin(raw[:, ::2] + raw[:, 1::2]) + return wave + + def forward(self, rgb_img, slic, epoch = 0, test_time = False, test = False, tex_idx = None): + return diff --git a/swapae/models/__pycache__/__init__.cpython-38.pyc b/swapae/models/__pycache__/__init__.cpython-38.pyc index d42006bbc27b9832db384c377317d69d81d1c8c1..7d30740f836ae226da82fec297f08d974a30fa98 100644 Binary files a/swapae/models/__pycache__/__init__.cpython-38.pyc and b/swapae/models/__pycache__/__init__.cpython-38.pyc differ diff --git a/swapae/models/__pycache__/base_model.cpython-38.pyc b/swapae/models/__pycache__/base_model.cpython-38.pyc index a79152ebf5baa8401a0f76e509d13362564d185d..66392d6fe6b38215757d9ce2ef0ffa6789678495 100644 Binary files a/swapae/models/__pycache__/base_model.cpython-38.pyc and b/swapae/models/__pycache__/base_model.cpython-38.pyc differ diff --git a/swapae/models/networks/__pycache__/__init__.cpython-38.pyc b/swapae/models/networks/__pycache__/__init__.cpython-38.pyc index 80656d17832658ceba1c299dbb218f31ba0735ba..f5c2face2a64bcbf38899e7c987c577a2c7136c0 100644 Binary files a/swapae/models/networks/__pycache__/__init__.cpython-38.pyc and b/swapae/models/networks/__pycache__/__init__.cpython-38.pyc differ diff --git a/swapae/models/networks/__pycache__/base_network.cpython-38.pyc b/swapae/models/networks/__pycache__/base_network.cpython-38.pyc index 86233c12e140e3461fc0a1a990ad68e3f2a55d8d..a0a090cf81da1221bf144b4d36304448810b6ddd 100644 Binary files a/swapae/models/networks/__pycache__/base_network.cpython-38.pyc and b/swapae/models/networks/__pycache__/base_network.cpython-38.pyc differ diff --git a/swapae/models/networks/__pycache__/stylegan2_layers.cpython-38.pyc b/swapae/models/networks/__pycache__/stylegan2_layers.cpython-38.pyc index 14cbc5d19d7f5e1a9df9488dc31a946251d4e202..a8c969a35d3978262938745b4a8e759be2ead4c0 100644 Binary files a/swapae/models/networks/__pycache__/stylegan2_layers.cpython-38.pyc and b/swapae/models/networks/__pycache__/stylegan2_layers.cpython-38.pyc differ diff --git a/swapae/models/networks/stylegan2_op/__pycache__/__init__.cpython-38.pyc b/swapae/models/networks/stylegan2_op/__pycache__/__init__.cpython-38.pyc index 001600a789ba87ef982d44992bea3c98dd51f917..d206fcd71ec6e53b8c41ca0b7a63bb432871abd9 100644 Binary files a/swapae/models/networks/stylegan2_op/__pycache__/__init__.cpython-38.pyc and b/swapae/models/networks/stylegan2_op/__pycache__/__init__.cpython-38.pyc differ diff --git a/swapae/models/networks/stylegan2_op/__pycache__/fused_act.cpython-38.pyc b/swapae/models/networks/stylegan2_op/__pycache__/fused_act.cpython-38.pyc index 01c53826bc5010f5827b22861b5b7e9403e97e43..f87060644724838672077387c213d654cb49f7ac 100644 Binary files a/swapae/models/networks/stylegan2_op/__pycache__/fused_act.cpython-38.pyc and b/swapae/models/networks/stylegan2_op/__pycache__/fused_act.cpython-38.pyc differ diff --git a/swapae/models/networks/stylegan2_op/__pycache__/upfirdn2d.cpython-38.pyc b/swapae/models/networks/stylegan2_op/__pycache__/upfirdn2d.cpython-38.pyc index 3d3215772fc06eb063fcb00683b2fd59501f82c8..d97f78cd89540e004ed27d592a3df56ef6ef20ac 100644 Binary files a/swapae/models/networks/stylegan2_op/__pycache__/upfirdn2d.cpython-38.pyc and b/swapae/models/networks/stylegan2_op/__pycache__/upfirdn2d.cpython-38.pyc differ diff --git a/swapae/util/__pycache__/__init__.cpython-38.pyc b/swapae/util/__pycache__/__init__.cpython-38.pyc index c9290c56d1677c7d257a3a388d75d3aa2a4206f0..a6e7a1ce1584649c3e86df8f0564abc7778d3f7e 100644 Binary files a/swapae/util/__pycache__/__init__.cpython-38.pyc and b/swapae/util/__pycache__/__init__.cpython-38.pyc differ diff --git a/swapae/util/__pycache__/html.cpython-38.pyc b/swapae/util/__pycache__/html.cpython-38.pyc index ea5673ab38a593375e25771caf4f4e53462b9484..cc678790dac8a5bf0380ed17a13585a54b877c0f 100644 Binary files a/swapae/util/__pycache__/html.cpython-38.pyc and b/swapae/util/__pycache__/html.cpython-38.pyc differ diff --git a/swapae/util/__pycache__/iter_counter.cpython-38.pyc b/swapae/util/__pycache__/iter_counter.cpython-38.pyc index 4cfe6e7fe26b80ca215c2da8ee05a75d99b1ab18..2d57fbbf6dcf27a030a6495864a3da87a272687a 100644 Binary files a/swapae/util/__pycache__/iter_counter.cpython-38.pyc and b/swapae/util/__pycache__/iter_counter.cpython-38.pyc differ diff --git a/swapae/util/__pycache__/metric_tracker.cpython-38.pyc b/swapae/util/__pycache__/metric_tracker.cpython-38.pyc index 80b2690864ba1b687df161228df207cc351ef4f9..2fbb35145a621934b1105c463fe52582e870b2c3 100644 Binary files a/swapae/util/__pycache__/metric_tracker.cpython-38.pyc and b/swapae/util/__pycache__/metric_tracker.cpython-38.pyc differ diff --git a/swapae/util/__pycache__/util.cpython-38.pyc b/swapae/util/__pycache__/util.cpython-38.pyc index 673f2d854f4768a68fee99b566d43cfe5a030aa9..70067b199611190e372bb8ddedbf1229c18632c6 100644 Binary files a/swapae/util/__pycache__/util.cpython-38.pyc and b/swapae/util/__pycache__/util.cpython-38.pyc differ diff --git a/swapae/util/__pycache__/visualizer.cpython-38.pyc b/swapae/util/__pycache__/visualizer.cpython-38.pyc index f0da3027d01e7afdd43f7829fe2a1cc422469a5c..88da135b94effba2a850fed9d4a5555745694685 100644 Binary files a/swapae/util/__pycache__/visualizer.cpython-38.pyc and b/swapae/util/__pycache__/visualizer.cpython-38.pyc differ diff --git a/tmp/0.png b/tmp/0.png new file mode 100644 index 0000000000000000000000000000000000000000..02d102c248df7bb09e708a25059a9bcad30b44af Binary files /dev/null and b/tmp/0.png differ diff --git a/tmp/1.png b/tmp/1.png new file mode 100644 index 0000000000000000000000000000000000000000..7f62c878f1fb72a21d0963d29102526b6b6ea18a Binary files /dev/null and b/tmp/1.png differ diff --git a/tmp/2.png b/tmp/2.png new file mode 100644 index 0000000000000000000000000000000000000000..8067587a58b18ec94aa2a2e6cff360c9535d04f1 Binary files /dev/null and b/tmp/2.png differ diff --git a/tmp/3.png b/tmp/3.png new file mode 100644 index 0000000000000000000000000000000000000000..6d08607dd764fdafb4ff010c6d7c91f21f079d77 Binary files /dev/null and b/tmp/3.png differ diff --git a/tmp/4.png b/tmp/4.png new file mode 100644 index 0000000000000000000000000000000000000000..2f5f430b66cd7d67638b90d11a41b40382b5b204 Binary files /dev/null and b/tmp/4.png differ diff --git a/tmp/5.png b/tmp/5.png new file mode 100644 index 0000000000000000000000000000000000000000..b85bb3c584332188da3e61c16e39c4745e7c637e Binary files /dev/null and b/tmp/5.png differ diff --git a/tmp/6.png b/tmp/6.png new file mode 100644 index 0000000000000000000000000000000000000000..07542ad56494b400edb15729bd41fb45b79efe9f Binary files /dev/null and b/tmp/6.png differ diff --git a/tmp/7.png b/tmp/7.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ed3cdedf7ade687ce48a166a03f2e78e6244ff Binary files /dev/null and b/tmp/7.png differ diff --git a/tmp/8.png b/tmp/8.png new file mode 100644 index 0000000000000000000000000000000000000000..b647775e7a77f716e7f41340cf9a901086cd9448 Binary files /dev/null and b/tmp/8.png differ diff --git a/tmp/9.png b/tmp/9.png new file mode 100644 index 0000000000000000000000000000000000000000..9c54b9e23daa838a42f89a3b28ccb83c967d4d1e Binary files /dev/null and b/tmp/9.png differ diff --git a/tmp/tmp.png b/tmp/tmp.png new file mode 100644 index 0000000000000000000000000000000000000000..66349aac810a14dc66754ab01674a8b2a9a56241 Binary files /dev/null and b/tmp/tmp.png differ diff --git a/weights/108004/cpk.pth b/weights/108004/cpk.pth deleted file mode 100644 index 8cbd1572b768ed2231c2a8c59cbdc41a1e452c1b..0000000000000000000000000000000000000000 --- a/weights/108004/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:53aa94627709cf57bc8101a1692b3fef63ac64ec5cab08c714c335e18a91076b -size 186192007 diff --git a/weights/108004/exp_args.json b/weights/108004/exp_args.json deleted file mode 100644 index 9053905edf683cf3da5a2526889990f9555ca5c5..0000000000000000000000000000000000000000 --- a/weights/108004/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/108004.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/108004", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/108004", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/108073/cpk.pth b/weights/108073/cpk.pth deleted file mode 100644 index a019d7647a7a85117532c619c30d474fc971d2c6..0000000000000000000000000000000000000000 --- a/weights/108073/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82deafb20a9d564738b5db3ea4227d56c16fe3dcd6ba16350987ae1b14943234 -size 186192007 diff --git a/weights/108073/exp_args.json b/weights/108073/exp_args.json deleted file mode 100644 index 944e0b16b6c9837a17b9890c7baaff23bf1134be..0000000000000000000000000000000000000000 --- a/weights/108073/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/108073.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/108073", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/108073", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/108073/exp_args.txt b/weights/108073/exp_args.txt deleted file mode 100644 index 479e5712b532d784da3d62c4ac1b5bab896849d5..0000000000000000000000000000000000000000 --- a/weights/108073/exp_args.txt +++ /dev/null @@ -1,60 +0,0 @@ - add_clustering_epoch: 0 [default: 1000] - add_gcn_epoch: 0 [default: None] - add_self_loops: 1 - add_texture_epoch: 0 [default: 1000] - batch_size: 1 - beta: 0.999 - config_file: models/week0417/json/single_scale_grouping_ft.json [default: None] - crop_size: 224 - data_path: /home/xtli/DATA/BSR_processed/train_extend - dataset: dataset [default: None] - dec_input_mode: sine_wave_noise [default: None] - display_freq: 100 - exp_name: 04-18/108073 [default: None] - gumbel: 0 - hidden_dim: 256 [default: None] - img_path: None - l1_loss_wt: 1.0 - lambda_GAN: 1 [default: None] - lambda_L1: 1 [default: None] - lambda_style_loss: 1.0 [default: None] - local_rank: None - log_freq: 10 - lr: 5e-05 [default: 0.1] - lr_decay_freq: 3000 - maxIter: 1000 - model_name: model [default: None] - momentum: 0.5 - nChannel: 100 - nConv: 2 - n_cluster: 10 [default: None] - n_layers_D: 3 [default: None] - nepochs: 100 [default: None] - netE_nc_steepness: 2.0 - netE_num_downsampling_gl: 2 - netE_num_downsampling_sp: 4 - netE_scale_capacity: 1.0 -netG_num_base_resnet_layers: 2 - netG_resnet_ch: 256 - netG_scale_capacity: 1.0 - no_ganFeat_loss: False - num_D: 2 [default: None] - num_classes: 0 - out_dir: /home/xtli/WORKDIR/04-18/108073 [default: None] - patch_size: 40 - perceptual_loss_wt: 1.0 - pretrained_ae: /home/xtli/WORKDIR/07-16/transformer/cpk.pth - pretrained_path: /home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth [default: None] - project_name: test_time - save_freq: 1000 [default: 2000] - sine_weight: 1 [default: None] - sp_num: None - spatial_code_ch: 8 - spatial_code_dim: 32 [default: 256] - temperature: 23 [default: 1] - test_time: 0 - texture_code_ch: 256 - use_slic: True - use_wandb: False - work_dir: /home/xtli/WORKDIR - workers: 4 diff --git a/weights/12003/cpk.pth b/weights/12003/cpk.pth index 19491a20be6d55b77a2e505453afa90e22a6531e..089a18656dcec872cdfe9307afe745aa5a2572b8 100644 --- a/weights/12003/cpk.pth +++ b/weights/12003/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c61f11b2987362d958f9c93c7c20f99e06b586c022bc036b9aa78f3ba9ed16e -size 186192007 +oid sha256:ba07485f7ebeaec67b2ddeb9031d52d4bd48c7f404d6a1f9f58f7cac8abf76aa +size 184872190 diff --git a/weights/12074/cpk.pth b/weights/12074/cpk.pth index d35e2e49f144c35d49f9d46a7f3035be991f223e..11f9b2408e6865ae98ff92ed6a4ecd7474a7fd20 100644 --- a/weights/12074/cpk.pth +++ b/weights/12074/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b4fd534430ff3a2abecf57c1c27e8a71df97ba0e37ebac972a7198fae8db7f5 -size 186192007 +oid sha256:a252a6a95652071611df245f1c1d9e2e8af38baf14d76f2f5f8614ecd96e6fdd +size 184872190 diff --git a/weights/12074/exp_args.json b/weights/12074/exp_args.json deleted file mode 100644 index a10a11917f10480da76e5df6762e8329f7c8e2f8..0000000000000000000000000000000000000000 --- a/weights/12074/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/12074.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/12074", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/12074", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/12074/exp_args.txt b/weights/12074/exp_args.txt deleted file mode 100644 index c2220bb58b94e93cefa82927185d9b68218caaa3..0000000000000000000000000000000000000000 --- a/weights/12074/exp_args.txt +++ /dev/null @@ -1,60 +0,0 @@ - add_clustering_epoch: 0 [default: 1000] - add_gcn_epoch: 0 [default: None] - add_self_loops: 1 - add_texture_epoch: 0 [default: 1000] - batch_size: 1 - beta: 0.999 - config_file: models/week0417/json/single_scale_grouping_ft.json [default: None] - crop_size: 224 - data_path: /home/xtli/DATA/BSR_processed/train_extend - dataset: dataset [default: None] - dec_input_mode: sine_wave_noise [default: None] - display_freq: 100 - exp_name: 04-18/12074 [default: None] - gumbel: 0 - hidden_dim: 256 [default: None] - img_path: None - l1_loss_wt: 1.0 - lambda_GAN: 1 [default: None] - lambda_L1: 1 [default: None] - lambda_style_loss: 1.0 [default: None] - local_rank: None - log_freq: 10 - lr: 5e-05 [default: 0.1] - lr_decay_freq: 3000 - maxIter: 1000 - model_name: model [default: None] - momentum: 0.5 - nChannel: 100 - nConv: 2 - n_cluster: 10 [default: None] - n_layers_D: 3 [default: None] - nepochs: 100 [default: None] - netE_nc_steepness: 2.0 - netE_num_downsampling_gl: 2 - netE_num_downsampling_sp: 4 - netE_scale_capacity: 1.0 -netG_num_base_resnet_layers: 2 - netG_resnet_ch: 256 - netG_scale_capacity: 1.0 - no_ganFeat_loss: False - num_D: 2 [default: None] - num_classes: 0 - out_dir: /home/xtli/WORKDIR/04-18/12074 [default: None] - patch_size: 40 - perceptual_loss_wt: 1.0 - pretrained_ae: /home/xtli/WORKDIR/07-16/transformer/cpk.pth - pretrained_path: /home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth [default: None] - project_name: test_time - save_freq: 1000 [default: 2000] - sine_weight: 1 [default: None] - sp_num: None - spatial_code_ch: 8 - spatial_code_dim: 32 [default: 256] - temperature: 23 [default: 1] - test_time: 0 - texture_code_ch: 256 - use_slic: True - use_wandb: False - work_dir: /home/xtli/WORKDIR - workers: 4 diff --git a/weights/130014/cpk.pth b/weights/130014/cpk.pth index b30a04729f4587e54376bce08d807aacafd99729..56fb92042dd9228b8f009817e841587325bedc2a 100644 --- a/weights/130014/cpk.pth +++ b/weights/130014/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6488edf0db424637883553ac99539d408dc4ad30eb5383803c7c615360aa4cd7 -size 186192007 +oid sha256:579c81705750699704dc02df6fc9f2956df6231cda02d55f9308b063573e3dab +size 184872190 diff --git a/weights/130014/exp_args.json b/weights/130014/exp_args.json deleted file mode 100644 index 1e044c40a2c1f63e430322a0a5035e3389e9357d..0000000000000000000000000000000000000000 --- a/weights/130014/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/130014.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/130014", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/130014", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/130066/cpk.pth b/weights/130066/cpk.pth deleted file mode 100644 index bf17cec6da11a08f799f7ca8b06b34621d742214..0000000000000000000000000000000000000000 --- a/weights/130066/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33c3afa736a6c331988382d0d7fe15c9728b0891c3b149a9efadc2dee1ff62f6 -size 186192007 diff --git a/weights/130066/exp_args.json b/weights/130066/exp_args.json deleted file mode 100644 index 97929ea5e835c8588a80e03844878b9fac0c17f5..0000000000000000000000000000000000000000 --- a/weights/130066/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/130066.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/130066", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/130066", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/134008/cpk.pth b/weights/134008/cpk.pth deleted file mode 100644 index 43de31b1abca4aeda85c0a344639a04571ecbe45..0000000000000000000000000000000000000000 --- a/weights/134008/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b47346d82b2df88c6a7bb677f593808de14ea3c5087b9f63399e87b290e8422a -size 186192007 diff --git a/weights/134008/exp_args.json b/weights/134008/exp_args.json deleted file mode 100644 index ca7ae215328d3f9e36cfad99053259935b07928d..0000000000000000000000000000000000000000 --- a/weights/134008/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/134008.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/134008", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/134008", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/134052/cpk.pth b/weights/134052/cpk.pth index f4651ca3ac9c8fd76acf3e7bff7a82175f50eafd..c315e157335b228c5e5846a9e0d08d54743aef77 100644 --- a/weights/134052/cpk.pth +++ b/weights/134052/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a6db083361caad4307f772d2cf76508ea8e22815f98f4d66c42b129f901f46f -size 186192007 +oid sha256:9f46e371430ae6714331875b7b5e701114166fddddc97c532e6d86f21d9fc103 +size 184872190 diff --git a/weights/16068/cpk.pth b/weights/16068/cpk.pth deleted file mode 100644 index 7bc84a1563292a44b6e6cfa72b10f1e53819b1a4..0000000000000000000000000000000000000000 --- a/weights/16068/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e0121d4d596610e258235c955933e3fc76f7def8f29a214b5cbf03bab015e344 -size 186192007 diff --git a/weights/16068/exp_args.json b/weights/16068/exp_args.json deleted file mode 100644 index c3b571a5d3d50a51219572dd5feadedb0be75ba3..0000000000000000000000000000000000000000 --- a/weights/16068/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/16068.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/16068", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/16068", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/164074/cpk.pth b/weights/164074/cpk.pth index db2cd88362dfa57dd2e8472041fba8440fd550aa..048e23d489f310098880beb015045954b4057c1e 100644 --- a/weights/164074/cpk.pth +++ b/weights/164074/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41786bd1075e7840b03133342ec16f104e0f14e728754cfb2a5927737c946bcd -size 186192007 +oid sha256:1408069082a70f602fad27b4383174800c5706e2a7eddc00e16520a4381f2a6f +size 184872190 diff --git a/weights/164074/exp_args.json b/weights/164074/exp_args.json deleted file mode 100644 index 85d2db232247f6987fbf853c1af8f22d15367b64..0000000000000000000000000000000000000000 --- a/weights/164074/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/164074.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/164074", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/164074", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/169012/cpk.pth b/weights/169012/cpk.pth index 008342cd2c157285fbeb36031cbd153f6abf6326..99dea2780e2f5cd352049095e64277527e219bf8 100644 --- a/weights/169012/cpk.pth +++ b/weights/169012/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15cec08537e35e31c4a593ffd9bc6b7463244d554e573eb2ac00ab89bb1f432c -size 186192007 +oid sha256:08ec36764fe97bd5093b952140e828a0c983b6dbe2ff914db23651a31f426639 +size 184872190 diff --git a/weights/169012/exp_args.json b/weights/169012/exp_args.json deleted file mode 100644 index 75f2a1f3bada01e9b10ca17560e9207b9af5aae1..0000000000000000000000000000000000000000 --- a/weights/169012/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/169012.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/169012", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/169012", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/169012/exp_args.txt b/weights/169012/exp_args.txt deleted file mode 100644 index f28c0ab1b3299730ee74dbc7901731beac4890c7..0000000000000000000000000000000000000000 --- a/weights/169012/exp_args.txt +++ /dev/null @@ -1,60 +0,0 @@ - add_clustering_epoch: 0 [default: 1000] - add_gcn_epoch: 0 [default: None] - add_self_loops: 1 - add_texture_epoch: 0 [default: 1000] - batch_size: 1 - beta: 0.999 - config_file: models/week0417/json/single_scale_grouping_ft.json [default: None] - crop_size: 224 - data_path: /home/xtli/DATA/BSR_processed/train_extend - dataset: dataset [default: None] - dec_input_mode: sine_wave_noise [default: None] - display_freq: 100 - exp_name: 04-18/169012 [default: None] - gumbel: 0 - hidden_dim: 256 [default: None] - img_path: None - l1_loss_wt: 1.0 - lambda_GAN: 1 [default: None] - lambda_L1: 1 [default: None] - lambda_style_loss: 1.0 [default: None] - local_rank: None - log_freq: 10 - lr: 5e-05 [default: 0.1] - lr_decay_freq: 3000 - maxIter: 1000 - model_name: model [default: None] - momentum: 0.5 - nChannel: 100 - nConv: 2 - n_cluster: 10 [default: None] - n_layers_D: 3 [default: None] - nepochs: 100 [default: None] - netE_nc_steepness: 2.0 - netE_num_downsampling_gl: 2 - netE_num_downsampling_sp: 4 - netE_scale_capacity: 1.0 -netG_num_base_resnet_layers: 2 - netG_resnet_ch: 256 - netG_scale_capacity: 1.0 - no_ganFeat_loss: False - num_D: 2 [default: None] - num_classes: 0 - out_dir: /home/xtli/WORKDIR/04-18/169012 [default: None] - patch_size: 40 - perceptual_loss_wt: 1.0 - pretrained_ae: /home/xtli/WORKDIR/07-16/transformer/cpk.pth - pretrained_path: /home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth [default: None] - project_name: test_time - save_freq: 1000 [default: 2000] - sine_weight: 1 [default: None] - sp_num: None - spatial_code_ch: 8 - spatial_code_dim: 32 [default: 256] - temperature: 23 [default: 1] - test_time: 0 - texture_code_ch: 256 - use_slic: True - use_wandb: False - work_dir: /home/xtli/WORKDIR - workers: 4 diff --git a/weights/198023/cpk.pth b/weights/198023/cpk.pth index 33938d79bf53416757d278f58edb964ea76b3b22..0daa50642b06398a65f5b224090dab037623ddb9 100644 --- a/weights/198023/cpk.pth +++ b/weights/198023/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9ec878f0891c65a4059c47c0bb78289273719edccb284223277fcce0cc042bf8 -size 186192007 +oid sha256:d5470e93c4e034393595b7fbcbee5d22738032201965a1c1fb8c529a20e0608a +size 184872190 diff --git a/weights/198023/exp_args.json b/weights/198023/exp_args.json deleted file mode 100644 index 845941d9a329d6da2fdb8242a0272d7f00894495..0000000000000000000000000000000000000000 --- a/weights/198023/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/198023.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/198023", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/198023", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/198023/exp_args.txt b/weights/198023/exp_args.txt deleted file mode 100644 index 7893befd15dffa33776c227a8e220ad8f12f2d52..0000000000000000000000000000000000000000 --- a/weights/198023/exp_args.txt +++ /dev/null @@ -1,60 +0,0 @@ - add_clustering_epoch: 0 [default: 1000] - add_gcn_epoch: 0 [default: None] - add_self_loops: 1 - add_texture_epoch: 0 [default: 1000] - batch_size: 1 - beta: 0.999 - config_file: models/week0417/json/single_scale_grouping_ft.json [default: None] - crop_size: 224 - data_path: /home/xtli/DATA/BSR_processed/train_extend - dataset: dataset [default: None] - dec_input_mode: sine_wave_noise [default: None] - display_freq: 100 - exp_name: 04-18/198023 [default: None] - gumbel: 0 - hidden_dim: 256 [default: None] - img_path: None - l1_loss_wt: 1.0 - lambda_GAN: 1 [default: None] - lambda_L1: 1 [default: None] - lambda_style_loss: 1.0 [default: None] - local_rank: None - log_freq: 10 - lr: 5e-05 [default: 0.1] - lr_decay_freq: 3000 - maxIter: 1000 - model_name: model [default: None] - momentum: 0.5 - nChannel: 100 - nConv: 2 - n_cluster: 10 [default: None] - n_layers_D: 3 [default: None] - nepochs: 100 [default: None] - netE_nc_steepness: 2.0 - netE_num_downsampling_gl: 2 - netE_num_downsampling_sp: 4 - netE_scale_capacity: 1.0 -netG_num_base_resnet_layers: 2 - netG_resnet_ch: 256 - netG_scale_capacity: 1.0 - no_ganFeat_loss: False - num_D: 2 [default: None] - num_classes: 0 - out_dir: /home/xtli/WORKDIR/04-18/198023 [default: None] - patch_size: 128 [default: 40] - perceptual_loss_wt: 1.0 - pretrained_ae: /home/xtli/WORKDIR/07-16/transformer/cpk.pth - pretrained_path: /home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth [default: None] - project_name: test_time - save_freq: 1000 [default: 2000] - sine_weight: 1 [default: None] - sp_num: None - spatial_code_ch: 8 - spatial_code_dim: 32 [default: 256] - temperature: 23 [default: 1] - test_time: 0 - texture_code_ch: 256 - use_slic: True - use_wandb: False - work_dir: /home/xtli/WORKDIR - workers: 4 diff --git a/weights/208078/cpk.pth b/weights/208078/cpk.pth deleted file mode 100644 index 12cc6d2ffaadd84253c00a754053b2c1907216a7..0000000000000000000000000000000000000000 --- a/weights/208078/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1cc9f3433d2f56451a93b1cfa2abe1bb438a32d17df5445bb276d6447d35423 -size 186192007 diff --git a/weights/208078/exp_args.json b/weights/208078/exp_args.json deleted file mode 100644 index 6e1f5e03ec03b2842117f695ca50e0e097abafd1..0000000000000000000000000000000000000000 --- a/weights/208078/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/208078.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/208078", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/208078", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/226033/cpk.pth b/weights/226033/cpk.pth deleted file mode 100644 index 25789bfd8d4eee18075083e0c3e446769b6a7c52..0000000000000000000000000000000000000000 --- a/weights/226033/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c66898f56fce9b94523a14f5c5576cdf627cac5dbe7e73f38a3b66706d36a6d -size 186192007 diff --git a/weights/226033/exp_args.json b/weights/226033/exp_args.json deleted file mode 100644 index a9217c7a935f0d8a5a7ab643f7362b798e494511..0000000000000000000000000000000000000000 --- a/weights/226033/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/226033.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/226033", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/226033", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/25098/cpk.pth b/weights/25098/cpk.pth deleted file mode 100644 index 4faf8fb14b4bce4e8ce42dacd258cf384c456a80..0000000000000000000000000000000000000000 --- a/weights/25098/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:244031d415c96a17cf0117f416e4643f6960ce8640a2b7e27394f2401f72dc5d -size 186192007 diff --git a/weights/25098/exp_args.json b/weights/25098/exp_args.json deleted file mode 100644 index 2c211725a351cfd28172e474c101097614d8797c..0000000000000000000000000000000000000000 --- a/weights/25098/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/25098.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/25098", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/25098", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/25098/exp_args.txt b/weights/25098/exp_args.txt deleted file mode 100644 index db24fab3f57b3a461a98e9ddca6a3c0b6448f5d0..0000000000000000000000000000000000000000 --- a/weights/25098/exp_args.txt +++ /dev/null @@ -1,60 +0,0 @@ - add_clustering_epoch: 0 [default: 1000] - add_gcn_epoch: 0 [default: None] - add_self_loops: 1 - add_texture_epoch: 0 [default: 1000] - batch_size: 1 - beta: 0.999 - config_file: models/week0417/json/single_scale_grouping_ft.json [default: None] - crop_size: 224 - data_path: /home/xtli/DATA/BSR_processed/train_extend - dataset: dataset [default: None] - dec_input_mode: sine_wave_noise [default: None] - display_freq: 100 - exp_name: 04-18/25098 [default: None] - gumbel: 0 - hidden_dim: 256 [default: None] - img_path: None - l1_loss_wt: 1.0 - lambda_GAN: 1 [default: None] - lambda_L1: 1 [default: None] - lambda_style_loss: 1.0 [default: None] - local_rank: None - log_freq: 10 - lr: 5e-05 [default: 0.1] - lr_decay_freq: 3000 - maxIter: 1000 - model_name: model [default: None] - momentum: 0.5 - nChannel: 100 - nConv: 2 - n_cluster: 10 [default: None] - n_layers_D: 3 [default: None] - nepochs: 100 [default: None] - netE_nc_steepness: 2.0 - netE_num_downsampling_gl: 2 - netE_num_downsampling_sp: 4 - netE_scale_capacity: 1.0 -netG_num_base_resnet_layers: 2 - netG_resnet_ch: 256 - netG_scale_capacity: 1.0 - no_ganFeat_loss: False - num_D: 2 [default: None] - num_classes: 0 - out_dir: /home/xtli/WORKDIR/04-18/25098 [default: None] - patch_size: 40 - perceptual_loss_wt: 1.0 - pretrained_ae: /home/xtli/WORKDIR/07-16/transformer/cpk.pth - pretrained_path: /home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth [default: None] - project_name: test_time - save_freq: 1000 [default: 2000] - sine_weight: 1 [default: None] - sp_num: None - spatial_code_ch: 8 - spatial_code_dim: 32 [default: 256] - temperature: 23 [default: 1] - test_time: 0 - texture_code_ch: 256 - use_slic: True - use_wandb: False - work_dir: /home/xtli/WORKDIR - workers: 4 diff --git a/weights/277095/cpk.pth b/weights/277095/cpk.pth index bcd2352e6b2d6e73e3de624c403b1c2a09d702e9..5f9cc22064284b312b20bd5b52084325775109ae 100644 --- a/weights/277095/cpk.pth +++ b/weights/277095/cpk.pth @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec4034575069215b9011b225483e296f931556049356012c1eb6e506954b89ef -size 186192007 +oid sha256:9d8f2d08c18a026df492a0b6ed7cc9b31cb470de398b1465e705387159b32684 +size 184872190 diff --git a/weights/277095/exp_args.json b/weights/277095/exp_args.json deleted file mode 100644 index 5037db4d5f1044c98b26b4423c50754c79f0de4e..0000000000000000000000000000000000000000 --- a/weights/277095/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/277095.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/277095", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/277095", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/388006/cpk.pth b/weights/388006/cpk.pth deleted file mode 100644 index c98bf1c68a0f93ac28f54584080cfa2218a7f964..0000000000000000000000000000000000000000 --- a/weights/388006/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8433f28a79b308e372f2a48752acde5a317fded1c012acbc5b5e325045e4c458 -size 186192007 diff --git a/weights/388006/exp_args.json b/weights/388006/exp_args.json deleted file mode 100644 index 49138a917d498c05cb4242f57443bd063e334411..0000000000000000000000000000000000000000 --- a/weights/388006/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/388006.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/388006", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/388006", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/45077/cpk.pth b/weights/45077/cpk.pth deleted file mode 100644 index 6c232ab59895fa9368468551e92198ab080ffc0b..0000000000000000000000000000000000000000 --- a/weights/45077/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9146884b9689062a79db7efecd933ca340ffe451716da96a84223c0fbd1fcf97 -size 186192007 diff --git a/weights/45077/exp_args.json b/weights/45077/exp_args.json deleted file mode 100644 index 66ace58987a7dc253e1c0eb66da2052a0bcbbf44..0000000000000000000000000000000000000000 --- a/weights/45077/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/images/45077.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/45077", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/45077", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/78098/cpk.pth b/weights/78098/cpk.pth deleted file mode 100644 index 7a97388c35bd85dbd2e4ee16992c6f19057600a8..0000000000000000000000000000000000000000 --- a/weights/78098/cpk.pth +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:289fb378cf4dc8fa4ad0d815da0785ea8de15589b21810e2571f36d63d9d6ea1 -size 186192007 diff --git a/weights/78098/exp_args.json b/weights/78098/exp_args.json deleted file mode 100644 index 2b687133e0a908641f54915958fcc30ee3d3e273..0000000000000000000000000000000000000000 --- a/weights/78098/exp_args.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "data_path": "/home/xtli/DATA/BSR_processed/train", - "img_path": "data/test_images/78098.jpg", - "test_path": null, - "crop_size": 224, - "scale_size": null, - "batch_size": 1, - "workers": 4, - "pretrained_path": "/home/xtli/WORKDIR/04-15/single_scale_grouping_resume/cpk.pth", - "hidden_dim": 256, - "spatial_code_dim": 32, - "tex_code_dim": 256, - "exp_name": "04-18/78098", - "project_name": "ssn_transformer", - "nepochs": 20, - "lr": 5e-05, - "momentum": 0.5, - "beta": 0.999, - "lr_decay_freq": 3000, - "save_freq": 1000, - "save_freq_iter": 2000000000000, - "log_freq": 10, - "display_freq": 100, - "use_wandb": 0, - "work_dir": "/home/xtli/WORKDIR", - "out_dir": "/home/xtli/WORKDIR/04-18/78098", - "local_rank": 0, - "dataset": "dataset", - "config_file": "models/week0417/json/single_scale_grouping_ft.json", - "lambda_L1": 1, - "lambda_Perceptual": 1.0, - "lambda_PatchGAN": 1.0, - "lambda_GAN": 1, - "add_gan_epoch": 0, - "lambda_kld_loss": 1e-06, - "lambda_style_loss": 1.0, - "lambda_feat": 10.0, - "use_slic": true, - "patch_size": 64, - "netPatchD_scale_capacity": 4.0, - "netPatchD_max_nc": 384, - "netPatchD": "StyleGAN2", - "use_antialias": true, - "patch_use_aggregation": false, - "lambda_R1": 1.0, - "lambda_ffl_loss": 1.0, - "lambda_patch_R1": 1.0, - "R1_once_every": 16, - "add_self_loops": 1, - "test_time": false, - "sp_num": 196, - "label_path": "/home/xtli/DATA/BSR/BSDS500/data/groundTruth", - "model_name": "model", - "num_D": 2, - "n_layers_D": 3, - "n_cluster": 10, - "temperature": 23, - "add_gcn_epoch": 0, - "add_clustering_epoch": 0, - "add_texture_epoch": 0, - "dec_input_mode": "sine_wave_noise", - "sine_weight": true -} diff --git a/weights/corn/cpk.pth b/weights/corn/cpk.pth new file mode 100644 index 0000000000000000000000000000000000000000..d5243bb2e3da5ce3faa5cdac9fe57b18f0894a3f --- /dev/null +++ b/weights/corn/cpk.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:547f110a683209e91080037e3866170723a08e80326a2e0f0ec674d4544848ef +size 184872190