SYMBOL INDEX (986 symbols across 60 files) FILE: lidm/data/annotated_dataset.py class Annotated3DObjectsDataset (line 11) | class Annotated3DObjectsDataset(Dataset): method __init__ (line 12) | def __init__(self, min_objects_per_image: int, method no_classes (line 24) | def no_classes(self) -> int: method conditional_builders (line 28) | def conditional_builders(self) -> ObjectsCenterPointsConditionalBuilder: method get_textual_label_for_category_id (line 47) | def get_textual_label_for_category_id(self, category_id: int) -> str: FILE: lidm/data/base.py class DatasetBase (line 15) | class DatasetBase(Dataset): method __init__ (line 16) | def __init__(self, data_root, split, dataset_config, aug_config, retur... method prepare_data (line 57) | def prepare_data(self): method process_scan (line 60) | def process_scan(self, range_img): method load_lidar_sweep (line 80) | def load_lidar_sweep(*args, **kwargs): method load_semantic_map (line 84) | def load_semantic_map(*args, **kwargs): method load_camera (line 88) | def load_camera(*args, **kwargs): method load_annotation (line 92) | def load_annotation(*args, **kwargs): method __len__ (line 95) | def __len__(self): method __getitem__ (line 98) | def __getitem__(self, idx): class Txt2ImgIterableBaseDataset (line 103) | class Txt2ImgIterableBaseDataset(IterableDataset): method __init__ (line 107) | def __init__(self, num_records=0, valid_ids=None, size=256): method __len__ (line 116) | def __len__(self): method __iter__ (line 120) | def __iter__(self): FILE: lidm/data/conditional_builder/objects_bbox.py class ObjectsBoundingBoxConditionalBuilder (line 14) | class ObjectsBoundingBoxConditionalBuilder(ObjectsCenterPointsConditiona... method object_descriptor_length (line 16) | def object_descriptor_length(self) -> int: method _make_object_descriptors (line 19) | def _make_object_descriptors(self, annotations: List[Annotation]) -> L... method inverse_build (line 27) | def inverse_build(self, conditional: LongTensor) -> Tuple[List[Tuple[i... method plot (line 33) | def plot(self, conditional: LongTensor, label_for_category_no: Callabl... FILE: lidm/data/conditional_builder/objects_center_points.py function convert_pil_to_tensor (line 19) | def convert_pil_to_tensor(image: Image) -> Tensor: class ObjectsCenterPointsConditionalBuilder (line 26) | class ObjectsCenterPointsConditionalBuilder: method __init__ (line 27) | def __init__(self, no_object_classes: int, no_max_objects: int, no_tok... method none (line 35) | def none(self) -> int: method object_descriptor_length (line 39) | def object_descriptor_length(self) -> int: method empty_tuple (line 43) | def empty_tuple(self) -> Tuple: method embedding_dim (line 47) | def embedding_dim(self) -> int: method tokenize_coordinates (line 50) | def tokenize_coordinates(self, x: float, y: float) -> int: method coordinates_from_token (line 67) | def coordinates_from_token(self, token: int) -> (float, float): method bbox_from_token_pair (line 72) | def bbox_from_token_pair(self, token1: int, token2: int) -> BoundingBox: method token_pair_from_bbox (line 79) | def token_pair_from_bbox(self, bbox: BoundingBox) -> Tuple: method inverse_build (line 83) | def inverse_build(self, conditional: LongTensor) \ method plot (line 93) | def plot(self, conditional: LongTensor, label_for_category_no: Callabl... method object_representation (line 114) | def object_representation(self, annotation: Annotation) -> int: method representation_to_annotation (line 117) | def representation_to_annotation(self, representation: int) -> Annotat... method _make_object_descriptors (line 125) | def _make_object_descriptors(self, annotations: List[Annotation]) -> L... method build (line 135) | def build(self, annotations: List[Annotation]) \ FILE: lidm/data/conditional_builder/utils.py function corners_3d_to_2d (line 18) | def corners_3d_to_2d(corners3d): function rotate_points_along_z (line 43) | def rotate_points_along_z(points, angle): function boxes_to_corners_3d (line 64) | def boxes_to_corners_3d(boxes3d): function intersection_area (line 92) | def intersection_area(rectangle1: BoundingBox, rectangle2: BoundingBox) ... function horizontally_flip_bbox (line 105) | def horizontally_flip_bbox(bbox: BoundingBox) -> BoundingBox: function absolute_bbox (line 109) | def absolute_bbox(relative_bbox: BoundingBox, width: int, height: int) -... function pad_list (line 123) | def pad_list(list_: List, pad_element: Any, pad_to_length: int) -> List: function rescale_annotations (line 127) | def rescale_annotations(annotations: List[Annotation], crop_coordinates:... function filter_annotations (line 144) | def filter_annotations(annotations: List[Annotation], crop_coordinates: ... function additional_parameters_string (line 148) | def additional_parameters_string(annotation: Annotation, short: bool = T... function get_plot_font_size (line 164) | def get_plot_font_size(font_size: Optional[int], figure_size: Tuple[int,... function get_circle_size (line 174) | def get_circle_size(figure_size: Tuple[int, int]) -> int: function load_object_from_string (line 183) | def load_object_from_string(object_string: str) -> Any: FILE: lidm/data/helper_types.py class Annotation (line 17) | class Annotation(NamedTuple): FILE: lidm/data/kitti.py class KITTIBase (line 39) | class KITTIBase(DatasetBase): method __init__ (line 40) | def __init__(self, **kwargs): method load_lidar_sweep (line 46) | def load_lidar_sweep(path): method load_semantic_map (line 52) | def load_semantic_map(self, path, pcd): method load_camera (line 55) | def load_camera(self, path): method __getitem__ (line 58) | def __getitem__(self, idx): class SemanticKITTIBase (line 93) | class SemanticKITTIBase(KITTIBase): method __init__ (line 94) | def __init__(self, **kwargs): method prepare_data (line 99) | def prepare_data(self): method load_semantic_map (line 111) | def load_semantic_map(self, path, pcd): class SemanticKITTITrain (line 127) | class SemanticKITTITrain(SemanticKITTIBase): method __init__ (line 128) | def __init__(self, **kwargs): class SemanticKITTIValidation (line 132) | class SemanticKITTIValidation(SemanticKITTIBase): method __init__ (line 133) | def __init__(self, **kwargs): class KITTI360Base (line 137) | class KITTI360Base(KITTIBase): method __init__ (line 138) | def __init__(self, split_per_view=None, **kwargs): method prepare_data (line 144) | def prepare_data(self): method random_drop_camera (line 155) | def random_drop_camera(self, camera_list): method load_camera (line 160) | def load_camera(self, path): class KITTI360Train (line 171) | class KITTI360Train(KITTI360Base): method __init__ (line 172) | def __init__(self, **kwargs): class KITTI360Validation (line 176) | class KITTI360Validation(KITTI360Base): method __init__ (line 177) | def __init__(self, **kwargs): class AnnotatedKITTI360Base (line 181) | class AnnotatedKITTI360Base(Annotated3DObjectsDataset, KITTI360Base): method __init__ (line 182) | def __init__(self, **kwargs): method parseOpencvMatrix (line 191) | def parseOpencvMatrix(node): method parseVertices (line 205) | def parseVertices(self, child): method parse_bbox_xml (line 213) | def parse_bbox_xml(self, path): method prepare_data (line 239) | def prepare_data(self): method load_annotation (line 251) | def load_annotation(self, path): method __getitem__ (line 268) | def __getitem__(self, idx): class AnnotatedKITTI360Train (line 304) | class AnnotatedKITTI360Train(AnnotatedKITTI360Base): method __init__ (line 305) | def __init__(self, **kwargs): class AnnotatedKITTI360Validation (line 309) | class AnnotatedKITTI360Validation(AnnotatedKITTI360Base): method __init__ (line 310) | def __init__(self, **kwargs): class KITTIImageBase (line 314) | class KITTIImageBase(KITTIBase): method __init__ (line 321) | def __init__(self, **kwargs): method prepare_data (line 325) | def prepare_data(self): class KITTIImageTrain (line 338) | class KITTIImageTrain(KITTIImageBase): method __init__ (line 339) | def __init__(self, **kwargs): class KITTIImageValidation (line 343) | class KITTIImageValidation(KITTIImageBase): method __init__ (line 344) | def __init__(self, **kwargs): FILE: lidm/eval/__init__.py function build_model (line 39) | def build_model(dataset_name, model_name, device='cpu'): FILE: lidm/eval/eval_utils.py function evaluate (line 20) | def evaluate(reference, samples, metrics, data): function compute_cd (line 42) | def compute_cd(reference, samples): function compute_emd (line 56) | def compute_emd(reference, samples): function compute_mmd (line 70) | def compute_mmd(reference, samples, data, dist='cd', verbose=True): function compute_jsd (line 87) | def compute_jsd(reference, samples, data): function compute_fd (line 100) | def compute_fd(reference, samples): function compute_frid (line 107) | def compute_frid(reference, samples, data): function compute_fsvd (line 118) | def compute_fsvd(reference, samples, data): function compute_fpvd (line 129) | def compute_fpvd(reference, samples, data): FILE: lidm/eval/fid_score.py function tqdm (line 40) | def tqdm(x): class ImagePathDataset (line 43) | class ImagePathDataset(torch.utils.data.Dataset): method __init__ (line 44) | def __init__(self, files, transforms=None): method __len__ (line 48) | def __len__(self): method __getitem__ (line 51) | def __getitem__(self, i): function get_activations (line 59) | def get_activations(files, model, batch_size=50, dims=2048, device='cpu', function calculate_frechet_distance (line 116) | def calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps=1e-6): function calculate_activation_statistics (line 170) | def calculate_activation_statistics(files, model, batch_size=50, dims=2048, FILE: lidm/eval/metric_utils.py function ravel_hash (line 28) | def ravel_hash(x: np.ndarray) -> np.ndarray: function sparse_quantize (line 43) | def sparse_quantize(coords, voxel_size: Union[float, Tuple[float, ...]] ... function pcd2range (line 69) | def pcd2range(pcd, size, fov, depth_range, remission=None, labels=None, ... function range2xyz (line 125) | def range2xyz(range_img, fov, depth_range, depth_scale, log_scale=True, ... function pcd2voxel (line 157) | def pcd2voxel(pcd): function pcd2voxel_full (line 170) | def pcd2voxel_full(data_type, *args): function pcd2bev_sum (line 233) | def pcd2bev_sum(data_type, *args, voxel_size=VOXEL_SIZE): function pcd2bev_bin (line 261) | def pcd2bev_bin(data_type, *args, voxel_size=0.5): function bev_sample (line 287) | def bev_sample(data_type, *args, voxel_size=0.5): function preprocess_pcd (line 310) | def preprocess_pcd(pcd, **kwargs): function preprocess_range (line 317) | def preprocess_range(pcd, **kwargs): function batch2list (line 325) | def batch2list(batch_dict, agg_type='depth', **kwargs): function compute_logits (line 374) | def compute_logits(data_type, modality, *args): function compute_pairwise_cd (line 415) | def compute_pairwise_cd(x, y, module=None): function compute_pairwise_cd_batch (line 426) | def compute_pairwise_cd_batch(reference, samples): function compute_pairwise_emd (line 447) | def compute_pairwise_emd(x, y, module=None): FILE: lidm/eval/models/minkowskinet/model.py class Model (line 12) | class Model(nn.Module): method __init__ (line 13) | def __init__(self, config): method weight_initialization (line 94) | def weight_initialization(self): method forward (line 100) | def forward(self, data_dict, return_logits=False, return_final_logits=... FILE: lidm/eval/models/rangenet/model.py class BasicBlock (line 10) | class BasicBlock(nn.Module): method __init__ (line 11) | def __init__(self, inplanes, planes, bn_d=0.1): method forward (line 22) | def forward(self, x): class Backbone (line 46) | class Backbone(nn.Module): method __init__ (line 51) | def __init__(self, params): method _make_enc_layer (line 126) | def _make_enc_layer(self, block, planes, blocks, stride, bn_d=0.1): method run_layer (line 145) | def run_layer(self, x, layer, skips, os): method forward (line 153) | def forward(self, x, return_logits=False, return_list=None): method get_last_depth (line 203) | def get_last_depth(self): method get_input_depth (line 206) | def get_input_depth(self): class Decoder (line 210) | class Decoder(nn.Module): method __init__ (line 215) | def __init__(self, params, OS=32, feature_depth=1024): method _make_dec_layer (line 261) | def _make_dec_layer(self, block, planes, bn_d=0.1, stride=2): method run_layer (line 280) | def run_layer(self, x, layer, skips, os): method forward (line 288) | def forward(self, x, skips, return_logits=False, return_list=None): method get_last_depth (line 318) | def get_last_depth(self): class Model (line 322) | class Model(nn.Module): method __init__ (line 323) | def __init__(self, config): method load_pretrained_weights (line 330) | def load_pretrained_weights(self, path): method forward (line 338) | def forward(self, x, return_logits=False, return_final_logits=False, r... FILE: lidm/eval/models/spvcnn/model.py class Model (line 13) | class Model(nn.Module): method __init__ (line 14) | def __init__(self, config): method weight_initialization (line 112) | def weight_initialization(self): method forward (line 118) | def forward(self, data_dict, return_logits=False, return_final_logits=... FILE: lidm/eval/models/ts/basic_blocks.py class BasicConvolutionBlock (line 16) | class BasicConvolutionBlock(nn.Module): method __init__ (line 17) | def __init__(self, inc, outc, ks=3, stride=1, dilation=1): method forward (line 28) | def forward(self, x): class BasicDeconvolutionBlock (line 33) | class BasicDeconvolutionBlock(nn.Module): method __init__ (line 34) | def __init__(self, inc, outc, ks=3, stride=1): method forward (line 46) | def forward(self, x): class ResidualBlock (line 50) | class ResidualBlock(nn.Module): method __init__ (line 51) | def __init__(self, inc, outc, ks=3, stride=1, dilation=1): method forward (line 77) | def forward(self, x): FILE: lidm/eval/models/ts/utils.py function initial_voxelize (line 15) | def initial_voxelize(z, init_res, after_res): function point_to_voxel (line 38) | def point_to_voxel(x, z): function voxel_to_point (line 63) | def voxel_to_point(x, z, nearest=False): FILE: lidm/eval/modules/chamfer2D/chamfer_cuda.cpp function chamfer_forward (line 17) | int chamfer_forward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor dist1, ... function chamfer_backward (line 22) | int chamfer_backward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor gradxy... function PYBIND11_MODULE (line 30) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: lidm/eval/modules/chamfer2D/dist_chamfer_2D.py class chamfer_2DFunction (line 32) | class chamfer_2DFunction(Function): method forward (line 34) | def forward(ctx, xyz1, xyz2): method backward (line 60) | def backward(ctx, graddist1, graddist2, gradidx1, gradidx2): class chamfer_2DDist (line 77) | class chamfer_2DDist(nn.Module): method __init__ (line 78) | def __init__(self): method forward (line 81) | def forward(self, input1, input2): FILE: lidm/eval/modules/chamfer3D/chamfer_cuda.cpp function chamfer_forward (line 17) | int chamfer_forward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor dist1, ... function chamfer_backward (line 22) | int chamfer_backward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor gradxy... function PYBIND11_MODULE (line 30) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: lidm/eval/modules/chamfer3D/dist_chamfer_3D.py class chamfer_3DFunction (line 28) | class chamfer_3DFunction(Function): method forward (line 30) | def forward(ctx, xyz1, xyz2): method backward (line 52) | def backward(ctx, graddist1, graddist2, gradidx1, gradidx2): class chamfer_3DDist (line 69) | class chamfer_3DDist(nn.Module): method __init__ (line 70) | def __init__(self): method forward (line 73) | def forward(self, input1, input2): FILE: lidm/eval/modules/emd/emd.cpp function emd_forward (line 14) | int emd_forward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor dist, at::T... function emd_backward (line 20) | int emd_backward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor gradxyz, a... function PYBIND11_MODULE (line 28) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: lidm/eval/modules/emd/emd_module.py class emdFunction (line 46) | class emdFunction(Function): method forward (line 48) | def forward(ctx, xyz1, xyz2, eps, iters): method backward (line 79) | def backward(ctx, graddist, gradidx): class emdModule (line 90) | class emdModule(nn.Module): method __init__ (line 91) | def __init__(self): method forward (line 94) | def forward(self, input1, input2, eps, iters): function test_emd (line 98) | def test_emd(): FILE: lidm/models/autoencoder.py class VQModel (line 15) | class VQModel(pl.LightningModule): method __init__ (line 16) | def __init__(self, method ema_scope (line 71) | def ema_scope(self, context=None): method init_from_ckpt (line 85) | def init_from_ckpt(self, path, ignore_keys=list()): method on_train_batch_end (line 99) | def on_train_batch_end(self, *args, **kwargs): method encode (line 103) | def encode(self, x): method encode_to_prequant (line 109) | def encode_to_prequant(self, x): method decode (line 114) | def decode(self, quant): method decode_code (line 119) | def decode_code(self, code_b): method forward (line 124) | def forward(self, input, return_pred_indices=False): method get_input (line 131) | def get_input(self, batch, k): method get_mask (line 149) | def get_mask(self, batch): method training_step (line 155) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 178) | def validation_step(self, batch, batch_idx): method _validation_step (line 185) | def _validation_step(self, batch, batch_idx, suffix=""): method configure_optimizers (line 214) | def configure_optimizers(self): method get_last_layer (line 247) | def get_last_layer(self): method log_images (line 251) | def log_images(self, batch, only_inputs=False, plot_ema=False, **kwargs): method to_rgb (line 271) | def to_rgb(self, x): class VQModelInterface (line 280) | class VQModelInterface(VQModel): method __init__ (line 281) | def __init__(self, embed_dim, *args, **kwargs): method encode (line 285) | def encode(self, x): method decode (line 290) | def decode(self, h, force_not_quantize=False): class AutoencoderKL (line 305) | class AutoencoderKL(pl.LightningModule): method __init__ (line 306) | def __init__(self, method init_from_ckpt (line 337) | def init_from_ckpt(self, path, ignore_keys=list()): method encode (line 348) | def encode(self, x): method decode (line 354) | def decode(self, z): method forward (line 359) | def forward(self, input, sample_posterior=True): method get_input (line 368) | def get_input(self, batch, k): method training_step (line 374) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 395) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 408) | def configure_optimizers(self): method get_last_layer (line 419) | def get_last_layer(self): method log_images (line 423) | def log_images(self, batch, only_inputs=False, **kwargs): method to_rgb (line 439) | def to_rgb(self, x): class IdentityFirstStage (line 448) | class IdentityFirstStage(torch.nn.Module): method __init__ (line 449) | def __init__(self, *args, vq_interface=False, **kwargs): method encode (line 453) | def encode(self, x, *args, **kwargs): method decode (line 456) | def decode(self, x, *args, **kwargs): method quantize (line 459) | def quantize(self, x, *args, **kwargs): method forward (line 464) | def forward(self, x, *args, **kwargs): FILE: lidm/models/diffusion/classifier.py function disabled_train (line 22) | def disabled_train(self, mode=True): class NoisyLatentImageClassifier (line 28) | class NoisyLatentImageClassifier(pl.LightningModule): method __init__ (line 30) | def __init__(self, method init_from_ckpt (line 70) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method load_diffusion (line 88) | def load_diffusion(self): method load_classifier (line 95) | def load_classifier(self, ckpt_path, pool): method get_x_noisy (line 110) | def get_x_noisy(self, x, t, noise=None): method forward (line 120) | def forward(self, x_noisy, t, *args, **kwargs): method get_input (line 124) | def get_input(self, batch, k): method get_conditioning (line 133) | def get_conditioning(self, batch, k=None): method compute_top_k (line 150) | def compute_top_k(self, logits, labels, k, reduction="mean"): method on_train_epoch_start (line 157) | def on_train_epoch_start(self): method write_logs (line 162) | def write_logs(self, loss, logits, targets): method shared_step (line 179) | def shared_step(self, batch, t=None): method training_step (line 198) | def training_step(self, batch, batch_idx): method reset_noise_accs (line 202) | def reset_noise_accs(self): method on_validation_start (line 206) | def on_validation_start(self): method validation_step (line 210) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 220) | def configure_optimizers(self): method log_images (line 238) | def log_images(self, batch, N=8, *args, **kwargs): FILE: lidm/models/diffusion/ddim.py class DDIMSampler (line 12) | class DDIMSampler(object): method __init__ (line 13) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 19) | def register_buffer(self, name, attr): method make_schedule (line 25) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 57) | def sample(self, method ddim_sampling (line 115) | def ddim_sampling(self, cond, shape, method p_sample_ddim (line 167) | def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_origin... FILE: lidm/models/diffusion/ddpm.py function disabled_train (line 33) | def disabled_train(self, mode=True): function uniform_on_device (line 39) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 43) | class DDPM(pl.LightningModule): method __init__ (line 45) | def __init__(self, method register_schedule (line 117) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method ema_scope (line 172) | def ema_scope(self, context=None): method init_from_ckpt (line 186) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 204) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 216) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 222) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 231) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 244) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 253) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 268) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 274) | def q_sample(self, x_start, t, noise=None): method get_loss (line 279) | def get_loss(self, pred, target, mean=True): method p_losses (line 294) | def p_losses(self, x_start, t, noise=None): method forward (line 323) | def forward(self, x, *args, **kwargs): method get_input (line 329) | def get_input(self, batch, k): method shared_step (line 335) | def shared_step(self, batch): method training_step (line 340) | def training_step(self, batch, batch_idx): method validation_step (line 356) | def validation_step(self, batch, batch_idx): method on_train_batch_end (line 364) | def on_train_batch_end(self, *args, **kwargs): method _get_rows_from_list (line 368) | def _get_rows_from_list(self, samples): method log_images (line 376) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method configure_optimizers (line 413) | def configure_optimizers(self): class LatentDiffusion (line 422) | class LatentDiffusion(DDPM): method __init__ (line 425) | def __init__(self, method make_cond_schedule (line 472) | def make_cond_schedule(self, ): method on_train_batch_start (line 479) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 494) | def register_schedule(self, method instantiate_first_stage (line 503) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 510) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 531) | def _get_denoise_row_from_list(self, samples, desc='', force_no_decode... method get_first_stage_encoding (line 543) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 552) | def get_learned_conditioning(self, c): method meshgrid (line 565) | def meshgrid(self, h, w): method delta_border (line 572) | def delta_border(self, h, w): method get_weighting (line 586) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 602) | def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo... method get_input (line 655) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method decode_first_stage (line 711) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method differentiable_decode_first_stage (line 771) | def differentiable_decode_first_stage(self, z, predict_cids=False, for... method encode_first_stage (line 830) | def encode_first_stage(self, x): method shared_step (line 867) | def shared_step(self, batch, **kwargs): method forward (line 872) | def forward(self, x, c, *args, **kwargs): method _rescale_annotations (line 883) | def _rescale_annotations(self, bboxes, crop_coordinates): # TODO: mov... method apply_model (line 893) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 995) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 999) | def _prior_bpd(self, x_start): method p_losses (line 1013) | def p_losses(self, x_start, cond, t, noise=None): method p_mean_variance (line 1052) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_codeboo... method p_sample (line 1084) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, method progressive_denoising (line 1115) | def progressive_denoising(self, cond, shape, verbose=False, callback=N... method p_sample_loop (line 1171) | def p_sample_loop(self, cond, shape, return_intermediates=False, method sample (line 1222) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method sample_log (line 1240) | def sample_log(self, cond, batch_size, ddim, ddim_steps, **kwargs): method log_images (line 1254) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... method configure_optimizers (line 1371) | def configure_optimizers(self): method to_rgb (line 1396) | def to_rgb(self, x): class DiffusionWrapper (line 1405) | class DiffusionWrapper(pl.LightningModule): method __init__ (line 1406) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1412) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = None): class Layout2ImgDiffusion (line 1434) | class Layout2ImgDiffusion(LatentDiffusion): method __init__ (line 1435) | def __init__(self, cond_stage_key, *args, **kwargs): method log_images (line 1439) | def log_images(self, batch, N=8, dset=None, *args, **kwargs): FILE: lidm/models/diffusion/plms.py class PLMSSampler (line 11) | class PLMSSampler(object): method __init__ (line 12) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 18) | def register_buffer(self, name, attr): method make_schedule (line 24) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 58) | def sample(self, method plms_sampling (line 115) | def plms_sampling(self, cond, shape, method p_sample_plms (line 173) | def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_origin... FILE: lidm/modules/attention.py function exists (line 11) | def exists(val): function uniq (line 15) | def uniq(arr): function default (line 19) | def default(val, d): function max_neg_value (line 25) | def max_neg_value(t): function init_ (line 29) | def init_(tensor): class GEGLU (line 37) | class GEGLU(nn.Module): method __init__ (line 38) | def __init__(self, dim_in, dim_out): method forward (line 42) | def forward(self, x): class FeedForward (line 47) | class FeedForward(nn.Module): method __init__ (line 48) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 63) | def forward(self, x): function zero_module (line 67) | def zero_module(module): function Normalize (line 76) | def Normalize(in_channels): class LinearAttention (line 80) | class LinearAttention(nn.Module): method __init__ (line 81) | def __init__(self, dim, heads=4, dim_head=32): method forward (line 88) | def forward(self, x): class SpatialSelfAttention (line 99) | class SpatialSelfAttention(nn.Module): method __init__ (line 100) | def __init__(self, in_channels): method forward (line 126) | def forward(self, x): class CrossAttention (line 152) | class CrossAttention(nn.Module): method __init__ (line 153) | def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, ... method forward (line 170) | def forward(self, x, context=None, mask=None): class BasicTransformerBlock (line 196) | class BasicTransformerBlock(nn.Module): method __init__ (line 197) | def __init__(self, dim, n_heads, d_head, dropout=0., context_dim=None,... method forward (line 208) | def forward(self, x, context=None): method _forward (line 211) | def _forward(self, x, context=None): class SpatialTransformer (line 218) | class SpatialTransformer(nn.Module): method __init__ (line 226) | def __init__(self, in_channels, n_heads, d_head, method forward (line 250) | def forward(self, x, context=None): FILE: lidm/modules/basic.py class CircularPad (line 21) | class CircularPad(nn.Module): method __init__ (line 22) | def __init__(self, pad_size): method forward (line 27) | def forward(self, x): class CircularConv2d (line 35) | class CircularConv2d(nn.Conv2d): method __init__ (line 36) | def __init__(self, *args, **kwargs): method forward (line 52) | def forward(self, x: Tensor) -> Tensor: class ActNorm (line 62) | class ActNorm(nn.Module): method __init__ (line 63) | def __init__(self, num_features, logdet=False, affine=True, method initialize (line 74) | def initialize(self, input): method forward (line 95) | def forward(self, input, reverse=False): method reverse (line 123) | def reverse(self, output): function make_beta_schedule (line 147) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 172) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 188) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 200) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... function extract_into_tensor (line 219) | def extract_into_tensor(a, t, x_shape): function checkpoint (line 225) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 242) | class CheckpointFunction(torch.autograd.Function): method forward (line 244) | def forward(ctx, run_function, length, *args): method backward (line 254) | def backward(ctx, *output_grads): function timestep_embedding (line 274) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 295) | def zero_module(module): function scale_module (line 304) | def scale_module(module, scale): function mean_flat (line 313) | def mean_flat(tensor): function normalization (line 320) | def normalization(channels): class SiLU (line 330) | class SiLU(nn.Module): method forward (line 331) | def forward(self, x): class GroupNorm32 (line 335) | class GroupNorm32(nn.GroupNorm): method forward (line 336) | def forward(self, x): function conv_nd (line 340) | def conv_nd(dims, *args, cconv=False, **kwargs): function linear (line 356) | def linear(*args, **kwargs): function avg_pool_nd (line 363) | def avg_pool_nd(dims, *args, **kwargs): class HybridConditioner (line 376) | class HybridConditioner(nn.Module): method __init__ (line 378) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 383) | def forward(self, c_concat, c_crossattn): function noise_like (line 389) | def noise_like(shape, device, repeat=False): FILE: lidm/modules/diffusion/model_ldm.py function get_timestep_embedding (line 12) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 33) | def nonlinearity(x): function Normalize (line 38) | def Normalize(in_channels, num_groups=32): class Upsample (line 42) | class Upsample(nn.Module): method __init__ (line 43) | def __init__(self, in_channels, with_conv): method forward (line 53) | def forward(self, x): class Downsample (line 60) | class Downsample(nn.Module): method __init__ (line 61) | def __init__(self, in_channels, with_conv): method forward (line 72) | def forward(self, x): class ResnetBlock (line 82) | class ResnetBlock(nn.Module): method __init__ (line 83) | def __init__(self, *, in_channels, out_channels=None, conv_shortcut=Fa... method forward (line 121) | def forward(self, x, temb): class LinAttnBlock (line 144) | class LinAttnBlock(LinearAttention): method __init__ (line 147) | def __init__(self, in_channels): class AttnBlock (line 151) | class AttnBlock(nn.Module): method __init__ (line 152) | def __init__(self, in_channels): method forward (line 178) | def forward(self, x): function make_attn (line 205) | def make_attn(in_channels, attn_type="vanilla"): class Model (line 216) | class Model(nn.Module): method __init__ (line 217) | def __init__(self, *, ch, out_ch, ch_mult=(1, 2, 4, 8), num_res_blocks, method forward (line 312) | def forward(self, x, t=None, context=None): method get_last_layer (line 360) | def get_last_layer(self): class Encoder (line 364) | class Encoder(nn.Module): method __init__ (line 365) | def __init__(self, *, ch, out_ch, ch_mult=(1, 2, 4, 8), num_res_blocks, method forward (line 427) | def forward(self, x): class Decoder (line 454) | class Decoder(nn.Module): method __init__ (line 455) | def __init__(self, *, ch, out_ch, ch_mult=(1, 2, 4, 8), num_res_blocks, method forward (line 521) | def forward(self, z): class SimpleDecoder (line 556) | class SimpleDecoder(nn.Module): method __init__ (line 557) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 579) | def forward(self, x): class UpsampleDecoder (line 592) | class UpsampleDecoder(nn.Module): method __init__ (line 593) | def __init__(self, in_channels, out_channels, ch, num_res_blocks, method forward (line 623) | def forward(self, x): class LatentRescaler (line 637) | class LatentRescaler(nn.Module): method __init__ (line 638) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 662) | def forward(self, x): class MergedRescaleEncoder (line 675) | class MergedRescaleEncoder(nn.Module): method __init__ (line 676) | def __init__(self, in_channels, ch, out_ch, num_res_blocks, method forward (line 688) | def forward(self, x): class MergedRescaleDecoder (line 694) | class MergedRescaleDecoder(nn.Module): method __init__ (line 695) | def __init__(self, z_channels, out_ch, num_res_blocks, attn_levels, ch... method forward (line 705) | def forward(self, x): class Upsampler (line 711) | class Upsampler(nn.Module): method __init__ (line 712) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 725) | def forward(self, x): class Resize (line 731) | class Resize(nn.Module): method __init__ (line 732) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 747) | def forward(self, x, scale_factor=1.0): class FirstStagePostProcessor (line 755) | class FirstStagePostProcessor(nn.Module): method __init__ (line 757) | def __init__(self, ch_mult: list, in_channels, method instantiate_pretrained (line 791) | def instantiate_pretrained(self, config): method encode_with_pretrained (line 799) | def encode_with_pretrained(self, x): method forward (line 805) | def forward(self, x): FILE: lidm/modules/diffusion/model_lidm.py function get_timestep_embedding (line 14) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 35) | def nonlinearity(x): function Normalize (line 40) | def Normalize(in_channels, num_groups=32): class Upsample (line 48) | class Upsample(nn.Module): method __init__ (line 49) | def __init__(self, in_channels, with_conv, stride): method forward (line 57) | def forward(self, x): class Downsample (line 68) | class Downsample(nn.Module): method __init__ (line 69) | def __init__(self, in_channels, with_conv, stride): method forward (line 77) | def forward(self, x): class ResnetBlock (line 88) | class ResnetBlock(nn.Module): method __init__ (line 89) | def __init__(self, *, in_channels, out_channels=None, kernel_size=(3, ... method forward (line 127) | def forward(self, x, temb): class LinAttnBlock (line 150) | class LinAttnBlock(LinearAttention): method __init__ (line 153) | def __init__(self, in_channels): class AttnBlock (line 157) | class AttnBlock(nn.Module): method __init__ (line 158) | def __init__(self, in_channels): method forward (line 184) | def forward(self, x): function make_attn (line 211) | def make_attn(in_channels, attn_type="vanilla"): class Encoder (line 222) | class Encoder(nn.Module): method __init__ (line 223) | def __init__(self, *, ch, out_ch, ch_mult, strides, num_res_blocks, method forward (line 287) | def forward(self, x): class Decoder (line 315) | class Decoder(nn.Module): method __init__ (line 316) | def __init__(self, *, ch, out_ch, ch_mult, strides, num_res_blocks, at... method forward (line 385) | def forward(self, z): class SimpleDecoder (line 420) | class SimpleDecoder(nn.Module): method __init__ (line 421) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 443) | def forward(self, x): class UpsampleDecoder (line 456) | class UpsampleDecoder(nn.Module): method __init__ (line 457) | def __init__(self, in_channels, out_channels, ch, num_res_blocks, method forward (line 488) | def forward(self, x): class LatentRescaler (line 502) | class LatentRescaler(nn.Module): method __init__ (line 503) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 527) | def forward(self, x): class MergedRescaleEncoder (line 540) | class MergedRescaleEncoder(nn.Module): method __init__ (line 541) | def __init__(self, in_channels, ch, out_ch, num_res_blocks, method forward (line 552) | def forward(self, x): class MergedRescaleDecoder (line 558) | class MergedRescaleDecoder(nn.Module): method __init__ (line 559) | def __init__(self, z_channels, out_ch, num_res_blocks, attn_levels, ch... method forward (line 569) | def forward(self, x): class Upsampler (line 575) | class Upsampler(nn.Module): method __init__ (line 576) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 589) | def forward(self, x): class Resize (line 595) | class Resize(nn.Module): method __init__ (line 596) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 611) | def forward(self, x, scale_factor=1.0): class FirstStagePostProcessor (line 619) | class FirstStagePostProcessor(nn.Module): method __init__ (line 621) | def __init__(self, ch_mult: list, in_channels, method instantiate_pretrained (line 655) | def instantiate_pretrained(self, config): method encode_with_pretrained (line 663) | def encode_with_pretrained(self, x): method forward (line 669) | def forward(self, x): FILE: lidm/modules/diffusion/openaimodel.py function convert_module_to_f16 (line 22) | def convert_module_to_f16(x): function convert_module_to_f32 (line 26) | def convert_module_to_f32(x): class AttentionPool2d (line 31) | class AttentionPool2d(nn.Module): method __init__ (line 36) | def __init__( method forward (line 50) | def forward(self, x): class TimestepBlock (line 61) | class TimestepBlock(nn.Module): method forward (line 67) | def forward(self, x, emb): class TimestepEmbedSequential (line 73) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 79) | def forward(self, x, emb, context=None): class Upsample (line 90) | class Upsample(nn.Module): method __init__ (line 99) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 108) | def forward(self, x): class TransposedUpsample (line 121) | class TransposedUpsample(nn.Module): method __init__ (line 124) | def __init__(self, channels, out_channels=None, ks=5): method forward (line 131) | def forward(self, x): class Downsample (line 135) | class Downsample(nn.Module): method __init__ (line 144) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 159) | def forward(self, x): class ResBlock (line 164) | class ResBlock(TimestepBlock): method __init__ (line 180) | def __init__( method forward (line 245) | def forward(self, x, emb): method _forward (line 256) | def _forward(self, x, emb): class AttentionBlock (line 279) | class AttentionBlock(nn.Module): method __init__ (line 286) | def __init__( method forward (line 315) | def forward(self, x): method _forward (line 320) | def _forward(self, x): function count_flops_attn (line 329) | def count_flops_attn(model, _x, y): class QKVAttentionLegacy (line 349) | class QKVAttentionLegacy(nn.Module): method __init__ (line 354) | def __init__(self, n_heads): method forward (line 358) | def forward(self, qkv): method count_flops (line 377) | def count_flops(model, _x, y): class QKVAttention (line 381) | class QKVAttention(nn.Module): method __init__ (line 386) | def __init__(self, n_heads): method forward (line 390) | def forward(self, qkv): method count_flops (line 411) | def count_flops(model, _x, y): class UNetModel (line 415) | class UNetModel(nn.Module): method __init__ (line 445) | def __init__( method convert_to_fp16 (line 703) | def convert_to_fp16(self): method convert_to_fp32 (line 711) | def convert_to_fp32(self): method forward (line 719) | def forward(self, x, timesteps=None, context=None, y=None, **kwargs): class EncoderUNetModel (line 754) | class EncoderUNetModel(nn.Module): method __init__ (line 760) | def __init__( method convert_to_fp16 (line 935) | def convert_to_fp16(self): method convert_to_fp32 (line 942) | def convert_to_fp32(self): method forward (line 949) | def forward(self, x, timesteps): FILE: lidm/modules/distributions/distributions.py class AbstractDistribution (line 5) | class AbstractDistribution: method sample (line 6) | def sample(self): method mode (line 9) | def mode(self): class DiracDistribution (line 13) | class DiracDistribution(AbstractDistribution): method __init__ (line 14) | def __init__(self, value): method sample (line 17) | def sample(self): method mode (line 20) | def mode(self): class DiagonalGaussianDistribution (line 24) | class DiagonalGaussianDistribution(object): method __init__ (line 25) | def __init__(self, parameters, deterministic=False): method sample (line 35) | def sample(self): method kl (line 39) | def kl(self, other=None): method nll (line 53) | def nll(self, sample, dims=[1,2,3]): method mode (line 61) | def mode(self): function normal_kl (line 65) | def normal_kl(mean1, logvar1, mean2, logvar2): FILE: lidm/modules/ema.py class LitEma (line 5) | class LitEma(nn.Module): method __init__ (line 6) | def __init__(self, model, decay=0.9999, use_num_upates=True): method forward (line 25) | def forward(self, model): method copy_to (line 46) | def copy_to(self, model): method store (line 55) | def store(self, parameters): method restore (line 64) | def restore(self, parameters): FILE: lidm/modules/encoders/modules.py class AbstractEncoder (line 11) | class AbstractEncoder(nn.Module): method __init__ (line 12) | def __init__(self): method encode (line 15) | def encode(self, *args, **kwargs): class ClassEmbedder (line 19) | class ClassEmbedder(nn.Module): method __init__ (line 20) | def __init__(self, embed_dim, n_classes=1000, key='class'): method forward (line 25) | def forward(self, batch, key=None): class TransformerEmbedder (line 34) | class TransformerEmbedder(AbstractEncoder): method __init__ (line 37) | def __init__(self, n_embed, n_layer, vocab_size, max_seq_len=77, devic... method forward (line 43) | def forward(self, tokens): method encode (line 48) | def encode(self, x): class BERTTokenizer (line 52) | class BERTTokenizer(AbstractEncoder): method __init__ (line 55) | def __init__(self, device="cuda", vq_interface=True, max_length=77): method forward (line 64) | def forward(self, text): method encode (line 71) | def encode(self, text): method decode (line 77) | def decode(self, text): class BERTEmbedder (line 81) | class BERTEmbedder(AbstractEncoder): method __init__ (line 84) | def __init__(self, n_embed, n_layer, vocab_size=30522, max_seq_len=77, method forward (line 95) | def forward(self, text): method encode (line 103) | def encode(self, text): class SpatialRescaler (line 108) | class SpatialRescaler(nn.Module): method __init__ (line 109) | def __init__(self, method forward (line 124) | def forward(self, x): method encode (line 132) | def encode(self, x): class FrozenCLIPTextEmbedder (line 136) | class FrozenCLIPTextEmbedder(nn.Module): method __init__ (line 141) | def __init__(self, version='ViT-L/14', device="cuda", max_length=77, n... method freeze (line 150) | def freeze(self): method forward (line 155) | def forward(self, text): method encode (line 162) | def encode(self, text): class FrozenClipMultiTextEmbedder (line 170) | class FrozenClipMultiTextEmbedder(FrozenCLIPTextEmbedder): method __init__ (line 171) | def __init__(self, num_views=1, apply_all=False, **kwargs): method encode (line 176) | def encode(self, text): class FrozenClipImageEmbedder (line 190) | class FrozenClipImageEmbedder(nn.Module): method __init__ (line 195) | def __init__( method init (line 211) | def init(self): method preprocess (line 216) | def preprocess(self, x): method forward (line 226) | def forward(self, x): class FrozenClipMultiImageEmbedder (line 231) | class FrozenClipMultiImageEmbedder(FrozenClipImageEmbedder): method __init__ (line 236) | def __init__(self, num_views=1, split_per_view=1, img_dim=768, out_dim... method forward (line 243) | def forward(self, x): class FrozenClipImagePatchEmbedder (line 261) | class FrozenClipImagePatchEmbedder(nn.Module): method __init__ (line 266) | def __init__( method init (line 289) | def init(self): method preprocess (line 294) | def preprocess(self, x): method encode_image_patch (line 304) | def encode_image_patch(self, x): method forward (line 321) | def forward(self, x): FILE: lidm/modules/image_degradation/bsrgan.py function modcrop_np (line 29) | def modcrop_np(img, sf): function analytic_kernel (line 49) | def analytic_kernel(k): function anisotropic_Gaussian (line 65) | def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6): function gm_blur_kernel (line 86) | def gm_blur_kernel(mean, cov, size=15): function shift_pixel (line 99) | def shift_pixel(x, sf, upper_left=True): function blur (line 128) | def blur(x, k): function gen_kernel (line 145) | def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]),... function fspecial_gaussian (line 187) | def fspecial_gaussian(hsize, sigma): function fspecial_laplacian (line 201) | def fspecial_laplacian(alpha): function fspecial (line 210) | def fspecial(filter_type, *args, **kwargs): function bicubic_degradation (line 228) | def bicubic_degradation(x, sf=3): function srmd_degradation (line 240) | def srmd_degradation(x, k, sf=3): function dpsr_degradation (line 262) | def dpsr_degradation(x, k, sf=3): function classical_degradation (line 284) | def classical_degradation(x, k, sf=3): function add_sharpening (line 299) | def add_sharpening(img, weight=0.5, radius=50, threshold=10): function add_blur (line 325) | def add_blur(img, sf=4): function add_resize (line 339) | def add_resize(img, sf=4): function add_Gaussian_noise (line 369) | def add_Gaussian_noise(img, noise_level1=2, noise_level2=25): function add_speckle_noise (line 386) | def add_speckle_noise(img, noise_level1=2, noise_level2=25): function add_Poisson_noise (line 404) | def add_Poisson_noise(img): function add_JPEG_noise (line 418) | def add_JPEG_noise(img): function random_crop (line 427) | def random_crop(lq, hq, sf=4, lq_patchsize=64): function degradation_bsrgan (line 438) | def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None): function degradation_bsrgan_variant (line 530) | def degradation_bsrgan_variant(image, sf=4, isp_model=None): function degradation_bsrgan_plus (line 617) | def degradation_bsrgan_plus(img, sf=4, shuffle_prob=0.5, use_sharp=True,... FILE: lidm/modules/image_degradation/bsrgan_light.py function modcrop_np (line 29) | def modcrop_np(img, sf): function analytic_kernel (line 49) | def analytic_kernel(k): function anisotropic_Gaussian (line 65) | def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6): function gm_blur_kernel (line 86) | def gm_blur_kernel(mean, cov, size=15): function shift_pixel (line 99) | def shift_pixel(x, sf, upper_left=True): function blur (line 128) | def blur(x, k): function gen_kernel (line 145) | def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]),... function fspecial_gaussian (line 187) | def fspecial_gaussian(hsize, sigma): function fspecial_laplacian (line 201) | def fspecial_laplacian(alpha): function fspecial (line 210) | def fspecial(filter_type, *args, **kwargs): function bicubic_degradation (line 228) | def bicubic_degradation(x, sf=3): function srmd_degradation (line 240) | def srmd_degradation(x, k, sf=3): function dpsr_degradation (line 262) | def dpsr_degradation(x, k, sf=3): function classical_degradation (line 284) | def classical_degradation(x, k, sf=3): function add_sharpening (line 299) | def add_sharpening(img, weight=0.5, radius=50, threshold=10): function add_blur (line 325) | def add_blur(img, sf=4): function add_resize (line 343) | def add_resize(img, sf=4): function add_Gaussian_noise (line 373) | def add_Gaussian_noise(img, noise_level1=2, noise_level2=25): function add_speckle_noise (line 390) | def add_speckle_noise(img, noise_level1=2, noise_level2=25): function add_Poisson_noise (line 408) | def add_Poisson_noise(img): function add_JPEG_noise (line 422) | def add_JPEG_noise(img): function random_crop (line 431) | def random_crop(lq, hq, sf=4, lq_patchsize=64): function degradation_bsrgan (line 442) | def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None): function degradation_bsrgan_variant (line 534) | def degradation_bsrgan_variant(image, sf=4, isp_model=None): FILE: lidm/modules/image_degradation/utils_image.py function is_image_file (line 29) | def is_image_file(filename): function get_timestamp (line 33) | def get_timestamp(): function imshow (line 37) | def imshow(x, title=None, cbar=False, figsize=None): function surf (line 47) | def surf(Z, cmap='rainbow', figsize=None): function get_image_paths (line 67) | def get_image_paths(dataroot): function _get_paths_from_images (line 74) | def _get_paths_from_images(path): function patches_from_image (line 93) | def patches_from_image(img, p_size=512, p_overlap=64, p_max=800): function imssave (line 112) | def imssave(imgs, img_path): function split_imageset (line 125) | def split_imageset(original_dataroot, taget_dataroot, n_channels=3, p_si... function mkdir (line 153) | def mkdir(path): function mkdirs (line 158) | def mkdirs(paths): function mkdir_and_rename (line 166) | def mkdir_and_rename(path): function imread_uint (line 185) | def imread_uint(path, n_channels=3): function imsave (line 203) | def imsave(img, img_path): function imwrite (line 209) | def imwrite(img, img_path): function read_img (line 220) | def read_img(path): function uint2single (line 249) | def uint2single(img): function single2uint (line 254) | def single2uint(img): function uint162single (line 259) | def uint162single(img): function single2uint16 (line 264) | def single2uint16(img): function uint2tensor4 (line 275) | def uint2tensor4(img): function uint2tensor3 (line 282) | def uint2tensor3(img): function tensor2uint (line 289) | def tensor2uint(img): function single2tensor3 (line 302) | def single2tensor3(img): function single2tensor4 (line 307) | def single2tensor4(img): function tensor2single (line 312) | def tensor2single(img): function tensor2single3 (line 320) | def tensor2single3(img): function single2tensor5 (line 329) | def single2tensor5(img): function single32tensor5 (line 333) | def single32tensor5(img): function single42tensor4 (line 337) | def single42tensor4(img): function tensor2img (line 342) | def tensor2img(tensor, out_type=np.uint8, min_max=(0, 1)): function augment_img (line 380) | def augment_img(img, mode=0): function augment_img_tensor4 (line 401) | def augment_img_tensor4(img, mode=0): function augment_img_tensor (line 422) | def augment_img_tensor(img, mode=0): function augment_img_np3 (line 441) | def augment_img_np3(img, mode=0): function augment_imgs (line 469) | def augment_imgs(img_list, hflip=True, rot=True): function modcrop (line 494) | def modcrop(img_in, scale): function shave (line 510) | def shave(img_in, border=0): function rgb2ycbcr (line 529) | def rgb2ycbcr(img, only_y=True): function ycbcr2rgb (line 553) | def ycbcr2rgb(img): function bgr2ycbcr (line 573) | def bgr2ycbcr(img, only_y=True): function channel_convert (line 597) | def channel_convert(in_c, tar_type, img_list): function calculate_psnr (line 621) | def calculate_psnr(img1, img2, border=0): function calculate_ssim (line 642) | def calculate_ssim(img1, img2, border=0): function ssim (line 669) | def ssim(img1, img2): function cubic (line 700) | def cubic(x): function calculate_weights_indices (line 708) | def calculate_weights_indices(in_length, out_length, scale, kernel, kern... function imresize (line 766) | def imresize(img, scale, antialiasing=True): function imresize_np (line 839) | def imresize_np(img, scale, antialiasing=True): FILE: lidm/modules/losses/__init__.py function adopt_weight (line 6) | def adopt_weight(weight, global_step, threshold=0, value=0.): function hinge_d_loss (line 12) | def hinge_d_loss(logits_real, logits_fake): function vanilla_d_loss (line 19) | def vanilla_d_loss(logits_real, logits_fake): function measure_perplexity (line 26) | def measure_perplexity(predicted_indices, n_embed): function l1 (line 36) | def l1(x, y): function l2 (line 40) | def l2(x, y): function square_dist_loss (line 44) | def square_dist_loss(x, y): function weights_init (line 48) | def weights_init(m): FILE: lidm/modules/losses/contperceptual.py class LPIPSWithDiscriminator (line 9) | class LPIPSWithDiscriminator(nn.Module): method __init__ (line 10) | def __init__(self, disc_start, logvar_init=0.0, kl_weight=1.0, pixello... method calculate_adaptive_weight (line 33) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 46) | def forward(self, inputs, reconstructions, posteriors, optimizer_idx, FILE: lidm/modules/losses/discriminator.py class NLayerDiscriminator (line 8) | class NLayerDiscriminator(nn.Module): method __init__ (line 12) | def __init__(self, input_nc=1, output_nc=1, ndf=64, n_layers=3, use_ac... method forward (line 55) | def forward(self, input): class LiDARNLayerDiscriminator (line 60) | class LiDARNLayerDiscriminator(nn.Module): method __init__ (line 64) | def __init__(self, input_nc=1, output_nc=1, ndf=64, n_layers=3, use_ac... method forward (line 107) | def forward(self, input): class LiDARNLayerDiscriminatorV2 (line 112) | class LiDARNLayerDiscriminatorV2(nn.Module): method __init__ (line 116) | def __init__(self, input_nc=1, output_nc=1, ndf=64, n_layers=3, use_ac... method forward (line 160) | def forward(self, input): class LiDARNLayerDiscriminatorV3 (line 165) | class LiDARNLayerDiscriminatorV3(nn.Module): method __init__ (line 169) | def __init__(self, input_nc=1, output_nc=1, ndf=64, n_layers=3, use_ac... method forward (line 213) | def forward(self, input): FILE: lidm/modules/losses/geometric.py class GeoConverter (line 9) | class GeoConverter(nn.Module): method __init__ (line 10) | def __init__(self, curve_length=4, bev_only=False, dataset_config=dict... method register_conversion (line 26) | def register_conversion(self): method batch_range2xyz (line 41) | def batch_range2xyz(self, imgs): method batch_range2bev (line 54) | def batch_range2bev(self, imgs): method curve_compress (line 66) | def curve_compress(self, batch_coord): method forward (line 71) | def forward(self, input): FILE: lidm/modules/losses/perceptual.py function download (line 31) | def download(url, local_path, chunk_size=1024): function md5_hash (line 43) | def md5_hash(path): function get_ckpt_path (line 49) | def get_ckpt_path(name, root, check=False): class NetLinLayer (line 60) | class NetLinLayer(nn.Module): method __init__ (line 63) | def __init__(self, chn_in, chn_out=1, use_dropout=False): class PerceptualLoss (line 70) | class PerceptualLoss(nn.Module): method __init__ (line 71) | def __init__(self, ptype, depth_scale, log_scale=True, use_dropout=Tru... method normalize_tensor (line 90) | def normalize_tensor(x, eps=1e-10): method spatial_average (line 95) | def spatial_average(x, keepdim=True): method preprocess (line 98) | def preprocess(self, *inputs): method forward (line 110) | def forward(self, target, input): FILE: lidm/modules/losses/vqperceptual.py class VQGeoLPIPSWithDiscriminator (line 12) | class VQGeoLPIPSWithDiscriminator(nn.Module): method __init__ (line 13) | def __init__(self, disc_start, codebook_weight=1.0, pixelloss_weight=1.0, method calculate_adaptive_weight (line 69) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 82) | def forward(self, codebook_loss, inputs, reconstructions, optimizer_idx, FILE: lidm/modules/minkowskinet/model.py class Model (line 12) | class Model(nn.Module): method __init__ (line 13) | def __init__(self, config): method weight_initialization (line 94) | def weight_initialization(self): method forward (line 100) | def forward(self, data_dict, return_logits=False, return_final_logits=... FILE: lidm/modules/rangenet/model.py class BasicBlock (line 10) | class BasicBlock(nn.Module): method __init__ (line 11) | def __init__(self, inplanes, planes, bn_d=0.1): method forward (line 22) | def forward(self, x): class Backbone (line 46) | class Backbone(nn.Module): method __init__ (line 51) | def __init__(self, params): method _make_enc_layer (line 126) | def _make_enc_layer(self, block, planes, blocks, stride, bn_d=0.1): method run_layer (line 145) | def run_layer(self, x, layer, skips, os): method forward (line 153) | def forward(self, x, return_logits=False, return_list=None): method get_last_depth (line 203) | def get_last_depth(self): method get_input_depth (line 206) | def get_input_depth(self): class Decoder (line 210) | class Decoder(nn.Module): method __init__ (line 215) | def __init__(self, params, OS=32, feature_depth=1024): method _make_dec_layer (line 261) | def _make_dec_layer(self, block, planes, bn_d=0.1, stride=2): method run_layer (line 280) | def run_layer(self, x, layer, skips, os): method forward (line 288) | def forward(self, x, skips, return_logits=False, return_list=None): method get_last_depth (line 318) | def get_last_depth(self): class Model (line 322) | class Model(nn.Module): method __init__ (line 323) | def __init__(self, config): method load_pretrained_weights (line 330) | def load_pretrained_weights(self, path): method forward (line 338) | def forward(self, x, return_logits=False, return_final_logits=False, r... FILE: lidm/modules/spvcnn/model.py class Model (line 13) | class Model(nn.Module): method __init__ (line 14) | def __init__(self, config): method weight_initialization (line 112) | def weight_initialization(self): method forward (line 118) | def forward(self, data_dict, return_logits=False, return_final_logits=... FILE: lidm/modules/ts/basic_blocks.py class BasicConvolutionBlock (line 12) | class BasicConvolutionBlock(nn.Module): method __init__ (line 13) | def __init__(self, inc, outc, ks=3, stride=1, dilation=1): method forward (line 24) | def forward(self, x): class BasicDeconvolutionBlock (line 29) | class BasicDeconvolutionBlock(nn.Module): method __init__ (line 30) | def __init__(self, inc, outc, ks=3, stride=1): method forward (line 42) | def forward(self, x): class ResidualBlock (line 46) | class ResidualBlock(nn.Module): method __init__ (line 47) | def __init__(self, inc, outc, ks=3, stride=1, dilation=1): method forward (line 73) | def forward(self, x): FILE: lidm/modules/ts/utils.py function initial_voxelize (line 11) | def initial_voxelize(z, init_res, after_res): function point_to_voxel (line 34) | def point_to_voxel(x, z): function voxel_to_point (line 59) | def voxel_to_point(x, z, nearest=False): FILE: lidm/modules/x_transformer.py class AbsolutePositionalEmbedding (line 25) | class AbsolutePositionalEmbedding(nn.Module): method __init__ (line 26) | def __init__(self, dim, max_seq_len): method init_ (line 31) | def init_(self): method forward (line 34) | def forward(self, x): class FixedPositionalEmbedding (line 39) | class FixedPositionalEmbedding(nn.Module): method __init__ (line 40) | def __init__(self, dim): method forward (line 45) | def forward(self, x, seq_dim=1, offset=0): function exists (line 54) | def exists(val): function default (line 58) | def default(val, d): function always (line 64) | def always(val): function not_equals (line 71) | def not_equals(val): function equals (line 78) | def equals(val): function max_neg_value (line 85) | def max_neg_value(tensor): function pick_and_pop (line 91) | def pick_and_pop(keys, d): function group_dict_by_key (line 96) | def group_dict_by_key(cond, d): function string_begins_with (line 105) | def string_begins_with(prefix, str): function group_by_key_prefix (line 109) | def group_by_key_prefix(prefix, d): function groupby_prefix_and_trim (line 113) | def groupby_prefix_and_trim(prefix, d): class Scale (line 120) | class Scale(nn.Module): method __init__ (line 121) | def __init__(self, value, fn): method forward (line 126) | def forward(self, x, **kwargs): class Rezero (line 131) | class Rezero(nn.Module): method __init__ (line 132) | def __init__(self, fn): method forward (line 137) | def forward(self, x, **kwargs): class ScaleNorm (line 142) | class ScaleNorm(nn.Module): method __init__ (line 143) | def __init__(self, dim, eps=1e-5): method forward (line 149) | def forward(self, x): class RMSNorm (line 154) | class RMSNorm(nn.Module): method __init__ (line 155) | def __init__(self, dim, eps=1e-8): method forward (line 161) | def forward(self, x): class Residual (line 166) | class Residual(nn.Module): method forward (line 167) | def forward(self, x, residual): class GRUGating (line 171) | class GRUGating(nn.Module): method __init__ (line 172) | def __init__(self, dim): method forward (line 176) | def forward(self, x, residual): class GEGLU (line 187) | class GEGLU(nn.Module): method __init__ (line 188) | def __init__(self, dim_in, dim_out): method forward (line 192) | def forward(self, x): class FeedForward (line 197) | class FeedForward(nn.Module): method __init__ (line 198) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 213) | def forward(self, x): class Attention (line 218) | class Attention(nn.Module): method __init__ (line 219) | def __init__( method forward (line 271) | def forward( class AttentionLayers (line 373) | class AttentionLayers(nn.Module): method __init__ (line 374) | def __init__( method forward (line 484) | def forward( class Encoder (line 544) | class Encoder(AttentionLayers): method __init__ (line 545) | def __init__(self, **kwargs): class TransformerWrapper (line 550) | class TransformerWrapper(nn.Module): method __init__ (line 551) | def __init__( method init_ (line 597) | def init_(self): method forward (line 600) | def forward( FILE: lidm/utils/aug_utils.py function get_lidar_transform (line 4) | def get_lidar_transform(config, split): function get_camera_transform (line 13) | def get_camera_transform(config, split): function get_anno_transform (line 21) | def get_anno_transform(config, split): class Compose (line 30) | class Compose(object): method __init__ (line 31) | def __init__(self, transforms): method __call__ (line 34) | def __call__(self, pcd, pcd1=None): class RandomFlip (line 40) | class RandomFlip(object): method __init__ (line 41) | def __init__(self, p=1.): method __call__ (line 44) | def __call__(self, coord, coord1=None): class RandomRotateAligned (line 57) | class RandomRotateAligned(object): method __init__ (line 58) | def __init__(self, rot=np.pi / 4, p=1.): method __call__ (line 62) | def __call__(self, coord, coord1=None): class RandomKeypointDrop (line 73) | class RandomKeypointDrop(object): method __init__ (line 74) | def __init__(self, num_range=(5, 60), p=.5): method __call__ (line 78) | def __call__(self, center, category=None): FILE: lidm/utils/lidar_utils.py function pcd2coord2d (line 6) | def pcd2coord2d(pcd, fov, depth_range, labels=None): function pcd2range (line 41) | def pcd2range(pcd, size, fov, depth_range, remission=None, labels=None, ... function range2pcd (line 97) | def range2pcd(range_img, fov, depth_range, depth_scale, log_scale=True, ... function range2xyz (line 138) | def range2xyz(range_img, fov, depth_range, depth_scale, log_scale=True, ... function pcd2bev (line 170) | def pcd2bev(pcd, x_range, y_range, z_range, resolution, **kwargs): FILE: lidm/utils/lr_scheduler.py class LambdaWarmUpCosineScheduler (line 4) | class LambdaWarmUpCosineScheduler: method __init__ (line 8) | def __init__(self, warm_up_steps, lr_min, lr_max, lr_start, max_decay_... method schedule (line 17) | def schedule(self, n, **kwargs): method __call__ (line 32) | def __call__(self, n, **kwargs): class LambdaWarmUpCosineScheduler2 (line 36) | class LambdaWarmUpCosineScheduler2: method __init__ (line 41) | def __init__(self, warm_up_steps, f_min, f_max, f_start, cycle_lengths... method find_in_interval (line 52) | def find_in_interval(self, n): method schedule (line 59) | def schedule(self, n, **kwargs): method __call__ (line 77) | def __call__(self, n, **kwargs): class LambdaLinearScheduler (line 81) | class LambdaLinearScheduler(LambdaWarmUpCosineScheduler2): method schedule (line 83) | def schedule(self, n, **kwargs): FILE: lidm/utils/misc_utils.py function set_seed (line 19) | def set_seed(seed): function print_fn (line 35) | def print_fn(msg, verbose): function dict2namespace (line 40) | def dict2namespace(config): function log_txt_as_img (line 51) | def log_txt_as_img(wh, xc, size=10): function isdepth (line 75) | def isdepth(x): function ismap (line 81) | def ismap(x): function isimage (line 87) | def isimage(x): function exists (line 93) | def exists(x): function default (line 97) | def default(val, d): function mean_flat (line 103) | def mean_flat(tensor): function count_params (line 111) | def count_params(model, verbose=False): function instantiate_from_config (line 118) | def instantiate_from_config(config): function get_obj_from_str (line 128) | def get_obj_from_str(string, reload=False): function _do_parallel_data_prefetch (line 136) | def _do_parallel_data_prefetch(func, Q, data, idx, idx_to_fn=False): function parallel_data_prefetch (line 148) | def parallel_data_prefetch( FILE: lidm/utils/model_utils.py function build_model (line 18) | def build_model(dataset_name, model_name, device='cpu'): FILE: main.py function get_parser (line 32) | def get_parser(**parser_kwargs): function nondefault_trainer_args (line 134) | def nondefault_trainer_args(opt): class WrappedDataset (line 141) | class WrappedDataset(Dataset): method __init__ (line 144) | def __init__(self, dataset): method __len__ (line 147) | def __len__(self): method __getitem__ (line 150) | def __getitem__(self, idx): function worker_init_fn (line 154) | def worker_init_fn(_): class DataModuleFromConfig (line 170) | class DataModuleFromConfig(pl.LightningDataModule): method __init__ (line 171) | def __init__(self, batch_size, train=None, validation=None, test=None,... method prepare_data (line 199) | def prepare_data(self): method setup (line 203) | def setup(self, stage=None): method _train_dataloader (line 209) | def _train_dataloader(self): method _val_dataloader (line 219) | def _val_dataloader(self, shuffle=False): method _test_dataloader (line 230) | def _test_dataloader(self, shuffle=False): method _predict_dataloader (line 243) | def _predict_dataloader(self, shuffle=False): class SetupCallback (line 252) | class SetupCallback(Callback): method __init__ (line 253) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_keyboard_interrupt (line 263) | def on_keyboard_interrupt(self, trainer, pl_module): method on_pretrain_routine_start (line 269) | def on_pretrain_routine_start(self, trainer, pl_module): class ImageLogger (line 301) | class ImageLogger(Callback): method __init__ (line 302) | def __init__(self, batch_frequency, max_images, clamp=True, increase_l... method _testtube (line 323) | def _testtube(self, pl_module, images, batch_idx, split): method log_local (line 334) | def log_local(self, save_dir, split, images, method log_img (line 362) | def log_img(self, pl_module, batch, batch_idx, split="train"): method check_frequency (line 394) | def check_frequency(self, check_idx, split): method on_train_batch_end (line 406) | def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch... method on_validation_batch_end (line 410) | def on_validation_batch_end(self, trainer, pl_module, outputs, batch, ... class CUDACallback (line 418) | class CUDACallback(Callback): method on_train_epoch_start (line 420) | def on_train_epoch_start(self, trainer, pl_module): method on_train_epoch_end (line 426) | def on_train_epoch_end(self, trainer, pl_module, outputs): function melk (line 729) | def melk(*args, **kwargs): function divein (line 737) | def divein(*args, **kwargs): FILE: scripts/eval_ae.py function custom_to_pcd (line 38) | def custom_to_pcd(x, config, rgb=None): function custom_to_pil (line 50) | def custom_to_pil(x): function custom_to_np (line 62) | def custom_to_np(x): function logs2pil (line 69) | def logs2pil(logs, keys=["sample"]): function run (line 86) | def run(model, dataloader, imglogdir, pcdlogdir, nplog=None, config=None... function save_logs (line 104) | def save_logs(logs, imglogdir, pcdlogdir, num, n_saved=0, key_list=None,... function get_parser (line 121) | def get_parser(): function load_model_from_config (line 177) | def load_model_from_config(config, sd): function load_model (line 185) | def load_model(config, ckpt): function test_collate_fn (line 198) | def test_collate_fn(data): FILE: scripts/sample.py function custom_to_pcd (line 29) | def custom_to_pcd(x, config): function custom_to_pil (line 38) | def custom_to_pil(x): function custom_to_np (line 48) | def custom_to_np(x): function logs2pil (line 55) | def logs2pil(logs, keys=["samples"]): function convsample (line 73) | def convsample(model, shape, return_intermediates=True, verbose=True, ma... function convsample_ddim (line 81) | def convsample_ddim(model, steps, shape, eta=1.0, verbose=False): function make_convolutional_sample (line 90) | def make_convolutional_sample(model, batch_size, image_size=None, vanill... function run (line 113) | def run(model, imglogdir, pcdlogdir, batch_size=50, image_size=None, van... function save_logs (line 141) | def save_logs(logs, imglogdir, pcdlogdir, n_saved=0, key="samples", np_p... function get_parser (line 165) | def get_parser(): function load_model_from_config (line 268) | def load_model_from_config(config, sd): function load_model (line 276) | def load_model(config, ckpt): function visualize (line 289) | def visualize(samples, logdir): function test_collate_fn (line 298) | def test_collate_fn(data): FILE: scripts/sample_cond.py function custom_to_pcd (line 32) | def custom_to_pcd(x, config, rgb=None): function custom_to_pil (line 44) | def custom_to_pil(x): function logs2pil (line 56) | def logs2pil(logs, keys=["sample"]): function run (line 73) | def run(model, dataloader, imglogdir, pcdlogdir, nplog=None, config=None... function save_logs (line 91) | def save_logs(logs, imglogdir, pcdlogdir, num, n_saved=0, key_list=None,... function get_parser (line 115) | def get_parser(): function load_model_from_config (line 205) | def load_model_from_config(config, sd): function load_model (line 213) | def load_model(config, ckpt): function visualize (line 225) | def visualize(samples, logdir): function test_collate_fn (line 234) | def test_collate_fn(data): function traverse_collate_fn (line 247) | def traverse_collate_fn(data): FILE: scripts/text2lidar.py function custom_to_pcd (line 32) | def custom_to_pcd(x, config, rgb=None): function custom_to_pil (line 44) | def custom_to_pil(x): function custom_to_np (line 56) | def custom_to_np(x): function logs2pil (line 63) | def logs2pil(logs, keys=["sample"]): function convsample (line 81) | def convsample(model, cond, shape, return_intermediates=True, verbose=Tr... function convsample_ddim (line 89) | def convsample_ddim(model, cond, steps, shape, eta=1.0, verbose=False): function make_convolutional_sample (line 98) | def make_convolutional_sample(model, cond, batch_size, vanilla=False, cu... function run (line 121) | def run(model, text_encoder, prompt, imglogdir, pcdlogdir, custom_steps=... function save_logs (line 142) | def save_logs(logs, imglogdir, pcdlogdir, n_saved=0, key="sample", np_pa... function get_parser (line 158) | def get_parser(): function load_model_from_config (line 259) | def load_model_from_config(config, sd): function load_model (line 267) | def load_model(config, ckpt): function build_text_encoder (line 279) | def build_text_encoder(num_views, apply_all): function visualize (line 285) | def visualize(samples, logdir): function test_collate_fn (line 294) | def test_collate_fn(data):