SYMBOL INDEX (767 symbols across 73 files) FILE: dataset/dataloader.py function region_draw_text (line 21) | def region_draw_text(H, W, r_bbox, text, font_path = "./dataset/utils/ar... function initialize_word_dict (line 46) | def initialize_word_dict(): class LabelDataset (line 63) | class LabelDataset(data.Dataset): method __init__ (line 65) | def __init__(self, size, length, font_path, min_len, max_len) -> None: method __len__ (line 83) | def __len__(self): method __getitem__ (line 87) | def __getitem__(self, index): class ICDAR13Dataset (line 123) | class ICDAR13Dataset(data.Dataset): method __init__ (line 125) | def __init__(self, cfgs, datype) -> None: method __len__ (line 177) | def __len__(self): method augment (line 181) | def augment(self, image, bbox): method __getitem__ (line 242) | def __getitem__(self, index): class TextSegDataset (line 292) | class TextSegDataset(data.Dataset): method __init__ (line 294) | def __init__(self, cfgs, datype) -> None: method __len__ (line 352) | def __len__(self): method augment (line 356) | def augment(self, image, seg, text, bbox, seg_values): method __getitem__ (line 436) | def __getitem__(self, index): class SynthTextDataset (line 494) | class SynthTextDataset(data.Dataset): method __init__ (line 496) | def __init__(self, cfgs, datype) -> None: method __len__ (line 562) | def __len__(self): method augment (line 566) | def augment(self, image, bbox, seg_bboxs): method __getitem__ (line 645) | def __getitem__(self, index): class LAIONOCRDataset (line 697) | class LAIONOCRDataset(data.Dataset): method __init__ (line 699) | def __init__(self, cfgs, datype) -> None: method __len__ (line 766) | def __len__(self): method augment (line 770) | def augment(self, image, seg, text, bbox): method __getitem__ (line 861) | def __getitem__(self, index): function get_dataloader (line 925) | def get_dataloader(cfgs, datype="train"): FILE: demo.py function predict (line 15) | def predict(cfgs, model, sampler, batch): function demo_predict (line 39) | def demo_predict(input_blk, text, num_samples, steps, scale, seed, show_... FILE: metrics.py function calc_fid (line 5) | def calc_fid(fake_dir, real_dir, batch_size=1, gpu='0'): function calc_lpips (line 12) | def calc_lpips(fake_dir, real_dir): FILE: pretrain.py function get_dataloader (line 9) | def get_dataloader(cfgs): function get_model (line 16) | def get_model(cfgs): function train (line 24) | def train(cfgs): FILE: sgm/lr_scheduler.py class LambdaWarmUpCosineScheduler (line 4) | class LambdaWarmUpCosineScheduler: method __init__ (line 9) | def __init__( method schedule (line 26) | def schedule(self, n, **kwargs): method __call__ (line 47) | def __call__(self, n, **kwargs): class LambdaWarmUpCosineScheduler2 (line 51) | class LambdaWarmUpCosineScheduler2: method __init__ (line 57) | def __init__( method find_in_interval (line 76) | def find_in_interval(self, n): method schedule (line 83) | def schedule(self, n, **kwargs): method __call__ (line 109) | def __call__(self, n, **kwargs): class LambdaLinearScheduler (line 113) | class LambdaLinearScheduler(LambdaWarmUpCosineScheduler2): method schedule (line 114) | def schedule(self, n, **kwargs): FILE: sgm/models/autoencoder.py class AbstractAutoencoder (line 18) | class AbstractAutoencoder(pl.LightningModule): method __init__ (line 25) | def __init__( method init_from_ckpt (line 49) | def init_from_ckpt( method get_input (line 75) | def get_input(self, batch) -> Any: method on_train_batch_end (line 78) | def on_train_batch_end(self, *args, **kwargs): method ema_scope (line 84) | def ema_scope(self, context=None): method encode (line 99) | def encode(self, *args, **kwargs) -> torch.Tensor: method decode (line 103) | def decode(self, *args, **kwargs) -> torch.Tensor: method instantiate_optimizer_from_config (line 106) | def instantiate_optimizer_from_config(self, params, lr, cfg): method configure_optimizers (line 112) | def configure_optimizers(self) -> Any: class AutoencodingEngine (line 116) | class AutoencodingEngine(AbstractAutoencoder): method __init__ (line 123) | def __init__( method get_input (line 145) | def get_input(self, batch: Dict) -> torch.Tensor: method get_autoencoder_params (line 150) | def get_autoencoder_params(self) -> list: method get_discriminator_params (line 159) | def get_discriminator_params(self) -> list: method get_last_layer (line 163) | def get_last_layer(self): method encode (line 166) | def encode(self, x: Any, return_reg_log: bool = False) -> Any: method decode (line 173) | def decode(self, z: Any) -> torch.Tensor: method forward (line 177) | def forward(self, x: Any) -> Tuple[torch.Tensor, torch.Tensor, torch.T... method training_step (line 182) | def training_step(self, batch, batch_idx, optimizer_idx) -> Any: method validation_step (line 219) | def validation_step(self, batch, batch_idx) -> Dict: method _validation_step (line 226) | def _validation_step(self, batch, batch_idx, postfix="") -> Dict: method configure_optimizers (line 254) | def configure_optimizers(self) -> Any: method log_images (line 270) | def log_images(self, batch: Dict, **kwargs) -> Dict: class AutoencoderKL (line 282) | class AutoencoderKL(AutoencodingEngine): method __init__ (line 283) | def __init__(self, embed_dim: int, **kwargs): method encode (line 304) | def encode(self, x): method decode (line 313) | def decode(self, z, **decoder_kwargs): class AutoencoderKLInferenceWrapper (line 319) | class AutoencoderKLInferenceWrapper(AutoencoderKL): method encode (line 320) | def encode(self, x): class IdentityFirstStage (line 324) | class IdentityFirstStage(AbstractAutoencoder): method __init__ (line 325) | def __init__(self, *args, **kwargs): method get_input (line 328) | def get_input(self, x: Any) -> Any: method encode (line 331) | def encode(self, x: Any, *args, **kwargs) -> Any: method decode (line 334) | def decode(self, x: Any, *args, **kwargs) -> Any: FILE: sgm/models/diffusion.py class DiffusionEngine (line 22) | class DiffusionEngine(pl.LightningModule): method __init__ (line 23) | def __init__( method init_from_ckpt (line 87) | def init_from_ckpt( method freeze (line 107) | def freeze(self): method _init_first_stage (line 112) | def _init_first_stage(self, config): method get_input (line 119) | def get_input(self, batch): method decode_first_stage (line 125) | def decode_first_stage(self, z): method encode_first_stage (line 132) | def encode_first_stage(self, x): method forward (line 138) | def forward(self, x, batch): method shared_step (line 144) | def shared_step(self, batch: Dict) -> Any: method training_step (line 151) | def training_step(self, batch, batch_idx): method on_train_start (line 174) | def on_train_start(self, *args, **kwargs): method on_train_batch_end (line 178) | def on_train_batch_end(self, *args, **kwargs): method ema_scope (line 183) | def ema_scope(self, context=None): method instantiate_optimizer_from_config (line 197) | def instantiate_optimizer_from_config(self, params, lr, cfg): method configure_optimizers (line 202) | def configure_optimizers(self): method sample (line 225) | def sample( method log_conditionings (line 242) | def log_conditionings(self, batch: Dict, n: int) -> Dict: method log_images (line 281) | def log_images( FILE: sgm/modules/attention.py function exists (line 19) | def exists(val): function uniq (line 23) | def uniq(arr): function default (line 27) | def default(val, d): function max_neg_value (line 33) | def max_neg_value(t): function init_ (line 37) | def init_(tensor): class GEGLU (line 44) | class GEGLU(nn.Module): method __init__ (line 45) | def __init__(self, dim_in, dim_out): method forward (line 49) | def forward(self, x): class FeedForward (line 54) | class FeedForward(nn.Module): method __init__ (line 55) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.0): method forward (line 69) | def forward(self, x): function zero_module (line 73) | def zero_module(module): function Normalize (line 82) | def Normalize(in_channels): class LinearAttention (line 88) | class LinearAttention(nn.Module): method __init__ (line 89) | def __init__(self, dim, heads=4, dim_head=32): method forward (line 96) | def forward(self, x): class CrossAttention (line 111) | class CrossAttention(nn.Module): method __init__ (line 112) | def __init__( method forward (line 140) | def forward( class MemoryEfficientCrossAttention (line 177) | class MemoryEfficientCrossAttention(nn.Module): method __init__ (line 179) | def __init__( method forward (line 202) | def forward( class BasicTransformerBlock (line 265) | class BasicTransformerBlock(nn.Module): method __init__ (line 267) | def __init__( method forward (line 314) | def forward(self, x, t_context=None, v_context=None): class SpatialTransformer (line 344) | class SpatialTransformer(nn.Module): method __init__ (line 354) | def __init__( method forward (line 398) | def forward(self, x, t_context=None, v_context=None): FILE: sgm/modules/autoencoding/losses/__init__.py function adopt_weight (line 13) | def adopt_weight(weight, global_step, threshold=0, value=0.0): class LatentLPIPS (line 19) | class LatentLPIPS(nn.Module): method __init__ (line 20) | def __init__( method init_decoder (line 38) | def init_decoder(self, config): method forward (line 43) | def forward(self, latent_inputs, latent_predictions, image_inputs, spl... class GeneralLPIPSWithDiscriminator (line 87) | class GeneralLPIPSWithDiscriminator(nn.Module): method __init__ (line 88) | def __init__( method get_trainable_parameters (line 129) | def get_trainable_parameters(self) -> Any: method get_trainable_autoencoder_parameters (line 132) | def get_trainable_autoencoder_parameters(self) -> Any: method calculate_adaptive_weight (line 137) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 154) | def forward( FILE: sgm/modules/autoencoding/regularizers/__init__.py class AbstractRegularizer (line 11) | class AbstractRegularizer(nn.Module): method __init__ (line 12) | def __init__(self): method forward (line 15) | def forward(self, z: torch.Tensor) -> Tuple[torch.Tensor, dict]: method get_trainable_parameters (line 19) | def get_trainable_parameters(self) -> Any: class DiagonalGaussianRegularizer (line 23) | class DiagonalGaussianRegularizer(AbstractRegularizer): method __init__ (line 24) | def __init__(self, sample: bool = True): method get_trainable_parameters (line 28) | def get_trainable_parameters(self) -> Any: method forward (line 31) | def forward(self, z: torch.Tensor) -> Tuple[torch.Tensor, dict]: function measure_perplexity (line 44) | def measure_perplexity(predicted_indices, num_centroids): FILE: sgm/modules/diffusionmodules/denoiser.py class Denoiser (line 6) | class Denoiser(nn.Module): method __init__ (line 7) | def __init__(self, weighting_config, scaling_config): method possibly_quantize_sigma (line 13) | def possibly_quantize_sigma(self, sigma): method possibly_quantize_c_noise (line 16) | def possibly_quantize_c_noise(self, c_noise): method w (line 19) | def w(self, sigma): method __call__ (line 22) | def __call__(self, network, input, sigma, cond): class DiscreteDenoiser (line 31) | class DiscreteDenoiser(Denoiser): method __init__ (line 32) | def __init__( method sigma_to_idx (line 49) | def sigma_to_idx(self, sigma): method idx_to_sigma (line 53) | def idx_to_sigma(self, idx): method possibly_quantize_sigma (line 56) | def possibly_quantize_sigma(self, sigma): method possibly_quantize_c_noise (line 59) | def possibly_quantize_c_noise(self, c_noise): FILE: sgm/modules/diffusionmodules/denoiser_scaling.py class EDMScaling (line 4) | class EDMScaling: method __init__ (line 5) | def __init__(self, sigma_data=0.5): method __call__ (line 8) | def __call__(self, sigma): class EpsScaling (line 16) | class EpsScaling: method __call__ (line 17) | def __call__(self, sigma): class VScaling (line 25) | class VScaling: method __call__ (line 26) | def __call__(self, sigma): FILE: sgm/modules/diffusionmodules/denoiser_weighting.py class UnitWeighting (line 4) | class UnitWeighting: method __call__ (line 5) | def __call__(self, sigma): class EDMWeighting (line 9) | class EDMWeighting: method __init__ (line 10) | def __init__(self, sigma_data=0.5): method __call__ (line 13) | def __call__(self, sigma): class VWeighting (line 17) | class VWeighting(EDMWeighting): method __init__ (line 18) | def __init__(self): class EpsWeighting (line 22) | class EpsWeighting: method __call__ (line 23) | def __call__(self, sigma): FILE: sgm/modules/diffusionmodules/discretizer.py function generate_roughly_equally_spaced_steps (line 10) | def generate_roughly_equally_spaced_steps( class Discretization (line 16) | class Discretization: method __call__ (line 17) | def __call__(self, n, do_append_zero=True, device="cpu", flip=False): method get_sigmas (line 23) | def get_sigmas(self, n, device): class EDMDiscretization (line 27) | class EDMDiscretization(Discretization): method __init__ (line 28) | def __init__(self, sigma_min=0.02, sigma_max=80.0, rho=7.0): method get_sigmas (line 33) | def get_sigmas(self, n, device="cpu"): class LegacyDDPMDiscretization (line 41) | class LegacyDDPMDiscretization(Discretization): method __init__ (line 42) | def __init__( method get_sigmas (line 57) | def get_sigmas(self, n, device="cpu"): FILE: sgm/modules/diffusionmodules/guiders.py class VanillaCFG (line 8) | class VanillaCFG: method __init__ (line 13) | def __init__(self, scale, dyn_thresh_config=None): method __call__ (line 25) | def __call__(self, x, sigma): method prepare_inputs (line 31) | def prepare_inputs(self, x, s, c, uc): class IdentityGuider (line 43) | class IdentityGuider: method __call__ (line 44) | def __call__(self, x, sigma): method prepare_inputs (line 47) | def prepare_inputs(self, x, s, c, uc): FILE: sgm/modules/diffusionmodules/loss.py class StandardDiffusionLoss (line 11) | class StandardDiffusionLoss(nn.Module): method __init__ (line 12) | def __init__( method __call__ (line 36) | def __call__(self, network, denoiser, conditioner, input, batch, *args... method get_diff_loss (line 60) | def get_diff_loss(self, model_output, target, w): class FullLoss (line 71) | class FullLoss(StandardDiffusionLoss): method __init__ (line 73) | def __init__( method get_gaussian_kernel (line 103) | def get_gaussian_kernel(self, kernel_size=3, sigma=1, out_channels=3): method __call__ (line 131) | def __call__(self, network, denoiser, conditioner, input, batch, first... method get_ocr_loss (line 178) | def get_ocr_loss(self, model_output, r_bbox, label, first_stage_model,... method get_min_local_loss (line 192) | def get_min_local_loss(self, attn_map_cache, mask, seg_mask): method get_local_loss (line 237) | def get_local_loss(self, attn_map_cache, seg, seg_mask): FILE: sgm/modules/diffusionmodules/model.py function get_timestep_embedding (line 23) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 44) | def nonlinearity(x): function Normalize (line 49) | def Normalize(in_channels, num_groups=32): class Upsample (line 55) | class Upsample(nn.Module): method __init__ (line 56) | def __init__(self, in_channels, with_conv): method forward (line 64) | def forward(self, x): class Downsample (line 71) | class Downsample(nn.Module): method __init__ (line 72) | def __init__(self, in_channels, with_conv): method forward (line 81) | def forward(self, x): class ResnetBlock (line 91) | class ResnetBlock(nn.Module): method __init__ (line 92) | def __init__( method forward (line 128) | def forward(self, x, temb): class LinAttnBlock (line 151) | class LinAttnBlock(LinearAttention): method __init__ (line 154) | def __init__(self, in_channels): class AttnBlock (line 158) | class AttnBlock(nn.Module): method __init__ (line 159) | def __init__(self, in_channels): method attention (line 177) | def attention(self, h_: torch.Tensor) -> torch.Tensor: method forward (line 194) | def forward(self, x, **kwargs): class MemoryEfficientAttnBlock (line 201) | class MemoryEfficientAttnBlock(nn.Module): method __init__ (line 209) | def __init__(self, in_channels): method attention (line 228) | def attention(self, h_: torch.Tensor) -> torch.Tensor: method forward (line 258) | def forward(self, x, **kwargs): class MemoryEfficientCrossAttentionWrapper (line 265) | class MemoryEfficientCrossAttentionWrapper(MemoryEfficientCrossAttention): method forward (line 266) | def forward(self, x, context=None, mask=None, **unused_kwargs): function make_attn (line 274) | def make_attn(in_channels, attn_type="vanilla", attn_kwargs=None): class Model (line 307) | class Model(nn.Module): method __init__ (line 308) | def __init__( method forward (line 429) | def forward(self, x, t=None, context=None): method get_last_layer (line 478) | def get_last_layer(self): class Encoder (line 482) | class Encoder(nn.Module): method __init__ (line 483) | def __init__( method forward (line 571) | def forward(self, x): class Decoder (line 599) | class Decoder(nn.Module): method __init__ (line 600) | def __init__( method _make_attn (line 698) | def _make_attn(self) -> Callable: method _make_resblock (line 701) | def _make_resblock(self) -> Callable: method _make_conv (line 704) | def _make_conv(self) -> Callable: method get_last_layer (line 707) | def get_last_layer(self, **kwargs): method forward (line 710) | def forward(self, z, **kwargs): FILE: sgm/modules/diffusionmodules/openaimodel.py class Timestep (line 22) | class Timestep(nn.Module): method __init__ (line 23) | def __init__(self, dim): method forward (line 27) | def forward(self, t): class TimestepBlock (line 31) | class TimestepBlock(nn.Module): method forward (line 37) | def forward(self, x, emb): class TimestepEmbedSequential (line 43) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 49) | def forward( class Upsample (line 66) | class Upsample(nn.Module): method __init__ (line 75) | def __init__( method forward (line 89) | def forward(self, x): class Downsample (line 105) | class Downsample(nn.Module): method __init__ (line 114) | def __init__( method forward (line 144) | def forward(self, x): class ResBlock (line 149) | class ResBlock(TimestepBlock): method __init__ (line 154) | def __init__( method forward (line 242) | def forward(self, x, emb): class UnifiedUNetModel (line 275) | class UnifiedUNetModel(nn.Module): method __init__ (line 277) | def __init__( method clear_attn_map (line 552) | def clear_attn_map(self): method save_attn_map (line 559) | def save_attn_map(self, attn_type="t_attn", save_name="temp", tokens=""): method forward (line 593) | def forward(self, x, timesteps=None, t_context=None, v_context=None, y... FILE: sgm/modules/diffusionmodules/sampling.py class BaseDiffusionSampler (line 28) | class BaseDiffusionSampler: method __init__ (line 29) | def __init__( method prepare_sampling_loop (line 48) | def prepare_sampling_loop(self, x, cond, uc=None, num_steps=None): method denoise (line 61) | def denoise(self, x, model, sigma, cond, uc): method get_sigma_gen (line 66) | def get_sigma_gen(self, num_sigmas, init_step=0): class SingleStepDiffusionSampler (line 81) | class SingleStepDiffusionSampler(BaseDiffusionSampler): method sampler_step (line 82) | def sampler_step(self, sigma, next_sigma, denoiser, x, cond, uc, *args... method euler_step (line 85) | def euler_step(self, x, d, dt): class EDMSampler (line 89) | class EDMSampler(SingleStepDiffusionSampler): method __init__ (line 90) | def __init__( method sampler_step (line 100) | def sampler_step(self, sigma, next_sigma, denoiser, x, cond, uc=None, ... method __call__ (line 116) | def __call__(self, denoiser, x, cond, uc=None, num_steps=None): class AncestralSampler (line 140) | class AncestralSampler(SingleStepDiffusionSampler): method __init__ (line 141) | def __init__(self, eta=1.0, s_noise=1.0, *args, **kwargs): method ancestral_euler_step (line 148) | def ancestral_euler_step(self, x, denoised, sigma, sigma_down): method ancestral_step (line 154) | def ancestral_step(self, x, sigma, next_sigma, sigma_up): method __call__ (line 162) | def __call__(self, denoiser, x, cond, uc=None, num_steps=None): class LinearMultistepSampler (line 180) | class LinearMultistepSampler(BaseDiffusionSampler): method __init__ (line 181) | def __init__( method __call__ (line 191) | def __call__(self, denoiser, x, cond, uc=None, num_steps=None, **kwargs): class EulerEDMSampler (line 218) | class EulerEDMSampler(EDMSampler): method possible_correction_step (line 220) | def possible_correction_step( method get_c_noise (line 225) | def get_c_noise(self, x, model, sigma): method attend_and_excite (line 233) | def attend_and_excite(self, x, model, sigma, cond, batch, alpha, iter_... method save_segment_map (line 254) | def save_segment_map(self, attn_maps, tokens=None, save_name=None): method get_init_noise (line 264) | def get_init_noise(self, cfgs, model, cond, batch, uc=None): method sampler_step (line 324) | def sampler_step(self, sigma, next_sigma, model, x, cond, batch=None, ... method __call__ (line 355) | def __call__(self, model, x, cond, batch=None, uc=None, num_steps=None... class HeunEDMSampler (line 423) | class HeunEDMSampler(EDMSampler): method possible_correction_step (line 424) | def possible_correction_step( class EulerAncestralSampler (line 442) | class EulerAncestralSampler(AncestralSampler): method sampler_step (line 443) | def sampler_step(self, sigma, next_sigma, denoiser, x, cond, uc): class DPMPP2SAncestralSampler (line 452) | class DPMPP2SAncestralSampler(AncestralSampler): method get_variables (line 453) | def get_variables(self, sigma, sigma_down): method get_mult (line 459) | def get_mult(self, h, s, t, t_next): method sampler_step (line 467) | def sampler_step(self, sigma, next_sigma, denoiser, x, cond, uc=None, ... class DPMPP2MSampler (line 492) | class DPMPP2MSampler(BaseDiffusionSampler): method get_variables (line 493) | def get_variables(self, sigma, next_sigma, previous_sigma=None): method get_mult (line 504) | def get_mult(self, h, r, t, t_next, previous_sigma): method sampler_step (line 515) | def sampler_step( method __call__ (line 549) | def __call__(self, denoiser, x, cond, uc=None, num_steps=None, init_st... FILE: sgm/modules/diffusionmodules/sampling_utils.py class NoDynamicThresholding (line 7) | class NoDynamicThresholding: method __call__ (line 8) | def __call__(self, uncond, cond, scale): function linear_multistep_coeff (line 12) | def linear_multistep_coeff(order, t, i, j, epsrel=1e-4): function get_ancestral_step (line 27) | def get_ancestral_step(sigma_from, sigma_to, eta=1.0): function to_d (line 39) | def to_d(x, sigma, denoised): function to_neg_log_sigma (line 43) | def to_neg_log_sigma(sigma): function to_sigma (line 47) | def to_sigma(neg_log_sigma): FILE: sgm/modules/diffusionmodules/sigma_sampling.py class EDMSampling (line 6) | class EDMSampling: method __init__ (line 7) | def __init__(self, p_mean=-1.2, p_std=1.2): method __call__ (line 11) | def __call__(self, n_samples, rand=None): class DiscreteSampling (line 16) | class DiscreteSampling: method __init__ (line 17) | def __init__(self, discretization_config, num_idx, do_append_zero=Fals... method idx_to_sigma (line 23) | def idx_to_sigma(self, idx): method __call__ (line 26) | def __call__(self, n_samples, rand=None): FILE: sgm/modules/diffusionmodules/util.py function make_beta_schedule (line 19) | def make_beta_schedule( function extract_into_tensor (line 35) | def extract_into_tensor(a, t, x_shape): function mixed_checkpoint (line 41) | def mixed_checkpoint(func, inputs: dict, params, flag): class MixedCheckpointFunction (line 77) | class MixedCheckpointFunction(torch.autograd.Function): method forward (line 79) | def forward( method backward (line 119) | def backward(ctx, *output_grads): function checkpoint (line 153) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 170) | class CheckpointFunction(torch.autograd.Function): method forward (line 172) | def forward(ctx, run_function, length, *args): method backward (line 186) | def backward(ctx, *output_grads): function timestep_embedding (line 206) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 233) | def zero_module(module): function scale_module (line 242) | def scale_module(module, scale): function mean_flat (line 251) | def mean_flat(tensor): function normalization (line 258) | def normalization(channels): class SiLU (line 268) | class SiLU(nn.Module): method forward (line 269) | def forward(self, x): class GroupNorm32 (line 273) | class GroupNorm32(nn.GroupNorm): method forward (line 274) | def forward(self, x): function conv_nd (line 278) | def conv_nd(dims, *args, **kwargs): function linear (line 291) | def linear(*args, **kwargs): function avg_pool_nd (line 298) | def avg_pool_nd(dims, *args, **kwargs): FILE: sgm/modules/diffusionmodules/wrappers.py class IdentityWrapper (line 8) | class IdentityWrapper(nn.Module): method __init__ (line 9) | def __init__(self, diffusion_model, compile_model: bool = False): method forward (line 19) | def forward(self, *args, **kwargs): class OpenAIWrapper (line 23) | class OpenAIWrapper(IdentityWrapper): method forward (line 24) | def forward( FILE: sgm/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 37) | def sample(self): method kl (line 43) | def kl(self, other=None): method nll (line 62) | def nll(self, sample, dims=[1, 2, 3]): method mode (line 71) | def mode(self): function normal_kl (line 75) | def normal_kl(mean1, logvar1, mean2, logvar2): FILE: sgm/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 reset_num_updates (line 29) | def reset_num_updates(self): method forward (line 33) | def forward(self, model): method copy_to (line 56) | def copy_to(self, model): method store (line 65) | def store(self, parameters): method restore (line 74) | def restore(self, parameters): FILE: sgm/modules/encoders/modules.py class AbstractEmbModel (line 48) | class AbstractEmbModel(nn.Module): method __init__ (line 49) | def __init__(self): method is_trainable (line 57) | def is_trainable(self) -> bool: method ucg_rate (line 61) | def ucg_rate(self) -> Union[float, torch.Tensor]: method input_key (line 65) | def input_key(self) -> str: method emb_key (line 69) | def emb_key(self) -> str: method is_trainable (line 73) | def is_trainable(self, value: bool): method ucg_rate (line 77) | def ucg_rate(self, value: Union[float, torch.Tensor]): method input_key (line 81) | def input_key(self, value: str): method emb_key (line 85) | def emb_key(self, value: str): method is_trainable (line 89) | def is_trainable(self): method ucg_rate (line 93) | def ucg_rate(self): method input_key (line 97) | def input_key(self): method emb_key (line 101) | def emb_key(self): class GeneralConditioner (line 105) | class GeneralConditioner(nn.Module): method __init__ (line 110) | def __init__(self, emb_models: Union[List, ListConfig]): method possibly_get_ucg_val (line 145) | def possibly_get_ucg_val(self, embedder: AbstractEmbModel, batch: Dict... method forward (line 154) | def forward( method get_unconditional_conditioning (line 203) | def get_unconditional_conditioning( class InceptionV3 (line 220) | class InceptionV3(nn.Module): method __init__ (line 224) | def __init__(self, normalize_input=False, **kwargs): method forward (line 231) | def forward(self, inp): class IdentityEncoder (line 246) | class IdentityEncoder(AbstractEmbModel): method encode (line 247) | def encode(self, x): method freeze (line 249) | def freeze(self): method forward (line 251) | def forward(self, x): class ClassEmbedder (line 255) | class ClassEmbedder(AbstractEmbModel): method __init__ (line 256) | def __init__(self, embed_dim, n_classes=1000, add_sequence_dim=False): method forward (line 262) | def forward(self, c): method get_unconditional_conditioning (line 268) | def get_unconditional_conditioning(self, bs, device="cuda"): class ClassEmbedderForMultiCond (line 277) | class ClassEmbedderForMultiCond(ClassEmbedder): method forward (line 278) | def forward(self, batch, key=None, disable_dropout=False): class FrozenT5Embedder (line 289) | class FrozenT5Embedder(AbstractEmbModel): method __init__ (line 292) | def __init__( method freeze (line 303) | def freeze(self): method forward (line 310) | def forward(self, text): method encode (line 326) | def encode(self, text): class FrozenByT5Embedder (line 330) | class FrozenByT5Embedder(AbstractEmbModel): method __init__ (line 335) | def __init__( method freeze (line 346) | def freeze(self): method forward (line 351) | def forward(self, text): method encode (line 367) | def encode(self, text): class FrozenCLIPEmbedder (line 371) | class FrozenCLIPEmbedder(AbstractEmbModel): method __init__ (line 376) | def __init__( method freeze (line 401) | def freeze(self): method forward (line 407) | def forward(self, text): method encode (line 432) | def encode(self, text): class FrozenOpenCLIPEmbedder2 (line 436) | class FrozenOpenCLIPEmbedder2(AbstractEmbModel): method __init__ (line 443) | def __init__( method freeze (line 478) | def freeze(self): method forward (line 484) | def forward(self, text): method encode_with_transformer (line 495) | def encode_with_transformer(self, text): method pool (line 512) | def pool(self, x, text): method text_transformer_forward (line 520) | def text_transformer_forward(self, x: torch.Tensor, attn_mask=None): method encode (line 535) | def encode(self, text): class FrozenOpenCLIPEmbedder (line 539) | class FrozenOpenCLIPEmbedder(AbstractEmbModel): method __init__ (line 546) | def __init__( method freeze (line 575) | def freeze(self): method forward (line 580) | def forward(self, text): method encode_with_transformer (line 586) | def encode_with_transformer(self, text): method text_transformer_forward (line 595) | def text_transformer_forward(self, x: torch.Tensor, attn_mask=None): method encode (line 608) | def encode(self, text): class FrozenOpenCLIPImageEmbedder (line 612) | class FrozenOpenCLIPImageEmbedder(AbstractEmbModel): method __init__ (line 617) | def __init__( method preprocess (line 661) | def preprocess(self, x): method freeze (line 675) | def freeze(self): method forward (line 681) | def forward(self, image, no_dropout=False): method encode_with_vision_transformer (line 734) | def encode_with_vision_transformer(self, img): method encode (line 768) | def encode(self, text): class FrozenCLIPT5Encoder (line 772) | class FrozenCLIPT5Encoder(AbstractEmbModel): method __init__ (line 773) | def __init__( method encode (line 791) | def encode(self, text): method forward (line 794) | def forward(self, text): class SpatialRescaler (line 800) | class SpatialRescaler(AbstractEmbModel): method __init__ (line 801) | def __init__( method freeze (line 840) | def freeze(self): method forward (line 843) | def forward(self, x): method encode (line 859) | def encode(self, x): class LowScaleEncoder (line 863) | class LowScaleEncoder(nn.Module): method __init__ (line 864) | def __init__( method register_schedule (line 883) | def register_schedule( method q_sample (line 931) | def q_sample(self, x_start, t, noise=None): method forward (line 939) | def forward(self, x): method decode (line 953) | def decode(self, z): class ConcatTimestepEmbedderND (line 958) | class ConcatTimestepEmbedderND(AbstractEmbModel): method __init__ (line 961) | def __init__(self, outdim): method freeze (line 966) | def freeze(self): method forward (line 969) | def forward(self, x): class GaussianEncoder (line 980) | class GaussianEncoder(Encoder, AbstractEmbModel): method __init__ (line 981) | def __init__( method forward (line 989) | def forward(self, x) -> Tuple[Dict, torch.Tensor]: class LatentEncoder (line 999) | class LatentEncoder(AbstractEmbModel): method __init__ (line 1001) | def __init__(self, scale_factor, config, *args, **kwargs): method freeze (line 1007) | def freeze(self): method forward (line 1011) | def forward(self, x): class ViTSTREncoder (line 1017) | class ViTSTREncoder(VisionTransformer): method __init__ (line 1021) | def __init__(self, size=224, ckpt_path=None, freeze=True, *args, **kwa... method reset_classifier (line 1036) | def reset_classifier(self, num_classes): method freeze (line 1040) | def freeze(self): method forward_features (line 1044) | def forward_features(self, x): method forward (line 1059) | def forward(self, x): method encode (line 1065) | def encode(self, x): class PositionalEncoding (line 1069) | class PositionalEncoding(nn.Module): method __init__ (line 1071) | def __init__(self, d_model, dropout=0.1, max_len=5000): method forward (line 1083) | def forward(self, x): class LabelEncoder (line 1088) | class LabelEncoder(AbstractEmbModel, pl.LightningModule): method __init__ (line 1090) | def __init__(self, max_len, emb_dim, n_heads=8, n_trans_layers=12, ckp... method freeze (line 1145) | def freeze(self): method get_index (line 1149) | def get_index(self, labels): method get_embeddings (line 1160) | def get_embeddings(self, x): method forward (line 1168) | def forward(self, labels): method get_loss (line 1175) | def get_loss(self, text_out, visual_out, clip_target, cls_out, pos_out... method training_step (line 1193) | def training_step(self, batch, batch_idx): method configure_optimizers (line 1239) | def configure_optimizers(self): FILE: sgm/modules/predictors/model.py class ParseqPredictor (line 7) | class ParseqPredictor(nn.Module): method __init__ (line 9) | def __init__(self, ckpt_path=None, freeze=True, *args, **kwargs): method freeze (line 22) | def freeze(self): method forward (line 26) | def forward(self, x): method img2txt (line 33) | def img2txt(self, x): method calc_loss (line 40) | def calc_loss(self, x, label): FILE: sgm/util.py function disabled_train (line 14) | def disabled_train(self, mode=True): function get_string_from_tuple (line 20) | def get_string_from_tuple(s): function is_power_of_two (line 36) | def is_power_of_two(n): function autocast (line 52) | def autocast(f, enabled=True): function load_partial_from_config (line 64) | def load_partial_from_config(config): function log_txt_as_img (line 68) | def log_txt_as_img(wh, xc, size=10): function partialclass (line 98) | def partialclass(cls, *args, **kwargs): function make_path_absolute (line 105) | def make_path_absolute(path): function ismap (line 112) | def ismap(x): function isimage (line 118) | def isimage(x): function isheatmap (line 124) | def isheatmap(x): function isneighbors (line 131) | def isneighbors(x): function exists (line 137) | def exists(x): function expand_dims_like (line 141) | def expand_dims_like(x, y): function default (line 147) | def default(val, d): function mean_flat (line 153) | def mean_flat(tensor): function count_params (line 161) | def count_params(model, verbose=False): function instantiate_from_config (line 168) | def instantiate_from_config(config): function get_obj_from_str (line 178) | def get_obj_from_str(string, reload=False, invalidate_cache=True): function append_zero (line 188) | def append_zero(x): function append_dims (line 192) | def append_dims(x, target_dims): function load_model_from_config (line 202) | def load_model_from_config(config, ckpt, verbose=True, freeze=True): FILE: src/parseq/bench.py function main (line 30) | def main(config: DictConfig): FILE: src/parseq/hubconf.py function parseq_tiny (line 7) | def parseq_tiny(pretrained: bool = False, decode_ar: bool = True, refine... function parseq (line 17) | def parseq(pretrained: bool = False, decode_ar: bool = True, refine_iter... function abinet (line 27) | def abinet(pretrained: bool = False, iter_size: int = 3, **kwargs): function trba (line 36) | def trba(pretrained: bool = False, **kwargs): function vitstr (line 44) | def vitstr(pretrained: bool = False, **kwargs): function crnn (line 52) | def crnn(pretrained: bool = False, **kwargs): FILE: src/parseq/read.py function main (line 28) | def main(): FILE: src/parseq/strhub/data/aa_overrides.py function rotate_expand (line 22) | def rotate_expand(img, degrees, **kwargs): function _level_to_arg (line 28) | def _level_to_arg(level, hparams, key, default): function apply (line 35) | def apply(): FILE: src/parseq/strhub/data/augment.py function _get_op (line 30) | def _get_op(key, factory): function _get_param (line 39) | def _get_param(level, img, max_dim_factor, min_level=1): function gaussian_blur (line 44) | def gaussian_blur(img, radius, **__): function motion_blur (line 51) | def motion_blur(img, k, **__): function gaussian_noise (line 58) | def gaussian_noise(img, scale, **_): function poisson_noise (line 65) | def poisson_noise(img, lam, **_): function _level_to_arg (line 72) | def _level_to_arg(level, _hparams, max): function rand_augment_transform (line 99) | def rand_augment_transform(magnitude=5, num_layers=3): FILE: src/parseq/strhub/data/dataset.py function build_tree_dataset (line 31) | def build_tree_dataset(root: Union[PurePath, str], *args, **kwargs): class LmdbDataset (line 49) | class LmdbDataset(Dataset): method __init__ (line 57) | def __init__(self, root: str, charset: str, max_label_len: int, min_im... method __del__ (line 69) | def __del__(self): method _create_env (line 74) | def _create_env(self): method env (line 79) | def env(self): method _preprocess_labels (line 84) | def _preprocess_labels(self, charset, remove_whitespace, normalize_uni... method __len__ (line 118) | def __len__(self): method __getitem__ (line 121) | def __getitem__(self, index): FILE: src/parseq/strhub/data/module.py class SceneTextDataModule (line 26) | class SceneTextDataModule(pl.LightningDataModule): method __init__ (line 32) | def __init__(self, root_dir: str, train_dir: str, img_size: Sequence[i... method get_transform (line 55) | def get_transform(img_size: Tuple[int], augment: bool = False, rotatio... method train_dataset (line 70) | def train_dataset(self): method val_dataset (line 80) | def val_dataset(self): method train_dataloader (line 89) | def train_dataloader(self): method val_dataloader (line 94) | def val_dataloader(self): method test_dataloaders (line 99) | def test_dataloaders(self, subset): FILE: src/parseq/strhub/data/utils.py class CharsetAdapter (line 26) | class CharsetAdapter: method __init__ (line 29) | def __init__(self, target_charset) -> None: method __call__ (line 35) | def __call__(self, label): class BaseTokenizer (line 45) | class BaseTokenizer(ABC): method __init__ (line 47) | def __init__(self, charset: str, specials_first: tuple = (), specials_... method __len__ (line 51) | def __len__(self): method _tok2ids (line 54) | def _tok2ids(self, tokens: str) -> List[int]: method _ids2tok (line 57) | def _ids2tok(self, token_ids: List[int], join: bool = True) -> str: method encode (line 62) | def encode(self, labels: List[str], device: Optional[torch.device] = N... method _filter (line 75) | def _filter(self, probs: Tensor, ids: Tensor) -> Tuple[Tensor, List[in... method decode (line 79) | def decode(self, token_dists: Tensor, raw: bool = False) -> Tuple[List... class Tokenizer (line 102) | class Tokenizer(BaseTokenizer): method __init__ (line 107) | def __init__(self, charset: str) -> None: method encode (line 113) | def encode(self, labels: List[str], device: Optional[torch.device] = N... method _filter (line 119) | def _filter(self, probs: Tensor, ids: Tensor) -> Tuple[Tensor, List[in... class CTCTokenizer (line 131) | class CTCTokenizer(BaseTokenizer): method __init__ (line 134) | def __init__(self, charset: str) -> None: method encode (line 139) | def encode(self, labels: List[str], device: Optional[torch.device] = N... method _filter (line 144) | def _filter(self, probs: Tensor, ids: Tensor) -> Tuple[Tensor, List[in... FILE: src/parseq/strhub/models/abinet/attention.py class Attention (line 7) | class Attention(nn.Module): method __init__ (line 8) | def __init__(self, in_channels=512, max_length=25, n_feature=256): method forward (line 20) | def forward(self, enc_output): function encoder_layer (line 35) | def encoder_layer(in_c, out_c, k=3, s=2, p=1): function decoder_layer (line 41) | def decoder_layer(in_c, out_c, k=3, s=1, p=1, mode='nearest', scale_fact... class PositionAttention (line 50) | class PositionAttention(nn.Module): method __init__ (line 51) | def __init__(self, max_length, in_channels=512, num_channels=64, method forward (line 71) | def forward(self, x): FILE: src/parseq/strhub/models/abinet/backbone.py class ResTranformer (line 8) | class ResTranformer(nn.Module): method __init__ (line 9) | def __init__(self, d_model=512, nhead=8, d_inner=2048, dropout=0.1, ac... method forward (line 17) | def forward(self, images): FILE: src/parseq/strhub/models/abinet/model.py class Model (line 5) | class Model(nn.Module): method __init__ (line 7) | def __init__(self, dataset_max_length: int, null_label: int): method _get_length (line 12) | def _get_length(self, logit, dim=-1): method _get_padding_mask (line 22) | def _get_padding_mask(length, max_length): method _get_location_mask (line 28) | def _get_location_mask(sz, device=None): FILE: src/parseq/strhub/models/abinet/model_abinet_iter.py class ABINetIterModel (line 9) | class ABINetIterModel(nn.Module): method __init__ (line 10) | def __init__(self, dataset_max_length, null_label, num_classes, iter_s... method forward (line 24) | def forward(self, images): FILE: src/parseq/strhub/models/abinet/model_alignment.py class BaseAlignment (line 7) | class BaseAlignment(Model): method __init__ (line 8) | def __init__(self, dataset_max_length, null_label, num_classes, d_mode... method forward (line 14) | def forward(self, l_feature, v_feature): FILE: src/parseq/strhub/models/abinet/model_language.py class BCNLanguage (line 8) | class BCNLanguage(Model): method __init__ (line 9) | def __init__(self, dataset_max_length, null_label, num_classes, d_mode... method forward (line 23) | def forward(self, tokens, lengths): FILE: src/parseq/strhub/models/abinet/model_vision.py class BaseVision (line 9) | class BaseVision(Model): method __init__ (line 10) | def __init__(self, dataset_max_length, null_label, num_classes, method forward (line 38) | def forward(self, images): FILE: src/parseq/strhub/models/abinet/resnet.py class BasicBlock (line 8) | class BasicBlock(resnet.BasicBlock): method __init__ (line 10) | def __init__(self, inplanes: int, planes: int, stride: int = 1, downsa... class ResNet (line 18) | class ResNet(nn.Module): method __init__ (line 20) | def __init__(self, block, layers): method _make_layer (line 42) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 59) | def forward(self, x): function resnet45 (line 71) | def resnet45(): FILE: src/parseq/strhub/models/abinet/system.py class ABINet (line 36) | class ABINet(CrossEntropySystem): method __init__ (line 38) | def __init__(self, charset_train: str, charset_test: str, max_label_le... method _pretraining (line 65) | def _pretraining(self): method no_weight_decay (line 71) | def no_weight_decay(self): method _add_weight_decay (line 74) | def _add_weight_decay(self, model: nn.Module, skip_list=()): method configure_optimizers (line 80) | def configure_optimizers(self): method forward (line 99) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method calc_loss (line 104) | def calc_loss(self, targets, *res_lists) -> Tensor: method on_train_batch_start (line 118) | def on_train_batch_start(self, batch: Any, batch_idx: int) -> None: method _prepare_inputs_and_targets (line 126) | def _prepare_inputs_and_targets(self, labels): method training_step (line 137) | def training_step(self, batch, batch_idx) -> STEP_OUTPUT: method forward_logits_loss (line 164) | def forward_logits_loss(self, images: Tensor, labels: List[str]) -> Tu... FILE: src/parseq/strhub/models/abinet/transformer.py class TransformerDecoderLayer (line 9) | class TransformerDecoderLayer(nn.Module): method __init__ (line 31) | def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, method __setstate__ (line 55) | def __setstate__(self, state): method forward (line 60) | def forward(self, tgt, memory, tgt_mask=None, memory_mask=None, class PositionalEncoding (line 102) | class PositionalEncoding(nn.Module): method __init__ (line 119) | def __init__(self, d_model, dropout=0.1, max_len=5000): method forward (line 131) | def forward(self, x): FILE: src/parseq/strhub/models/base.py class BatchResult (line 34) | class BatchResult: class BaseSystem (line 44) | class BaseSystem(pl.LightningModule, ABC): method __init__ (line 46) | def __init__(self, tokenizer: BaseTokenizer, charset_test: str, method forward (line 57) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method forward_logits_loss (line 70) | def forward_logits_loss(self, images: Tensor, labels: List[str]) -> Tu... method configure_optimizers (line 84) | def configure_optimizers(self): method optimizer_zero_grad (line 94) | def optimizer_zero_grad(self, epoch: int, batch_idx: int, optimizer: O... method _eval_step (line 97) | def _eval_step(self, batch, validation: bool) -> Optional[STEP_OUTPUT]: method _aggregate_results (line 131) | def _aggregate_results(outputs) -> Tuple[float, float, float]: method validation_step (line 151) | def validation_step(self, batch, batch_idx) -> Optional[STEP_OUTPUT]: method validation_epoch_end (line 154) | def validation_epoch_end(self, outputs) -> None: method test_step (line 161) | def test_step(self, batch, batch_idx) -> Optional[STEP_OUTPUT]: class CrossEntropySystem (line 165) | class CrossEntropySystem(BaseSystem): method __init__ (line 167) | def __init__(self, charset_train: str, charset_test: str, method forward_logits_loss (line 175) | def forward_logits_loss(self, images: Tensor, labels: List[str]) -> Tu... class CTCSystem (line 185) | class CTCSystem(BaseSystem): method __init__ (line 187) | def __init__(self, charset_train: str, charset_test: str, method forward_logits_loss (line 193) | def forward_logits_loss(self, images: Tensor, labels: List[str]) -> Tu... FILE: src/parseq/strhub/models/crnn/model.py class CRNN (line 6) | class CRNN(nn.Module): method __init__ (line 8) | def __init__(self, img_h, nc, nclass, nh, leaky_relu=False): method forward (line 51) | def forward(self, input): FILE: src/parseq/strhub/models/crnn/system.py class CRNN (line 26) | class CRNN(CTCSystem): method __init__ (line 28) | def __init__(self, charset_train: str, charset_test: str, max_label_le... method forward (line 36) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method training_step (line 39) | def training_step(self, batch, batch_idx) -> STEP_OUTPUT: FILE: src/parseq/strhub/models/modules.py class BidirectionalLSTM (line 5) | class BidirectionalLSTM(nn.Module): method __init__ (line 8) | def __init__(self, input_size, hidden_size, output_size): method forward (line 13) | def forward(self, input): FILE: src/parseq/strhub/models/parseq/modules.py class DecoderLayer (line 27) | class DecoderLayer(nn.Module): method __init__ (line 31) | def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, ... method __setstate__ (line 51) | def __setstate__(self, state): method forward_stream (line 56) | def forward_stream(self, tgt: Tensor, tgt_norm: Tensor, tgt_kv: Tensor... method forward (line 74) | def forward(self, query, content, memory, query_mask: Optional[Tensor]... class Decoder (line 85) | class Decoder(nn.Module): method __init__ (line 88) | def __init__(self, decoder_layer, num_layers, norm): method forward (line 94) | def forward(self, query, content, memory, query_mask: Optional[Tensor]... class Encoder (line 104) | class Encoder(VisionTransformer): method __init__ (line 106) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 113) | def forward(self, x): class TokenEmbedding (line 118) | class TokenEmbedding(nn.Module): method __init__ (line 120) | def __init__(self, charset_size: int, embed_dim: int): method forward (line 125) | def forward(self, tokens: torch.Tensor): FILE: src/parseq/strhub/models/parseq/system.py class PARSeq (line 35) | class PARSeq(CrossEntropySystem): method __init__ (line 37) | def __init__(self, charset_train: str, charset_test: str, max_label_le... method no_weight_decay (line 74) | def no_weight_decay(self): method encode (line 79) | def encode(self, img: torch.Tensor): method decode (line 82) | def decode(self, tgt: torch.Tensor, memory: torch.Tensor, tgt_mask: Op... method forward (line 95) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method gen_tgt_perms (line 154) | def gen_tgt_perms(self, tgt): method generate_attn_masks (line 212) | def generate_attn_masks(self, perm): method training_step (line 228) | def training_step(self, batch, batch_idx) -> STEP_OUTPUT: FILE: src/parseq/strhub/models/trba/feature_extraction.py class ResNet_FeatureExtractor (line 6) | class ResNet_FeatureExtractor(nn.Module): method __init__ (line 9) | def __init__(self, input_channel, output_channel=512): method forward (line 13) | def forward(self, input): class ResNet (line 17) | class ResNet(nn.Module): method __init__ (line 19) | def __init__(self, input_channel, output_channel, block, layers): method _make_layer (line 59) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 76) | def forward(self, x): FILE: src/parseq/strhub/models/trba/model.py class TRBA (line 9) | class TRBA(nn.Module): method __init__ (line 11) | def __init__(self, img_h, img_w, num_class, num_fiducial=20, input_cha... method forward (line 36) | def forward(self, image, max_label_length, text=None): FILE: src/parseq/strhub/models/trba/prediction.py class Attention (line 6) | class Attention(nn.Module): method __init__ (line 8) | def __init__(self, input_size, hidden_size, num_class, num_char_embedd... method forward (line 16) | def forward(self, batch_H, text, max_label_length=25): class AttentionCell (line 53) | class AttentionCell(nn.Module): method __init__ (line 55) | def __init__(self, input_size, hidden_size, num_embeddings): method forward (line 63) | def forward(self, prev_hidden, batch_H, char_embeddings): FILE: src/parseq/strhub/models/trba/system.py class TRBA (line 30) | class TRBA(CrossEntropySystem): method __init__ (line 32) | def __init__(self, charset_train: str, charset_test: str, max_label_le... method no_weight_decay (line 45) | def no_weight_decay(self): method forward (line 48) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method training_step (line 53) | def training_step(self, batch, batch_idx) -> STEP_OUTPUT: class TRBC (line 65) | class TRBC(CTCSystem): method __init__ (line 67) | def __init__(self, charset_train: str, charset_test: str, max_label_le... method forward (line 79) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method training_step (line 83) | def training_step(self, batch, batch_idx) -> STEP_OUTPUT: FILE: src/parseq/strhub/models/trba/transformation.py class TPS_SpatialTransformerNetwork (line 7) | class TPS_SpatialTransformerNetwork(nn.Module): method __init__ (line 10) | def __init__(self, F, I_size, I_r_size, I_channel_num=1): method forward (line 28) | def forward(self, batch_I): class LocalizationNetwork (line 42) | class LocalizationNetwork(nn.Module): method __init__ (line 45) | def __init__(self, F, I_channel_num): method forward (line 75) | def forward(self, batch_I): class GridGenerator (line 86) | class GridGenerator(nn.Module): method __init__ (line 89) | def __init__(self, F, I_r_size): method _build_C (line 109) | def _build_C(self, F): method _build_inv_delta_C (line 119) | def _build_inv_delta_C(self, F, C): method _build_P (line 141) | def _build_P(self, I_r_width, I_r_height): method _build_P_hat (line 150) | def _build_P_hat(self, F, C, P): method build_P_prime (line 160) | def build_P_prime(self, batch_C_prime): FILE: src/parseq/strhub/models/utils.py class InvalidModelError (line 10) | class InvalidModelError(RuntimeError): function _get_config (line 24) | def _get_config(experiment: str, **kwargs): function _get_model_class (line 46) | def _get_model_class(key): function get_pretrained_weights (line 64) | def get_pretrained_weights(experiment): function create_model (line 72) | def create_model(experiment: str, pretrained: bool = False, **kwargs): function load_from_checkpoint (line 84) | def load_from_checkpoint(checkpoint_path: str, **kwargs): function parse_model_args (line 94) | def parse_model_args(args): function init_weights (line 105) | def init_weights(module: nn.Module, name: str = '', exclude: Sequence[st... FILE: src/parseq/strhub/models/vitstr/model.py class ViTSTR (line 14) | class ViTSTR(VisionTransformer): method forward (line 20) | def forward(self, x, seqlen: int = 25): FILE: src/parseq/strhub/models/vitstr/system.py class ViTSTR (line 27) | class ViTSTR(CrossEntropySystem): method __init__ (line 29) | def __init__(self, charset_train: str, charset_test: str, max_label_le... method no_weight_decay (line 43) | def no_weight_decay(self): method forward (line 46) | def forward(self, images: Tensor, max_length: Optional[int] = None) ->... method training_step (line 54) | def training_step(self, batch, batch_idx) -> STEP_OUTPUT: FILE: src/parseq/test.py class Result (line 32) | class Result: function print_results_table (line 41) | def print_results_table(results: List[Result], file=None): function main (line 65) | def main(): FILE: src/parseq/tools/coco_2_converter.py function parse_args (line 14) | def parse_args(): function process_img (line 25) | def process_img(args, src_image_root, dst_image_root): function convert_textocr (line 63) | def convert_textocr(root_path, function main (line 104) | def main(): FILE: src/parseq/tools/create_lmdb_dataset.py function checkImageIsValid (line 12) | def checkImageIsValid(imageBin): function writeCache (line 19) | def writeCache(env, cache): function createDataset (line 25) | def createDataset(inputPath, gtFile, outputPath, checkValid=True): FILE: src/parseq/tools/filter_lmdb.py function main (line 11) | def main(): FILE: src/parseq/tools/lsvt_converter.py function parse_args (line 14) | def parse_args(): function process_img (line 25) | def process_img(args, src_image_root, dst_image_root): function convert_lsvt (line 58) | def convert_lsvt(root_path, function main (line 93) | def main(): FILE: src/parseq/tools/openvino_converter.py function parse_args (line 14) | def parse_args(): function process_img (line 26) | def process_img(args, src_image_root, dst_image_root): function convert_openimages (line 53) | def convert_openimages(root_path, function main (line 91) | def main(): FILE: src/parseq/tools/test_abinet_lm_acc.py class ABINetLM (line 21) | class ABINetLM(ABINet): method _encode (line 23) | def _encode(self, labels): method forward (line 34) | def forward(self, labels: Tensor, max_length: int = None) -> Tensor: function main (line 39) | def main(): FILE: src/parseq/tools/textocr_converter.py function parse_args (line 15) | def parse_args(): function rectify_image_pose (line 28) | def rectify_image_pose(image, top_left, points): function process_img (line 52) | def process_img(args, src_image_root, dst_image_root): function convert_textocr (line 80) | def convert_textocr(root_path, function main (line 118) | def main(): FILE: src/parseq/train.py function main (line 35) | def main(config: DictConfig): FILE: src/parseq/tune.py class MetricTracker (line 45) | class MetricTracker(tune.Stopper): method __init__ (line 48) | def __init__(self, metric, max_t, patience: int = 3, window: int = 3) ... method gaussian_pdf (line 61) | def gaussian_pdf(x, sigma=1.): method moving_average (line 65) | def moving_average(x, k): method __call__ (line 68) | def __call__(self, trial_id, result): method stop_all (line 93) | def stop_all(self): class TuneReportCheckpointPruneCallback (line 97) | class TuneReportCheckpointPruneCallback(TuneReportCheckpointCallback): method _handle (line 99) | def _handle(self, trainer: Trainer, pl_module: LightningModule): function train (line 108) | def train(hparams, config, checkpoint_dir=None): function main (line 130) | def main(config: DictConfig): FILE: test.py function predict (line 19) | def predict(cfgs, model, sampler, batch): function test (line 43) | def test(model, sampler, dataloader, cfgs): FILE: train.py function train (line 15) | def train(): FILE: util.py function init_model (line 7) | def init_model(cfgs): function init_sampling (line 24) | def init_sampling(cfgs): function deep_copy (line 49) | def deep_copy(batch): function prepare_batch (line 62) | def prepare_batch(cfgs, batch):