MCPcopy Create free account

hub / github.com/NVlabs/imaginaire / functions

Functions1,077 in github.com/NVlabs/imaginaire

↓ 3 callersMethod__init__
(self, enc_cfg, data_cfg)
imaginaire/generators/pix2pixHD.py:284
↓ 3 callersMethod__init__
(self, num_upsamples, num_res_blocks, num_filters,
imaginaire/generators/unit.py:263
↓ 3 callersMethod_add_dataset
r"""Adds an LMDB dataset to a list of datasets. Args: root (str): Path to LMDB or folder dataset. filenames: List of
imaginaire/datasets/base.py:264
↓ 3 callersMethod_addindent
(s_, numSpaces)
imaginaire/layers/conv.py:195
↓ 3 callersMethod_assign_criteria
r"""Assign training loss terms. Args: name (str): Loss name criterion (obj): Loss object. weight (float):
imaginaire/trainers/pix2pixHD.py:38
↓ 3 callersFunction_get_data_loader
r"""Return data loader . Args: cfg (obj): Global configuration file. dataset (obj): PyTorch dataset object. batch_size (i
imaginaire/utils/dataset.py:36
↓ 3 callersMethod_get_object
r"""Download object from bucket. Args: key (str): Key inside bucket.
imaginaire/datasets/object_store.py:65
↓ 3 callersMethod_get_transform
r"""Convert numpy to torch tensor. Args: normalize (bool): Normalize image i.e. (x - 0.5) * 2. Goes from [0, 1] -
imaginaire/datasets/base.py:248
↓ 3 callersFunction_lanczos_m
Lanczos algorithm computes symmetric m x m tridiagonal matrix T and matrix V with orthogonal rows constituting the basis of the Krylov su
imaginaire/evaluation/msid.py:139
↓ 3 callersFunction_polynomial_kernel
r"""Compute the polynomial kernel between X and Y
imaginaire/evaluation/kid.py:181
↓ 3 callersMethod_single_forward
(self, input_label, input_image, weights)
imaginaire/discriminators/gancraft.py:69
↓ 3 callersMethod_time_before_backward
r""" Record time before applying backward.
imaginaire/trainers/base.py:892
↓ 3 callersMethod_time_before_step
r""" Record time before updating the weights
imaginaire/trainers/base.py:900
↓ 3 callersFunctionapply_imagenet_normalization
r"""Normalize using ImageNet mean and std. Args: input (4D tensor NxCxHxW): The input images, assuming to be [-1, 1]. Returns:
imaginaire/utils/misc.py:254
↓ 3 callersFunctioncompute_nn
(input_features, k, num_splits=50)
imaginaire/evaluation/common.py:635
↓ 3 callersFunctioncreate_metadata
r"""Main function. Args: data_root (str): Location of dataset root. cfg (object): Loaded config object. paired (bool): Pa
imaginaire/utils/lmdb.py:132
↓ 3 callersMethoddiscrminate_image
r"""Discriminate individual images. Args: net_D (obj): Discriminator network. real_A (NxC1xHxW tensor): Input label m
imaginaire/discriminators/fs_vid2vid.py:152
↓ 3 callersMethodget_cond_dims
r"""Get the dimensions of conditional inputs. Args: num_downs (int) : How many downsamples at current layer. Returns:
imaginaire/generators/vid2vid.py:354
↓ 3 callersMethodget_cond_maps
r"""Get the conditional inputs. Args: label (4D tensor) : Input label tensor. embedder (obj) : Embedding network.
imaginaire/generators/vid2vid.py:372
↓ 3 callersMethodget_cond_maps
r"""Get the conditional inputs. Args: label (4D tensor) : Input label tensor. embedder (obj) : Embedding network.
imaginaire/generators/wc_vid2vid.py:340
↓ 3 callersMethodget_data_t
r"""Get data at current time frame given the sequence of data. Args: data (dict): Training data for current iteration.
imaginaire/trainers/vid2vid.py:684
↓ 3 callersFunctionget_image_size
(x)
imaginaire/utils/data.py:607
↓ 3 callersFunctionget_nested_attr
r"""Iteratively try to get the attribute from cfg. If not found, return default. Args: cfg (obj): Config file. attr_name (str
imaginaire/utils/misc.py:180
↓ 3 callersFunctionget_optimizer
r"""Return the scheduler object. Args: cfg_opt (obj): Config for the specific optimization module (gen/dis). net (obj): PyTorch n
imaginaire/utils/trainer.py:271
↓ 3 callersMethodget_target_tensor
r"""Return the target vector for the binary cross entropy loss computation. Args: dis_output (tensor): Discriminator outp
imaginaire/losses/gan.py:148
↓ 3 callersMethodgetitem_by_path
r"""Load data item stored for key = path. Args: path (str): Key into LMDB dataset. data_type (str): Key into self.ext
imaginaire/datasets/lmdb.py:38
↓ 3 callersFunctioninit_cudnn
r"""Initialize the cudnn module. The two things to consider is whether to use cudnn benchmark and whether to use cudnn deterministic. If cudnn
imaginaire/utils/cudnn.py:10
↓ 3 callersFunctioninit_dist
r"""Initialize distributed training
imaginaire/utils/distributed.py:12
↓ 3 callersFunctioninit_logging
r"""Create log directory for storing checkpoints and output images. Args: config_path (str): Path to the configuration file. logd
imaginaire/utils/logging.py:21
↓ 3 callersMethodnum_inference_sequences
r"""Number of sequences available for inference. Returns: (int)
imaginaire/datasets/paired_videos.py:59
↓ 3 callersFunctionpre_process_densepose
r"""Pre-process the DensePose part of input label map. Args: pose_cfg (obj): Pose data configuration. pose_map (NxCxHxW tensor):
imaginaire/model_utils/fs_vid2vid.py:780
↓ 3 callersMethodremove
(self, module)
imaginaire/layers/weight_norm.py:149
↓ 3 callersMethodsave_checkpoint
r"""Save network weights, optimizer parameters, scheduler parameters to a checkpoint.
imaginaire/trainers/base.py:236
↓ 3 callersFunctionset_affinity
r"""Set GPU affinity Args: gpu_id (int): Which gpu device.
imaginaire/utils/gpu_affinity.py:47
↓ 3 callersFunctionsetup_filter
r"""Convenience function to setup 2D FIR filter for `upfirdn2d()`. Args: f: Torch tensor, numpy array, or python list of the sh
imaginaire/third_party/upfirdn2d/upfirdn2d.py:143
↓ 3 callersMethodtest_single
r"""The inference function. If output_dir exists, also save the output image. Args: data (dict): Training data at the curr
imaginaire/trainers/vid2vid.py:366
↓ 2 callersMethod__init__
(self)
imaginaire/layers/misc.py:12
↓ 2 callersMethod__init__
(self, gen_cfg, data_cfg)
imaginaire/generators/vid2vid.py:47
↓ 2 callersMethod__init__
(self, gen_cfg, data_cfg)
imaginaire/generators/spade.py:30
↓ 2 callersMethod__init__
( self, feature_scale=4, n_classes=19, is_deconv=True,
imaginaire/evaluation/segmentation/celebamask_hq.py:12
↓ 2 callersMethod__init__
(self, kernel=(1, 3, 3, 1), pad=0, padding_mode='zeros')
imaginaire/third_party/upfirdn2d/upfirdn2d.py:117
↓ 2 callersFunction_calculate_frechet_distance
(act_1, act_2, eps=1e-6)
imaginaire/evaluation/fid.py:113
↓ 2 callersFunction_calculate_model_size
r"""Calculate number of parameters in a PyTorch network. Args: model (obj): PyTorch network. Returns: (int): Number of param
imaginaire/utils/trainer.py:173
↓ 2 callersMethod_compute_fid
r"""Compute FID values.
imaginaire/trainers/vid2vid.py:749
↓ 2 callersMethod_compute_fid
r"""We will compute FID for the regular model using the eval mode. For the moving average model, we will use the eval mode.
imaginaire/trainers/spade.py:234
↓ 2 callersMethod_create_sequence_keys
r"""Create the LMDB key for this piece of information. Args: sequence_name (str): Which sequence from the chosen dataset.
imaginaire/datasets/paired_videos.py:205
↓ 2 callersMethod_detach_losses
r"""Detach all logging variables to prevent potential memory leak.
imaginaire/trainers/base.py:869
↓ 2 callersMethod_forward_global
r"""Forward the CNN Args: net_out (N x C5 x H x W tensor): Intermediate feature maps. z (N x C3 tensor): Intermediate
imaginaire/generators/gancraft_base.py:588
↓ 2 callersMethod_forward_perpix
r"""Sample points along rays, forwarding the per-point MLP and aggregate pixel features Args: blk_feats (K x C1 tensor): Sparse b
imaginaire/generators/gancraft_base.py:473
↓ 2 callersMethod_forward_single
(self, images)
imaginaire/evaluation/lpips.py:73
↓ 2 callersMethod_forward_single_direction
( self, features_a, features_b, gather_distributed)
imaginaire/losses/info_nce.py:75
↓ 2 callersMethod_init_single_image_model
r"""Load single image model, if any.
imaginaire/generators/wc_vid2vid.py:45
↓ 2 callersMethod_linear_f
(x, w, b)
imaginaire/model_utils/gancraft/layers.py:35
↓ 2 callersMethod_linear_f
(x, w, b)
imaginaire/model_utils/gancraft/layers.py:109
↓ 2 callersMethod_perform_paired_augmentation
r"""Perform same data augmentation on all inputs. Args: inputs (dict): Keys are from self.augmentable_data_types. Values are
imaginaire/utils/data.py:318
↓ 2 callersFunction_polynomial_mmd_averages
r"""Computes MMD between two sets of features using polynomial kernels. It performs a number of repetitions of subset sampling without replacement
imaginaire/evaluation/kid.py:137
↓ 2 callersMethod_prepare_data
r"""Load data and perform augmentation. Args: keys (dict): Key into LMDB/folder dataset for this item. Returns:
imaginaire/datasets/paired_few_shot_videos.py:205
↓ 2 callersMethod_resize_arrays
r"""Makes arrays bigger, if needed. Args: max_point_idx (int): Highest 3D point index seen so far.
imaginaire/model_utils/wc_vid2vid/render.py:38
↓ 2 callersMethod_single_forward
(self, input_label, input_image)
imaginaire/discriminators/spade.py:73
↓ 2 callersMethod_time_before_forward
r""" Record time before applying forward.
imaginaire/trainers/base.py:876
↓ 2 callersFunction_upfirdn2d_cuda
Fast CUDA implementation of `upfirdn2d()` using custom ops.
imaginaire/third_party/upfirdn2d/upfirdn2d.py:292
↓ 2 callersFunction_wrap_model
r"""Wrap a model for distributed data parallel training. Args: model (obj): PyTorch network model. Returns: (obj): Wrapped P
imaginaire/utils/trainer.py:198
↓ 2 callersMethodattention_encode
r"""Encode the input image to get the attention map. Args: img (NxCxHxW tensor): Input image. net_name (str): Name fo
imaginaire/generators/fs_vid2vid.py:957
↓ 2 callersFunctionbase_openpose_to_npy
r"""Convert OpenPose dicts to numpy arrays of keypoints. Args: inputs (list of dicts): List of OpenPose dicts. return_largest_onl
imaginaire/utils/visualization/pose.py:99
↓ 2 callersFunctionbuild_model
(state_dict: dict)
imaginaire/evaluation/caption/clip.py:529
↓ 2 callersMethodcompute_bias
(self, module)
imaginaire/layers/weight_norm.py:85
↓ 2 callersMethodcompute_flow_and_conf
(self, im1, im2)
imaginaire/third_party/flow_net/flow_net.py:53
↓ 2 callersMethodcompute_flow_loss
r"""Compute losses on the generated flow map. Args: flow (tensor): Generated flow map. warped_image (tensor): Warped
imaginaire/losses/flow.py:197
↓ 2 callersMethodcompute_mask_loss
r"""Compute losses on the generated occlusion mask. Args: occ_mask (tensor): Generated occlusion mask. warped_image (
imaginaire/losses/flow.py:287
↓ 2 callersMethodcompute_weight
(self, module)
imaginaire/layers/weight_norm.py:81
↓ 2 callersFunctionconnect_face_keypoints
r"""Connect the face keypoints to edges and draw the sketch. Args: resize_h (int): Height the input image was resized to. resize_
imaginaire/utils/visualization/face.py:14
↓ 2 callersMethoddis_update
r"""The update is already done in gen_update. Args: data (dict): Training data at the current iteration.
imaginaire/trainers/vid2vid.py:284
↓ 2 callersFunctiondist_all_reduce_tensor
r""" Reduce to all ranks
imaginaire/utils/distributed.py:92
↓ 2 callersFunctiondownload_file
r"""Download a file from google drive or pbss by using the url. Args: URL: GDrive URL or PBSS pre-signed URL for the checkpoint.
imaginaire/utils/io.py:61
↓ 2 callersMethodencode_image
(self, image)
imaginaire/evaluation/caption/clip.py:466
↓ 2 callersMethodforward
r"""Hyper Conv2d forward. Convolve x using the provided weight and bias. Args: x (N x C x H x W tensor): Input tensor.
imaginaire/layers/conv.py:840
↓ 2 callersFunctionfunc
r"""Quadratic fitting function.
imaginaire/utils/visualization/face.py:484
↓ 2 callersMethodgen_frames
r"""Generate a sequence of frames given a sequence of data. Args: data (dict): Training data at the current iteration.
imaginaire/trainers/wc_vid2vid.py:240
↓ 2 callersMethodgen_update
r"""Update the vid2vid generator. We update in the fashion of dis_update (frame 1), gen_update (frame 1), dis_update (frame 2), gen_up
imaginaire/trainers/vid2vid.py:233
↓ 2 callersFunctionget_activations
r"""Compute activation values and pack them in a list. Args: data_loader (obj): PyTorch dataloader object. key_real (str): Dictio
imaginaire/evaluation/common.py:252
↓ 2 callersMethodget_data_t
r"""Get data at current time frame given the sequence of data. Args: data (dict): Training data for current iteration.
imaginaire/trainers/wc_vid2vid.py:297
↓ 2 callersFunctionget_face_bbox_for_data
r"""Get the bbox coordinates for face region. Args: keypoints (Nx2 tensor): Facial landmarks. orig_img_size (int tuple): Height a
imaginaire/model_utils/fs_vid2vid.py:143
↓ 2 callersFunctionget_face_mask
r"""Obtain mask of faces. Args: densepose_map (3D or 4D tensor): DensePose map. Returns: mask (3D or 4D tensor): Face mask.
imaginaire/model_utils/fs_vid2vid.py:496
↓ 2 callersFunctionget_image_encoder
(aws_credentials=None)
imaginaire/evaluation/caption/common.py:18
↓ 2 callersFunctionget_lpips_model
()
imaginaire/evaluation/lpips.py:15
↓ 2 callersFunctionget_mean_dists
r"""Get mean distances of the points from face center.
imaginaire/utils/visualization/face.py:227
↓ 2 callersFunctionget_mean_dists
r"""Get the mean xy distances of keypoints wrt face center.
imaginaire/model_utils/fs_vid2vid.py:599
↓ 2 callersMethodget_op
r"""Get function to apply for specific op. Args: op (str): Name of the op. Returns: function handle.
imaginaire/datasets/base.py:457
↓ 2 callersFunctionget_optimizer_for_params
r"""Return the scheduler object. Args: cfg_opt (obj): Config for the specific optimization module (gen/dis). params (obj): Parame
imaginaire/utils/trainer.py:290
↓ 2 callersFunctionget_outputs
r"""Compute activation values and pack them in a list. Args: data_loader (obj): PyTorch dataloader object. key_real (str): Dictio
imaginaire/evaluation/common.py:358
↓ 2 callersFunctionget_part_mask
r"""Obtain mask of different body parts of humans. This is done by looking at the body part map from DensePose. Args: densepose_map (
imaginaire/model_utils/fs_vid2vid.py:461
↓ 2 callersFunctionget_person_bbox_for_data
r"""Get the bbox (pixel coordinates) to crop for person body region. Args: pose_map (NxCxHxW tensor): Input pose map. orig_img_si
imaginaire/model_utils/fs_vid2vid.py:276
↓ 2 callersFunctionget_scheduler
Return the scheduler object. Args: cfg_opt (obj): Config for the specific optimization module (gen/dis). opt (obj): PyTorch optim
imaginaire/utils/trainer.py:232
↓ 2 callersFunctionget_segmentation_hist_model
(dataset_name, aws_credentials=None)
imaginaire/evaluation/segmentation/common.py:16
↓ 2 callersFunctionget_train_and_val_dataloader
r"""Return dataset objects for the training and validation sets. Args: cfg (obj): Global configuration file. Returns: (dict)
imaginaire/utils/dataset.py:69
↓ 2 callersFunctionget_weight_norm_layer
r"""Return weight normalization. Args: norm_type (str): Type of weight normalization. ``'none'``, ``'spectral'``,
imaginaire/layers/weight_norm.py:230
↓ 2 callersMethodinference
r"""UNIT inference. Args: data (dict): Training data at the current iteration. - images_a (tensor): Images from dom
imaginaire/generators/unit.py:62
↓ 2 callersMethodinit_network_weights
r"""Initialize weights in net_dst with those in net_src.
imaginaire/generators/fs_vid2vid.py:269
↓ 2 callersFunctioninterp_points
r"""Given the start and end points, interpolate to get a curve/line. Args: x (1D array): x coordinates of the points to interpolate.
imaginaire/utils/visualization/face.py:445
↓ 2 callersMethodloss
r"""N+1 label GAN loss computation. Args: input_x (tensor): Output values. t_real (boolean): Is this output value for
imaginaire/model_utils/gancraft/loss.py:52
← previousnext →101–200 of 1,077, ranked by callers