MCPcopy Create free account

hub / github.com/00why00/JoDiffusion / functions

Functions117 in github.com/00why00/JoDiffusion

↓ 7 callersFunctionpoint_sample
A wrapper around :function:`torch.nn.functional.grid_sample` to support 3D point_coords tensors. Unlike :function:`torch.nn.functional.grid_s
utils/utils.py:61
↓ 5 callersMethodcheck_latents_shape
(latents_name, latents, expected_shape)
pipelines/pipeline_jodiffusion.py:542
↓ 5 callersMethodupdate
(self, pred, gt)
validate/miou_evaluation.py:15
↓ 3 callersMethod_combine
r""" Combines a latent iamge img_vae of shape (B, C, H, W) and a CLIP-embedded image img_clip of shape (B, 1, clip_img_dim) into a sin
pipelines/pipeline_jodiffusion.py:423
↓ 3 callersMethod_combine_joint
r""" Combines a latent image img_vae of shape (B, C, H, W), a CLIP-embedded image img_clip of shape (B, L_img, clip_img_dim), and a te
pipelines/pipeline_jodiffusion.py:455
↓ 3 callersMethod_split_joint
r""" Splits a flattened embedding x of shape (B, C * H * W + clip_img_dim + clip_img_dim] into (img_vae, img_clip, label_clip) where i
pipelines/pipeline_jodiffusion.py:433
↓ 3 callersFunctionbitget
(byteval, idx)
utils/utils.py:87
↓ 3 callersMethoddecode
(self, z: torch.Tensor, interpolate=True, return_dict: bool = True)
pipelines/modeling_lightweight_vae.py:195
↓ 3 callersMethodencode
( self, x: torch.Tensor, return_dict: bool = True )
pipelines/modeling_lightweight_vae.py:183
↓ 3 callersFunctionencode_seg
(semseg, cmap=None)
utils/utils.py:106
↓ 2 callersMethod_get_src_permutation_idx
(self, indices)
pipelines/loss_segmentation.py:91
↓ 2 callersMethod_split
r""" Splits a flattened embedding x of shape (B, C * H * W + clip_img_dim) into two tensors of shape (B, C, H, W) and (B, 1, clip_img_
pipelines/pipeline_jodiffusion.py:404
↓ 2 callersFunctioncolor_map
(n: int = 256, normalized: bool = False)
utils/utils.py:86
↓ 2 callersFunctiongenerate_aug_list
(merged_list, excluded_list)
utils/prepare_voc_aug.py:19
↓ 2 callersFunctionget_uncertain_point_coords_with_randomness
Sample points in [0, 1] x [0, 1] coordinate space based on their uncertainty. The unceratinties are calculated for each point using 'unce
utils/utils.py:6
↓ 2 callersFunctionlog_validation
(vae, val_dataloader, dataset_cls, args, accelerator, global_step, is_final_validation=False)
train_ae.py:33
↓ 2 callersFunctionlog_validation
(unet, args, accelerator, weight_dtype, epoch, is_final_validation=False)
train_ldm.py:41
↓ 2 callersMethodprepare_targets
Function to convert targets to the format expected by the loss Args: targets: list[Dict] ignore_label: int
pipelines/loss_segmentation.py:377
↓ 2 callersMethodreturn_score
(self, verbose=True, name='dataset', suppress_prints=False)
validate/miou_evaluation.py:30
↓ 2 callersFunctionunwrap_model
(model)
train_ae.py:527
↓ 2 callersFunctionunwrap_model
(model)
train_ldm.py:705
↓ 1 callersMethod__init__
(self, num_channels: int, eps: float = 1e-6)
pipelines/modeling_lightweight_vae.py:228
↓ 1 callersMethod_get_noise_pred
r""" Gets the noise prediction using the `unet` and performs classifier-free guidance, if necessary.
pipelines/pipeline_jodiffusion.py:467
↓ 1 callersMethodcalculate_uncertainty
Calculates the uncertainty when using sigmoid loss. Defined according to PointRend: https://arxiv.org/abs/1912.08193 Args:
pipelines/loss_segmentation.py:260
↓ 1 callersMethodcalculate_uncertainty_seg
Calculates the uncertainty when using a CE loss. Defined according to PointRend: https://arxiv.org/abs/1912.08193
pipelines/loss_segmentation.py:277
↓ 1 callersMethodcheck_inputs
( self, prompt, height, width, callback_steps, negative_prompt
pipelines/pipeline_jodiffusion.py:558
↓ 1 callersFunctionconvert_mat
(mat_file, in_dir, out_dir)
utils/prepare_voc_aug.py:12
↓ 1 callersMethoddefine_decoder
( self, out_channels: int, intermediate_channels: int, norm_num_groups: int,
pipelines/modeling_lightweight_vae.py:135
↓ 1 callersMethoddefine_encoder
( self, in_channels: int, block_out_channels: Tuple[int], intermediate_channel
pipelines/modeling_lightweight_vae.py:76
↓ 1 callersMethoddice_loss
Compute the DICE loss, similar to generalized IOU for masks Args: inputs: A float tensor of arbitrary shape.
pipelines/loss_segmentation.py:168
↓ 1 callersMethodencode_prompt
r""" Encodes the prompt into text encoder hidden states. Args: prompt (`str` or `List[str]`, *optional*):
pipelines/pipeline_jodiffusion.py:165
↓ 1 callersFunctiongenerate
(args, weight_dtype)
generate_dataset.py:29
↓ 1 callersMethodload_semantic
(self, semantic_path)
dataset/ade20k_semantic.py:77
↓ 1 callersMethodload_semantic
(self, image_name)
dataset/voc_semantic.py:72
↓ 1 callersMethodloss_ce
( self, outputs: torch.Tensor, targets: torch.Tensor, indices: Optional[torch.
pipelines/loss_segmentation.py:284
↓ 1 callersMethodloss_masks
Uncertainty loss for instance segmentation as used in Mask2Former: https://arxiv.org/abs/2112.01527 Only minor modifications (i.e., s
pipelines/loss_segmentation.py:104
↓ 1 callersFunctionmain
()
train_ae.py:342
↓ 1 callersFunctionmain
()
train_ldm.py:459
↓ 1 callersFunctionmain
()
utils/prepare_voc_aug.py:32
↓ 1 callersFunctionmake_train_dataset
(args, accelerator)
train_ae.py:282
↓ 1 callersFunctionmake_train_dataset
(args, accelerator)
train_ldm.py:379
↓ 1 callersMethodmatcher
Matcher comes from Mask2Former: https://arxiv.org/abs/2112.01527 This function is not used by default.
pipelines/loss_segmentation.py:32
↓ 1 callersMethodmatcher_dice_loss
Compute the DICE loss, similar to generalized IOU for masks Args: inputs: A float tensor of arbitrary shape.
pipelines/loss_segmentation.py:190
↓ 1 callersMethodmatcher_sigmoid_ce_loss
Args: inputs: A float tensor of arbitrary shape. The predictions for each example. targets: A flo
pipelines/loss_segmentation.py:230
↓ 1 callersFunctionoptimize_mask
(args)
optimize_mask.py:57
↓ 1 callersFunctionparse_args
()
optimize_mask.py:15
↓ 1 callersFunctionparse_args
()
train_ae.py:78
↓ 1 callersFunctionparse_args
()
generate_dataset.py:16
↓ 1 callersFunctionparse_args
()
train_ldm.py:111
↓ 1 callersFunctionparse_args
()
utils/prepare_voc_aug.py:23
↓ 1 callersMethodpoint_loss
We use very effective losses to quantify the quality of the reconstruction. Overall loss function consists of 3 terms: -
pipelines/loss_segmentation.py:344
↓ 1 callersMethodprepare_extra_step_kwargs
(self, generator, eta)
pipelines/pipeline_jodiffusion.py:110
↓ 1 callersMethodprepare_image_clip_embeds
( self, batch_size, clip_img_dim, dtype, device, generator, latents=None )
pipelines/pipeline_jodiffusion.py:366
↓ 1 callersMethodprepare_image_vae_latents
( self, batch_size, num_channels_latents, height, width, dtype, device, generator, latents=None, )
pipelines/pipeline_jodiffusion.py:345
↓ 1 callersMethodprepare_label_latents
( self, batch_size, num_channels_latents, height, width, dtype, device, generator, latents=None, )
pipelines/pipeline_jodiffusion.py:383
↓ 1 callersMethodsigmoid_ce_loss
Args: inputs: A float tensor of arbitrary shape. The predictions for each example. targets: A flo
pipelines/loss_segmentation.py:211
Method__call__
(self, x)
train_ae.py:265
Method__call__
(self, x)
train_ae.py:275
Method__call__
r""" The call function to the pipeline for generation. Args: height (`int`, *optional*, defaults to `self.unet.config.sam
pipelines/pipeline_jodiffusion.py:658
Method__init__
(self, n=8, fill_value=0.5, ignore_label=0)
train_ae.py:269
Method__init__
( self, text_dim: int = 768, inner_text_dim: int = 64, clip_img_dim: int = 512
pipelines/modeling_uvit.py:17
Method__init__
( self, num_points = 12544, oversample_ratio = 3, importance_sample_ratio = 0.
pipelines/loss_segmentation.py:12
Method__init__
( self, image_vae: AutoencoderKL, text_encoder: CLIPTextModel, clip_tokenizer:
pipelines/pipeline_jodiffusion.py:76
Method__init__
( self, in_channels: int = 7, # for bits encoding intermediate_channels: int = 512,
pipelines/modeling_lightweight_vae.py:25
Method__init__
(self, num_classes, class_names, has_bg=True, ignore_index=0)
validate/miou_evaluation.py:6
Method__str__
(self)
validate/miou_evaluation.py:48
Method_generate_examples
(self, image_path, annotations, caption_json)
dataset/coco_semantic.py:157
Method_generate_examples
(self, image_path, semantic_path, caption_json)
dataset/ade20k_semantic.py:84
Method_generate_examples
(self, image_list, caption_json)
dataset/voc_semantic.py:83
Method_get_tgt_permutation_idx
(self, indices)
pipelines/loss_segmentation.py:98
Method_info
(self)
dataset/coco_semantic.py:121
Method_info
(self)
dataset/ade20k_semantic.py:41
Method_info
(self)
dataset/voc_semantic.py:39
Method_set_gradient_checkpointing
(self, module, value=False)
pipelines/modeling_lightweight_vae.py:73
Method_split_generators
(self, dl_manager)
dataset/coco_semantic.py:137
Method_split_generators
(self, dl_manager)
dataset/ade20k_semantic.py:57
Method_split_generators
(self, dl_manager)
dataset/voc_semantic.py:54
Methodcategory_id_to_contiguous_id
(self)
dataset/coco_semantic.py:106
Methodcategory_info
(self)
dataset/coco_semantic.py:20
Methodcategory_names
(self)
dataset/coco_semantic.py:110
Methodcategory_names
(self)
dataset/ade20k_semantic.py:30
Methodcategory_names
(self)
dataset/voc_semantic.py:27
Functioncollate_fn
(examples)
train_ae.py:329
Functioncollate_fn
(examples)
train_ldm.py:446
Methoddata_root
(self)
dataset/coco_semantic.py:16
Methoddata_root
(self)
dataset/ade20k_semantic.py:15
Methoddata_root
(self)
dataset/voc_semantic.py:15
Functiondecode_seg
(array_seg_t, cmap=None)
utils/utils.py:116
Methoddisable_vae_slicing
r""" Disable sliced VAE decoding. If `enable_vae_slicing` was previously enabled, this method will go back to computing decoding in on
pipelines/pipeline_jodiffusion.py:137
Methoddisable_vae_tiling
r""" Disable tiled VAE decoding. If `enable_vae_tiling` was previously enabled, this method will go back to computing decoding in one
pipelines/pipeline_jodiffusion.py:156
Methodenable_vae_slicing
r""" Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to compute decoding in sev
pipelines/pipeline_jodiffusion.py:128
Methodenable_vae_tiling
r""" Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and en
pipelines/pipeline_jodiffusion.py:146
Functionencode_images
(batch, image_vae, image_encoder, clip_image_processor, label_vae, image_column)
train_ldm.py:351
Functionencode_prompt
(batch, text_encoder, clip_tokenizer, caption_column)
train_ldm.py:332
Methodforward
Args: prompt_embeds (`torch.Tensor` of shape `(batch size, seq_len, text_dim)`): CLIP-embedded text representatio
pipelines/modeling_uvit.py:169
Methodforward
( self, sample: torch.Tensor, sample_posterior: bool = False, return_dict: boo
pipelines/modeling_lightweight_vae.py:205
Methodforward
(self, x: torch.Tensor)
pipelines/modeling_lightweight_vae.py:234
Methodignore_label
(self)
dataset/coco_semantic.py:114
Methodignore_label
(self)
dataset/ade20k_semantic.py:34
Methodignore_label
(self)
dataset/voc_semantic.py:32
next →1–100 of 117, ranked by callers