MCPcopy Create free account

hub / github.com/Janspiry/Palette-Image-to-Image-Diffusion-Models / functions

Functions188 in github.com/Janspiry/Palette-Image-to-Image-Diffusion-Models

↓ 12 callersMethodupdate
(self, key, value, n=1)
core/logger.py:159
↓ 8 callersMethod__init__
( self, in_channel=6, out_channel=3, inner_channel=32, norm_groups=32,
models/sr3_modules/unet.py:7
↓ 8 callersFunctionextract
(a, t, x_shape=(1,1,1,1))
models/network.py:136
↓ 8 callersMethodrestoration
(self, y_cond, y_t=None, y_0=None, mask=None, sample_num=8)
models/network.py:88
↓ 7 callersFunctionbbox2mask
Generate mask in ndarray from bbox. The returned mask has the shape of (h, w, 1). '1' indicates the hole and '0' indicates the valid regio
data/util/mask.py:100
↓ 6 callersMethod__init__
( self, image_size, in_channel, inner_channel, out_channel, re
models/guided_diffusion_modules/unet.py:345
↓ 5 callersFunctioninit_obj
finds a function handle with the name given as 'name' in config, and returns the instance initialized with corresponding args.
core/praser.py:10
↓ 5 callersFunctiontransform_matrix_offset_center
(matrix, x, y)
data/util/auto_augment.py:105
↓ 4 callersFunctionnormalization
Make a standard normalization layer. :param channels: number of input channels. :return: an nn.Module for normalization.
models/guided_diffusion_modules/nn.py:41
↓ 4 callersMethodreset
(self)
core/logger.py:155
↓ 4 callersMethodresult
(self)
core/logger.py:167
↓ 3 callersFunctiondefault
(val, d)
models/network.py:131
↓ 3 callersMethodget_current_visuals
(self, phase='train')
models/model.py:68
↓ 3 callersFunctionmake_dataset
(dir)
data/dataset.py:18
↓ 3 callersFunctionrandom_cropping_bbox
(img_shape=(256,256), mask_mode='onedirection')
data/util/mask.py:9
↓ 3 callersFunctionset_gpu
set parameter to gpu or ddp
core/util.py:55
↓ 3 callersMethodset_input
must use set_device in tensor
models/model.py:59
↓ 3 callersMethodset_iter
(self, epoch, iter, phase='train')
core/logger.py:96
↓ 3 callersFunctionzero_module
Zero out the parameters of a module and return it.
models/guided_diffusion_modules/nn.py:16
↓ 2 callersFunction_warmup_beta
(linear_start, linear_end, n_timestep, warmup_frac)
models/network.py:142
↓ 2 callersFunctionapply_policy
(img, policy)
data/util/auto_augment.py:96
↓ 2 callersFunctionbrush_stroke_mask
Generate free-form mask. The method of generating free-form mask is in the following paper: Free-Form Image Inpainting with Gated Convolut
data/util/mask.py:126
↓ 2 callersFunctioncheckpoint
Evaluate a function without caching intermediate activations, allowing for reduced memory at the expense of extra compute in the backward pas
models/guided_diffusion_modules/nn.py:52
↓ 2 callersFunctioncount_flops_attn
A counter for the `thop` package to count the operations in an attention operation. Meant to be used like: macs, params = thop.pr
models/guided_diffusion_modules/nn.py:101
↓ 2 callersFunctionexists
(x)
models/sr3_modules/unet.py:244
↓ 2 callersMethodload_network
(self, network, network_label, strict=True)
core/base_model.py:108
↓ 2 callersFunctionmkdirs
(paths)
core/praser.py:53
↓ 2 callersFunctionrandom_bbox
Generate a random bbox for the mask on a given image. In our implementation, the max value cannot be obtained since we use `np.random.rand
data/util/mask.py:35
↓ 2 callersFunctionrandom_irregular_mask
Generate random irregular masks. This is a modified version of free-form mask implemented in 'brush_stroke_mask'. We prefer to use
data/util/mask.py:232
↓ 2 callersMethodsave_current_results
(self)
models/model.py:84
↓ 2 callersMethodsave_images
(self, results)
core/logger.py:101
↓ 2 callersMethodsave_network
save network structure, only work on GPU 0
core/base_model.py:95
↓ 2 callersMethodset_loss
(self, loss_fn)
models/network.py:19
↓ 2 callersMethodset_new_noise_schedule
(self, device=torch.device('cuda'), phase='train')
models/network.py:22
↓ 2 callersMethodtrain
(self)
core/base_model.py:38
↓ 1 callersMethod__getattr__
(self, name)
core/logger.py:23
↓ 1 callersMethod__init__
(self, beta=0.9999)
models/model.py:7
↓ 1 callersFunctionauto_contrast
(img, magnitude)
data/util/auto_augment.py:204
↓ 1 callersMethodbackward
(ctx, *output_grads)
models/guided_diffusion_modules/nn.py:81
↓ 1 callersFunctionbrightness
(img, magnitude)
data/util/auto_augment.py:243
↓ 1 callersMethodclose
(self)
core/logger.py:116
↓ 1 callersFunctioncolor
(img, magnitude)
data/util/auto_augment.py:237
↓ 1 callersFunctioncontrast
(img, magnitude)
data/util/auto_augment.py:231
↓ 1 callersFunctionconvert_abl
convert AB and L to RGB
preprocess/mirflickr25k_preprocess.py:6
↓ 1 callersFunctioncreate_model
create_model
models/__init__.py:3
↓ 1 callersFunctioncutout
(org_img, magnitude=None)
data/util/auto_augment.py:255
↓ 1 callersFunctiondefault
(val, d)
models/sr3_modules/unet.py:248
↓ 1 callersFunctiondefine_dataloader
create train/test dataloader and validation dataloader, validation dataloader is None when phase is test or not GPU 0
data/__init__.py:12
↓ 1 callersFunctiondefine_dataset
loading Dataset() class from given file's name
data/__init__.py:37
↓ 1 callersFunctiondefine_loss
(logger, loss_opt)
models/__init__.py:24
↓ 1 callersFunctiondefine_metric
(logger, metric_opt)
models/__init__.py:27
↓ 1 callersFunctiondefine_network
define network with weights initialization
models/__init__.py:14
↓ 1 callersFunctiondict_to_nonedict
convert to NoneDict, which return None for missing key.
core/praser.py:73
↓ 1 callersFunctionequalize
(img, magnitude)
data/util/auto_augment.py:214
↓ 1 callersFunctionexists
(x)
models/network.py:128
↓ 1 callersFunctiongamma_embedding
Create sinusoidal timestep embeddings. :param gammas: a 1-D Tensor of N indices, one per batch element. These may be fr
models/guided_diffusion_modules/nn.py:121
↓ 1 callersFunctionget_irregular_mask
Get irregular mask with the constraints in mask ratio Args: img_shape (tuple[int]): Size of the image. area_ratio_range (tupl
data/util/mask.py:319
↓ 1 callersMethodget_mask
(self)
data/dataset.py:70
↓ 1 callersMethodget_mask
(self)
data/dataset.py:127
↓ 1 callersFunctionget_pred
(x)
models/metric.py:47
↓ 1 callersFunctionget_timestamp
()
core/praser.py:60
↓ 1 callersFunctioninception_score
Computes the inception score of the generated images imgs imgs -- Torch dataset of (3xHxW) numpy images normalized in the range [-1, 1] cuda
models/metric.py:19
↓ 1 callersMethodinit_weights
initialize network's weights init_type: normal | xavier | kaiming | orthogonal https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/bl
core/base_network.py:8
↓ 1 callersFunctioninvert
(img, magnitude)
data/util/auto_augment.py:209
↓ 1 callersFunctionis_image_file
(filename)
core/base_dataset.py:12
↓ 1 callersFunctionis_image_file
(filename)
data/dataset.py:15
↓ 1 callersFunctionload_data
(home)
preprocess/mirflickr25k_preprocess.py:24
↓ 1 callersMethodload_networks
save pretrained model and training state, which only do on GPU 0.
models/model.py:202
↓ 1 callersFunctionmain_worker
threads running on each GPU
run.py:13
↓ 1 callersFunctionmake_beta_schedule
(schedule, n_timestep, linear_start=1e-6, linear_end=1e-2, cosine_s=8e-3)
models/network.py:149
↓ 1 callersFunctionmake_dataset
(dir)
core/base_dataset.py:15
↓ 1 callersMethodp_mean_variance
(self, y_t, t, clip_denoised: bool, y_cond=None)
models/network.py:61
↓ 1 callersMethodp_sample
(self, y_t, t, clip_denoised=True, y_cond=None)
models/network.py:81
↓ 1 callersFunctionposterize
(img, magnitude)
data/util/auto_augment.py:225
↓ 1 callersMethodpredict_start_from_noise
(self, y_t, t, noise)
models/network.py:47
↓ 1 callersMethodq_posterior
(self, y_0_hat, y_t, t)
models/network.py:53
↓ 1 callersMethodq_sample
(self, y_0, sample_gammas, noise=None)
models/network.py:73
↓ 1 callersMethodresume_training
resume the optimizers and schedulers for training, only work when phase is test or resume training enable
core/base_model.py:138
↓ 1 callersFunctionrotate
(img, magnitude)
data/util/auto_augment.py:186
↓ 1 callersMethodsave_everything
(self)
core/base_model.py:170
↓ 1 callersMethodsave_training_state
saves training state during training, only work on GPU 0
core/base_model.py:124
↓ 1 callersMethodsetup_logger
set up logger
core/logger.py:35
↓ 1 callersFunctionsharpness
(img, magnitude)
data/util/auto_augment.py:249
↓ 1 callersFunctionshear_x
(img, magnitude)
data/util/auto_augment.py:114
↓ 1 callersFunctionshear_y
(img, magnitude)
data/util/auto_augment.py:132
↓ 1 callersFunctionsolarize
(img, magnitude)
data/util/auto_augment.py:219
↓ 1 callersFunctionsubset_split
split a dataset into non-overlapping new datasets of given lengths. main code is from random_split function in pytorch
data/__init__.py:70
↓ 1 callersFunctiontensor2img
Converts a torch Tensor into an image Numpy array Input: 4D(B,(3/1),H,W), 3D(C,H,W), or 2D(H,W), any range, RGB channel order Output: 3D(
core/util.py:9
↓ 1 callersMethodtest
(self)
models/model.py:164
↓ 1 callersMethodtrain_step
(self)
core/base_model.py:73
↓ 1 callersFunctiontranslate_x
(img, magnitude)
data/util/auto_augment.py:150
↓ 1 callersFunctiontranslate_y
(img, magnitude)
data/util/auto_augment.py:168
↓ 1 callersMethodupdate_average
(self, old, new)
models/model.py:14
↓ 1 callersMethodupdate_model_average
(self, ma_model, current_model)
models/model.py:10
↓ 1 callersMethodval_step
(self)
core/base_model.py:77
↓ 1 callersFunctionwrite_json
(content, fname)
core/praser.py:64
Method__call__
(self, img)
data/util/auto_augment.py:37
Method__call__
(self, img)
data/util/auto_augment.py:72
Method__call__
(self, img)
data/util/auto_augment.py:288
Method__getattr__
If visualization is configured to use: return add_data() methods of tensorboard with additional information (step, tag) added.
core/logger.py:121
next →1–100 of 188, ranked by callers