SYMBOL INDEX (1151 symbols across 83 files) FILE: perpneg_diffusion/perpneg_stable_diffusion/__init__.py class StableDiffusionPipelineOutput (line 16) | class StableDiffusionPipelineOutput(BaseOutput): FILE: perpneg_diffusion/perpneg_stable_diffusion/pipeline_composable_stable_diffusion.py class ComposableStableDiffusionPipeline (line 20) | class ComposableStableDiffusionPipeline(DiffusionPipeline): method __init__ (line 48) | def __init__( method enable_attention_slicing (line 70) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 89) | def disable_attention_slicing(self): method __call__ (line 98) | def __call__( FILE: perpneg_diffusion/perpneg_stable_diffusion/pipeline_composable_stable_diffusion_3d_rotation.py function get_prependicualr_component (line 20) | def get_prependicualr_component(x, y): function weighted_prependicualr_aggricator (line 25) | def weighted_prependicualr_aggricator(delta_noise_pred_pos, w_pos, delta... class ComposableStableDiffusionPipeline_perpneg (line 39) | class ComposableStableDiffusionPipeline_perpneg(DiffusionPipeline): method __init__ (line 67) | def __init__( method enable_attention_slicing (line 89) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 108) | def disable_attention_slicing(self): method __call__ (line 117) | def __call__( FILE: perpneg_diffusion/perpneg_stable_diffusion/pipeline_composable_stable_diffusion_rotation.py function get_prependicualr_component (line 20) | def get_prependicualr_component(x, y): function weighted_prependicualr_aggricator (line 25) | def weighted_prependicualr_aggricator(delta_noise_pred_pos, w_pos, delta... class ComposableStableDiffusionPipeline_perpneg (line 39) | class ComposableStableDiffusionPipeline_perpneg(DiffusionPipeline): method __init__ (line 67) | def __init__( method enable_attention_slicing (line 89) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 108) | def disable_attention_slicing(self): method __call__ (line 117) | def __call__( FILE: perpneg_diffusion/perpneg_stable_diffusion/pipeline_perpneg_stable_diffusion.py function get_prependicualr_component (line 20) | def get_prependicualr_component(x, y): function weighted_prependicualr_aggricator (line 24) | def weighted_prependicualr_aggricator(delta_noise_pred_pos, w_pos, delta... class PerpStableDiffusionPipeline (line 38) | class PerpStableDiffusionPipeline(DiffusionPipeline): method __init__ (line 66) | def __init__( method enable_attention_slicing (line 88) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 107) | def disable_attention_slicing(self): method __call__ (line 116) | def __call__( FILE: perpneg_diffusion/perpneg_stable_diffusion/pipeline_perpneg_stable_diffusion_rotation.py function get_prependicualr_component (line 20) | def get_prependicualr_component(x, y): function weighted_prependicualr_aggricator (line 24) | def weighted_prependicualr_aggricator(delta_noise_pred_pos, w_pos, delta... class PerpStableDiffusionPipeline (line 38) | class PerpStableDiffusionPipeline(DiffusionPipeline): method __init__ (line 66) | def __init__( method enable_attention_slicing (line 88) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 107) | def disable_attention_slicing(self): method __call__ (line 116) | def __call__( FILE: perpneg_diffusion/perpneg_stable_diffusion/safety_checker.py function cosine_distance (line 16) | def cosine_distance(image_embeds, text_embeds): class StableDiffusionSafetyChecker (line 22) | class StableDiffusionSafetyChecker(PreTrainedModel): method __init__ (line 25) | def __init__(self, config: CLIPConfig): method forward (line 38) | def forward(self, clip_input, images): method forward_onnx (line 86) | def forward_onnx(self, clip_input: torch.FloatTensor, images: torch.Fl... FILE: scripts/image_sample_stable_diffusion.py function dummy (line 51) | def dummy(images, **kwargs): FILE: stable-dreamfusion/activation.py class _trunc_exp (line 5) | class _trunc_exp(Function): method forward (line 8) | def forward(ctx, x): method backward (line 14) | def backward(ctx, g): function biased_softplus (line 20) | def biased_softplus(x, bias=0): FILE: stable-dreamfusion/dpt.py class BaseModel (line 10) | class BaseModel(torch.nn.Module): method load (line 11) | def load(self, path): function unflatten_with_named_tensor (line 24) | def unflatten_with_named_tensor(input, dim, sizes): class Slice (line 30) | class Slice(nn.Module): method __init__ (line 31) | def __init__(self, start_index=1): method forward (line 35) | def forward(self, x): class AddReadout (line 39) | class AddReadout(nn.Module): method __init__ (line 40) | def __init__(self, start_index=1): method forward (line 44) | def forward(self, x): class ProjectReadout (line 52) | class ProjectReadout(nn.Module): method __init__ (line 53) | def __init__(self, in_features, start_index=1): method forward (line 59) | def forward(self, x): class Transpose (line 66) | class Transpose(nn.Module): method __init__ (line 67) | def __init__(self, dim0, dim1): method forward (line 72) | def forward(self, x): function forward_vit (line 77) | def forward_vit(pretrained, x): function _resize_pos_embed (line 118) | def _resize_pos_embed(self, posemb, gs_h, gs_w): function forward_flex (line 135) | def forward_flex(self, x): function get_activation (line 177) | def get_activation(name): function get_readout_oper (line 184) | def get_readout_oper(vit_features, features, use_readout, start_index=1): function _make_vit_b16_backbone (line 201) | def _make_vit_b16_backbone( function _make_pretrained_vitl16_384 (line 315) | def _make_pretrained_vitl16_384(pretrained, use_readout="ignore", hooks=... function _make_pretrained_vitb16_384 (line 328) | def _make_pretrained_vitb16_384(pretrained, use_readout="ignore", hooks=... function _make_pretrained_deitb16_384 (line 337) | def _make_pretrained_deitb16_384(pretrained, use_readout="ignore", hooks... function _make_pretrained_deitb16_distil_384 (line 346) | def _make_pretrained_deitb16_distil_384(pretrained, use_readout="ignore"... function _make_vit_b_rn50_backbone (line 361) | def _make_vit_b_rn50_backbone( function _make_pretrained_vitb_rn50_384 (line 496) | def _make_pretrained_vitb_rn50_384( function _make_encoder (line 511) | def _make_encoder(backbone, features, use_pretrained, groups=1, expand=F... function _make_scratch (line 549) | def _make_scratch(in_shape, out_shape, groups=1, expand=False): function _make_pretrained_efficientnet_lite3 (line 578) | def _make_pretrained_efficientnet_lite3(use_pretrained, exportable=False): function _make_efficientnet_backbone (line 588) | def _make_efficientnet_backbone(effnet): function _make_resnet_backbone (line 601) | def _make_resnet_backbone(resnet): function _make_pretrained_resnext101_wsl (line 614) | def _make_pretrained_resnext101_wsl(use_pretrained): class Interpolate (line 620) | class Interpolate(nn.Module): method __init__ (line 624) | def __init__(self, scale_factor, mode, align_corners=False): method forward (line 637) | def forward(self, x): class ResidualConvUnit (line 652) | class ResidualConvUnit(nn.Module): method __init__ (line 656) | def __init__(self, features): method forward (line 673) | def forward(self, x): class FeatureFusionBlock (line 688) | class FeatureFusionBlock(nn.Module): method __init__ (line 692) | def __init__(self, features): method forward (line 702) | def forward(self, *xs): class ResidualConvUnit_custom (line 723) | class ResidualConvUnit_custom(nn.Module): method __init__ (line 727) | def __init__(self, features, activation, bn): method forward (line 754) | def forward(self, x): class FeatureFusionBlock_custom (line 780) | class FeatureFusionBlock_custom(nn.Module): method __init__ (line 784) | def __init__(self, features, activation, deconv=False, bn=False, expan... method forward (line 808) | def forward(self, *xs): function _make_fusion_block (line 832) | def _make_fusion_block(features, use_bn): class DPT (line 843) | class DPT(BaseModel): method __init__ (line 844) | def __init__( method forward (line 884) | def forward(self, x): class DPTDepthModel (line 904) | class DPTDepthModel(DPT): method __init__ (line 905) | def __init__(self, path=None, non_negative=True, num_channels=1, **kwa... method forward (line 923) | def forward(self, x): FILE: stable-dreamfusion/encoding.py class FreqEncoder_torch (line 5) | class FreqEncoder_torch(nn.Module): method __init__ (line 6) | def __init__(self, input_dim, max_freq_log2, N_freqs, method forward (line 30) | def forward(self, input, max_level=None, **kwargs): function get_encoder (line 54) | def get_encoder(encoding, input_dim=3, FILE: stable-dreamfusion/evaluation/mesh_to_video.py function render_video (line 9) | def render_video(anim_mesh): function generate_mesh (line 26) | def generate_mesh(obj1,obj2,transform_vector): FILE: stable-dreamfusion/freqencoder/backend.py function find_cl_path (line 18) | def find_cl_path(): FILE: stable-dreamfusion/freqencoder/freq.py class _freq_encoder (line 15) | class _freq_encoder(Function): method forward (line 18) | def forward(ctx, inputs, degree, output_dim): method backward (line 39) | def backward(ctx, grad): class FreqEncoder (line 55) | class FreqEncoder(nn.Module): method __init__ (line 56) | def __init__(self, input_dim=3, degree=4): method __repr__ (line 63) | def __repr__(self): method forward (line 66) | def forward(self, inputs, **kwargs): FILE: stable-dreamfusion/freqencoder/setup.py function find_cl_path (line 19) | def find_cl_path(): FILE: stable-dreamfusion/freqencoder/src/bindings.cpp function PYBIND11_MODULE (line 5) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: stable-dreamfusion/gridencoder/backend.py function find_cl_path (line 17) | def find_cl_path(): FILE: stable-dreamfusion/gridencoder/grid.py class _grid_encode (line 25) | class _grid_encode(Function): method forward (line 28) | def forward(ctx, inputs, embeddings, offsets, per_level_scale, base_re... method backward (line 75) | def backward(ctx, grad): class GridEncoder (line 103) | class GridEncoder(nn.Module): method __init__ (line 104) | def __init__(self, input_dim=3, num_levels=16, level_dim=2, per_level_... method reset_parameters (line 145) | def reset_parameters(self): method __repr__ (line 149) | def __repr__(self): method forward (line 152) | def forward(self, inputs, bound=1, max_level=None): method grad_total_variation (line 173) | def grad_total_variation(self, weight=1e-7, inputs=None, bound=1, B=10... method grad_weight_decay (line 196) | def grad_weight_decay(self, weight=0.1): FILE: stable-dreamfusion/gridencoder/setup.py function find_cl_path (line 18) | def find_cl_path(): FILE: stable-dreamfusion/gridencoder/src/bindings.cpp function PYBIND11_MODULE (line 5) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: stable-dreamfusion/guidance/clip_utils.py class CLIP (line 9) | class CLIP(nn.Module): method __init__ (line 10) | def __init__(self, device, **kwargs): method get_text_embeds (line 21) | def get_text_embeds(self, prompt, **kwargs): method get_img_embeds (line 29) | def get_img_embeds(self, image, **kwargs): method train_step (line 37) | def train_step(self, clip_z, pred_rgb, grad_scale=10, **kwargs): FILE: stable-dreamfusion/guidance/if_utils.py class SpecifyGradient (line 15) | class SpecifyGradient(torch.autograd.Function): method forward (line 18) | def forward(ctx, input_tensor, gt_grad): method backward (line 25) | def backward(ctx, grad_scale): function seed_everything (line 30) | def seed_everything(seed): class IF (line 37) | class IF(nn.Module): method __init__ (line 38) | def __init__(self, device, vram_O, t_range=[0.02, 0.98]): method get_text_embeds (line 77) | def get_text_embeds(self, prompt): method train_step (line 88) | def train_step(self, text_embeddings, pred_rgb, guidance_scale=100, gr... method train_step_perpneg (line 125) | def train_step_perpneg(self, text_embeddings, weights, pred_rgb, guida... method produce_imgs (line 167) | def produce_imgs(self, text_embeddings, height=64, width=64, num_infer... method prompt_to_img (line 197) | def prompt_to_img(self, prompts, negative_prompts='', height=512, widt... FILE: stable-dreamfusion/guidance/perpneg_utils.py function get_perpendicular_component (line 4) | def get_perpendicular_component(x, y): function batch_get_perpendicular_component (line 9) | def batch_get_perpendicular_component(x, y): function weighted_perpendicular_aggregator (line 17) | def weighted_perpendicular_aggregator(delta_noise_preds, weights, batch_... FILE: stable-dreamfusion/guidance/sd_utils.py class SpecifyGradient (line 18) | class SpecifyGradient(torch.autograd.Function): method forward (line 21) | def forward(ctx, input_tensor, gt_grad): method backward (line 28) | def backward(ctx, grad_scale): function seed_everything (line 33) | def seed_everything(seed): class StableDiffusion (line 39) | class StableDiffusion(nn.Module): method __init__ (line 40) | def __init__(self, device, fp16, vram_O, sd_version='2.1', hf_key=None... method get_text_embeds (line 91) | def get_text_embeds(self, prompt): method train_step (line 100) | def train_step(self, text_embeddings, pred_rgb, guidance_scale=100, as... method train_step_perpneg (line 180) | def train_step_perpneg(self, text_embeddings, weights, pred_rgb, guida... method produce_latents (line 265) | def produce_latents(self, text_embeddings, height=512, width=512, num_... method decode_latents (line 287) | def decode_latents(self, latents): method encode_imgs (line 296) | def encode_imgs(self, imgs): method prompt_to_img (line 306) | def prompt_to_img(self, prompts, negative_prompts='', height=512, widt... FILE: stable-dreamfusion/guidance/zero123_utils.py class SpecifyGradient (line 20) | class SpecifyGradient(torch.autograd.Function): method forward (line 23) | def forward(ctx, input_tensor, gt_grad): method backward (line 30) | def backward(ctx, grad_scale): function load_model_from_config (line 36) | def load_model_from_config(config, ckpt, device, vram_O=False, verbose=F... class Zero123 (line 70) | class Zero123(nn.Module): method __init__ (line 71) | def __init__(self, device, fp16, method get_img_embeds (line 104) | def get_img_embeds(self, x): method angle_between (line 111) | def angle_between(self, sph_v1, sph_v2): method train_step (line 127) | def train_step(self, embeddings, pred_rgb, polar, azimuth, radius, gui... method __call__ (line 249) | def __call__(self, method decode_latents (line 286) | def decode_latents(self, latents): method encode_imgs (line 294) | def encode_imgs(self, imgs): FILE: stable-dreamfusion/ldm/extras.py function all_logging_disabled (line 12) | def all_logging_disabled(highest_level=logging.CRITICAL): function load_training_dir (line 37) | def load_training_dir(train_dir, device, epoch="last"): function load_model_from_config (line 55) | def load_model_from_config(config, ckpt, device="cpu", verbose=False): FILE: stable-dreamfusion/ldm/guidance.py class GuideModel (line 10) | class GuideModel(torch.nn.Module, abc.ABC): method __init__ (line 11) | def __init__(self) -> None: method preprocess (line 15) | def preprocess(self, x_img): method compute_loss (line 19) | def compute_loss(self, inp): class Guider (line 23) | class Guider(torch.nn.Module): method __init__ (line 24) | def __init__(self, sampler, guide_model, scale=1.0, verbose=False): method get_scales (line 49) | def get_scales(self): method modify_score (line 57) | def modify_score(self, model, e_t, x, t, c): FILE: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/models/autoencoder.py class VQModel (line 14) | class VQModel(pl.LightningModule): method __init__ (line 15) | def __init__(self, method ema_scope (line 64) | def ema_scope(self, context=None): method init_from_ckpt (line 78) | def init_from_ckpt(self, path, ignore_keys=list()): method on_train_batch_end (line 92) | def on_train_batch_end(self, *args, **kwargs): method encode (line 96) | def encode(self, x): method encode_to_prequant (line 102) | def encode_to_prequant(self, x): method decode (line 107) | def decode(self, quant): method decode_code (line 112) | def decode_code(self, code_b): method forward (line 117) | def forward(self, input, return_pred_indices=False): method get_input (line 124) | def get_input(self, batch, k): method training_step (line 142) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 164) | def validation_step(self, batch, batch_idx): method _validation_step (line 170) | def _validation_step(self, batch, batch_idx, suffix=""): method configure_optimizers (line 197) | def configure_optimizers(self): method get_last_layer (line 230) | def get_last_layer(self): method log_images (line 233) | def log_images(self, batch, only_inputs=False, plot_ema=False, **kwargs): method to_rgb (line 255) | def to_rgb(self, x): class VQModelInterface (line 264) | class VQModelInterface(VQModel): method __init__ (line 265) | def __init__(self, embed_dim, *args, **kwargs): method encode (line 269) | def encode(self, x): method decode (line 274) | def decode(self, h, force_not_quantize=False): class AutoencoderKL (line 285) | class AutoencoderKL(pl.LightningModule): method __init__ (line 286) | def __init__(self, method init_from_ckpt (line 313) | def init_from_ckpt(self, path, ignore_keys=list()): method encode (line 324) | def encode(self, x): method decode (line 330) | def decode(self, z): method forward (line 335) | def forward(self, input, sample_posterior=True): method get_input (line 344) | def get_input(self, batch, k): method training_step (line 351) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 372) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 386) | def configure_optimizers(self): method get_last_layer (line 397) | def get_last_layer(self): method log_images (line 401) | def log_images(self, batch, only_inputs=False, **kwargs): method to_rgb (line 417) | def to_rgb(self, x): class IdentityFirstStage (line 426) | class IdentityFirstStage(torch.nn.Module): method __init__ (line 427) | def __init__(self, *args, vq_interface=False, **kwargs): method encode (line 431) | def encode(self, x, *args, **kwargs): method decode (line 434) | def decode(self, x, *args, **kwargs): method quantize (line 437) | def quantize(self, x, *args, **kwargs): method forward (line 442) | def forward(self, x, *args, **kwargs): FILE: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/models/diffusion/ddim.py class DDIMSampler (line 13) | class DDIMSampler(object): method __init__ (line 14) | def __init__(self, model, schedule="linear", **kwargs): method to (line 20) | def to(self, device): method register_buffer (line 29) | def register_buffer(self, name, attr): method make_schedule (line 35) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 67) | def sample(self, method ddim_sampling (line 128) | def ddim_sampling(self, cond, shape, method p_sample_ddim (line 186) | def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_origin... method encode (line 248) | def encode(self, x0, c, t_enc, use_original_steps=False, return_interm... method stochastic_encode (line 294) | def stochastic_encode(self, x0, t, use_original_steps=False, noise=None): method decode (line 310) | def decode(self, x_latent, cond, t_start, unconditional_guidance_scale... FILE: stable-dreamfusion/ldm/models/diffusion/ddpm.py function disabled_train (line 37) | def disabled_train(self, mode=True): function uniform_on_device (line 43) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 47) | class DDPM(pl.LightningModule): method __init__ (line 49) | def __init__(self, method register_schedule (line 126) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method ema_scope (line 181) | def ema_scope(self, context=None): method init_from_ckpt (line 196) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 254) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 266) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 272) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 281) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 294) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 303) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 318) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 324) | def q_sample(self, x_start, t, noise=None): method get_loss (line 329) | def get_loss(self, pred, target, mean=True): method p_losses (line 344) | def p_losses(self, x_start, t, noise=None): method forward (line 373) | def forward(self, x, *args, **kwargs): method get_input (line 379) | def get_input(self, batch, k): method shared_step (line 387) | def shared_step(self, batch): method training_step (line 392) | def training_step(self, batch, batch_idx): method validation_step (line 417) | def validation_step(self, batch, batch_idx): method on_train_batch_end (line 425) | def on_train_batch_end(self, *args, **kwargs): method _get_rows_from_list (line 429) | def _get_rows_from_list(self, samples): method log_images (line 437) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method configure_optimizers (line 474) | def configure_optimizers(self): class LatentDiffusion (line 483) | class LatentDiffusion(DDPM): method __init__ (line 485) | def __init__(self, method make_cond_schedule (line 539) | def make_cond_schedule(self, ): method on_train_batch_start (line 546) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 561) | def register_schedule(self, method instantiate_first_stage (line 570) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 577) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 598) | def _get_denoise_row_from_list(self, samples, desc='', force_no_decode... method get_first_stage_encoding (line 610) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 619) | def get_learned_conditioning(self, c): method meshgrid (line 632) | def meshgrid(self, h, w): method delta_border (line 639) | def delta_border(self, h, w): method get_weighting (line 653) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 669) | def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo... method get_input (line 723) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method decode_first_stage (line 763) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method encode_first_stage (line 823) | def encode_first_stage(self, x): method shared_step (line 862) | def shared_step(self, batch, **kwargs): method forward (line 867) | def forward(self, x, c, *args, **kwargs): method _rescale_annotations (line 878) | def _rescale_annotations(self, bboxes, crop_coordinates): # TODO: mov... method apply_model (line 888) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 986) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 990) | def _prior_bpd(self, x_start): method p_losses (line 1004) | def p_losses(self, x_start, cond, t, noise=None): method p_mean_variance (line 1039) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_codeboo... method p_sample (line 1071) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, method progressive_denoising (line 1102) | def progressive_denoising(self, cond, shape, verbose=True, callback=No... method p_sample_loop (line 1158) | def p_sample_loop(self, cond, shape, return_intermediates=False, method sample (line 1209) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method sample_log (line 1227) | def sample_log(self, cond, batch_size, ddim, ddim_steps, **kwargs): method get_unconditional_conditioning (line 1241) | def get_unconditional_conditioning(self, batch_size, null_label=None, ... method log_images (line 1262) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... method configure_optimizers (line 1387) | def configure_optimizers(self): method to_rgb (line 1432) | def to_rgb(self, x): class DiffusionWrapper (line 1441) | class DiffusionWrapper(pl.LightningModule): method __init__ (line 1442) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1448) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = Non... class LatentUpscaleDiffusion (line 1477) | class LatentUpscaleDiffusion(LatentDiffusion): method __init__ (line 1478) | def __init__(self, *args, low_scale_config, low_scale_key="LR", **kwar... method instantiate_low_stage (line 1485) | def instantiate_low_stage(self, config): method get_input (line 1493) | def get_input(self, batch, k, cond_key=None, bs=None, log_mode=False): method log_images (line 1515) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... class LatentInpaintDiffusion (line 1613) | class LatentInpaintDiffusion(LatentDiffusion): method __init__ (line 1619) | def __init__(self, method init_from_ckpt (line 1644) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method get_input (line 1674) | def get_input(self, batch, k, cond_key=None, bs=None, return_first_sta... method log_images (line 1700) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... class Layout2ImgDiffusion (line 1783) | class Layout2ImgDiffusion(LatentDiffusion): method __init__ (line 1785) | def __init__(self, cond_stage_key, *args, **kwargs): method log_images (line 1789) | def log_images(self, batch, N=8, *args, **kwargs): class SimpleUpscaleDiffusion (line 1807) | class SimpleUpscaleDiffusion(LatentDiffusion): method __init__ (line 1808) | def __init__(self, *args, low_scale_key="LR", **kwargs): method get_input (line 1815) | def get_input(self, batch, k, cond_key=None, bs=None, log_mode=False): method log_images (line 1838) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... class MultiCatFrameDiffusion (line 1899) | class MultiCatFrameDiffusion(LatentDiffusion): method __init__ (line 1900) | def __init__(self, *args, low_scale_key="LR", **kwargs): method get_input (line 1907) | def get_input(self, batch, k, cond_key=None, bs=None, log_mode=False): method log_images (line 1935) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... FILE: stable-dreamfusion/ldm/models/diffusion/plms.py class PLMSSampler (line 12) | class PLMSSampler(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 59) | def sample(self, method plms_sampling (line 120) | def plms_sampling(self, cond, shape, method p_sample_plms (line 180) | def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_origin... FILE: stable-dreamfusion/ldm/models/diffusion/sampling_util.py function append_dims (line 5) | def append_dims(x, target_dims): function renorm_thresholding (line 14) | def renorm_thresholding(x0, value): function norm_thresholding (line 42) | def norm_thresholding(x0, value): function spatial_norm_thresholding (line 47) | def spatial_norm_thresholding(x0, value): FILE: stable-dreamfusion/ldm/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 211) | def forward(self, x, context=None): method _forward (line 214) | def _forward(self, x, context=None): class SpatialTransformer (line 221) | class SpatialTransformer(nn.Module): method __init__ (line 229) | def __init__(self, in_channels, n_heads, d_head, method forward (line 255) | def forward(self, x, context=None): FILE: stable-dreamfusion/ldm/modules/diffusionmodules/model.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 146) | def __init__(self, in_channels): class AttnBlock (line 150) | class AttnBlock(nn.Module): method __init__ (line 151) | 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 316) | def forward(self, x, t=None, context=None): method get_last_layer (line 364) | def get_last_layer(self): class Encoder (line 368) | class Encoder(nn.Module): method __init__ (line 369) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 434) | def forward(self, x): class Decoder (line 462) | class Decoder(nn.Module): method __init__ (line 463) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 535) | def forward(self, z): class SimpleDecoder (line 571) | class SimpleDecoder(nn.Module): method __init__ (line 572) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 594) | def forward(self, x): class UpsampleDecoder (line 607) | class UpsampleDecoder(nn.Module): method __init__ (line 608) | def __init__(self, in_channels, out_channels, ch, num_res_blocks, reso... method forward (line 641) | def forward(self, x): class LatentRescaler (line 655) | class LatentRescaler(nn.Module): method __init__ (line 656) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 680) | def forward(self, x): class MergedRescaleEncoder (line 692) | class MergedRescaleEncoder(nn.Module): method __init__ (line 693) | def __init__(self, in_channels, ch, resolution, out_ch, num_res_blocks, method forward (line 705) | def forward(self, x): class MergedRescaleDecoder (line 711) | class MergedRescaleDecoder(nn.Module): method __init__ (line 712) | def __init__(self, z_channels, out_ch, resolution, num_res_blocks, att... method forward (line 722) | def forward(self, x): class Upsampler (line 728) | class Upsampler(nn.Module): method __init__ (line 729) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 741) | def forward(self, x): class Resize (line 747) | class Resize(nn.Module): method __init__ (line 748) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 763) | def forward(self, x, scale_factor=1.0): class FirstStagePostProcessor (line 770) | class FirstStagePostProcessor(nn.Module): method __init__ (line 772) | def __init__(self, ch_mult:list, in_channels, method instantiate_pretrained (line 807) | def instantiate_pretrained(self, config): method encode_with_pretrained (line 816) | def encode_with_pretrained(self,x): method forward (line 822) | def forward(self,x): FILE: stable-dreamfusion/ldm/modules/diffusionmodules/openaimodel.py function convert_module_to_f16 (line 25) | def convert_module_to_f16(x): function convert_module_to_f32 (line 28) | def convert_module_to_f32(x): class AttentionPool2d (line 33) | class AttentionPool2d(nn.Module): method __init__ (line 38) | def __init__( method forward (line 52) | def forward(self, x): class TimestepBlock (line 63) | class TimestepBlock(nn.Module): method forward (line 69) | def forward(self, x, emb): class TimestepEmbedSequential (line 75) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 81) | def forward(self, x, emb, context=None): class Upsample (line 92) | class Upsample(nn.Module): method __init__ (line 101) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 110) | def forward(self, x): class TransposedUpsample (line 122) | 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,paddi... method forward (line 159) | def forward(self, x): class ResBlock (line 164) | class ResBlock(TimestepBlock): method __init__ (line 180) | def __init__( method forward (line 244) | 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 319) | def _forward(self, x): function count_flops_attn (line 328) | def count_flops_attn(model, _x, y): class QKVAttentionLegacy (line 348) | class QKVAttentionLegacy(nn.Module): method __init__ (line 353) | def __init__(self, n_heads): method forward (line 357) | def forward(self, qkv): method count_flops (line 376) | def count_flops(model, _x, y): class QKVAttention (line 380) | class QKVAttention(nn.Module): method __init__ (line 385) | def __init__(self, n_heads): method forward (line 389) | def forward(self, qkv): method count_flops (line 410) | def count_flops(model, _x, y): class UNetModel (line 414) | class UNetModel(nn.Module): method __init__ (line 444) | def __init__( method convert_to_fp16 (line 729) | def convert_to_fp16(self): method convert_to_fp32 (line 737) | def convert_to_fp32(self): method forward (line 745) | def forward(self, x, timesteps=None, context=None, y=None,**kwargs): class EncoderUNetModel (line 780) | class EncoderUNetModel(nn.Module): method __init__ (line 786) | def __init__( method convert_to_fp16 (line 959) | def convert_to_fp16(self): method convert_to_fp32 (line 966) | def convert_to_fp32(self): method forward (line 973) | def forward(self, x, timesteps): FILE: stable-dreamfusion/ldm/modules/diffusionmodules/util.py function make_beta_schedule (line 21) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 46) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 63) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 77) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... function extract_into_tensor (line 96) | def extract_into_tensor(a, t, x_shape): function checkpoint (line 102) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 119) | class CheckpointFunction(torch.autograd.Function): method forward (line 121) | def forward(ctx, run_function, length, *args): method backward (line 131) | def backward(ctx, *output_grads): function timestep_embedding (line 151) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 174) | def zero_module(module): function scale_module (line 183) | def scale_module(module, scale): function mean_flat (line 192) | def mean_flat(tensor): function normalization (line 199) | def normalization(channels): class SiLU (line 209) | class SiLU(nn.Module): method forward (line 210) | def forward(self, x): class GroupNorm32 (line 214) | class GroupNorm32(nn.GroupNorm): method forward (line 215) | def forward(self, x): function conv_nd (line 218) | def conv_nd(dims, *args, **kwargs): function linear (line 231) | def linear(*args, **kwargs): function avg_pool_nd (line 238) | def avg_pool_nd(dims, *args, **kwargs): class HybridConditioner (line 251) | class HybridConditioner(nn.Module): method __init__ (line 253) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 258) | def forward(self, c_concat, c_crossattn): function noise_like (line 264) | def noise_like(shape, device, repeat=False): FILE: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/modules/encoders/modules.py class AbstractEncoder (line 12) | class AbstractEncoder(nn.Module): method __init__ (line 13) | def __init__(self): method encode (line 16) | def encode(self, *args, **kwargs): class IdentityEncoder (line 19) | class IdentityEncoder(AbstractEncoder): method encode (line 21) | def encode(self, x): class FaceClipEncoder (line 24) | class FaceClipEncoder(AbstractEncoder): method __init__ (line 25) | def __init__(self, augment=True, retreival_key=None): method forward (line 31) | def forward(self, img): method encode (line 54) | def encode(self, img): class FaceIdClipEncoder (line 61) | class FaceIdClipEncoder(AbstractEncoder): method __init__ (line 62) | def __init__(self): method forward (line 69) | def forward(self, img): method encode (line 84) | def encode(self, img): class ClassEmbedder (line 91) | class ClassEmbedder(nn.Module): method __init__ (line 92) | def __init__(self, embed_dim, n_classes=1000, key='class'): method forward (line 97) | def forward(self, batch, key=None): class TransformerEmbedder (line 106) | class TransformerEmbedder(AbstractEncoder): method __init__ (line 108) | def __init__(self, n_embed, n_layer, vocab_size, max_seq_len=77, devic... method forward (line 114) | def forward(self, tokens): method encode (line 119) | def encode(self, x): class BERTTokenizer (line 123) | class BERTTokenizer(AbstractEncoder): method __init__ (line 125) | def __init__(self, device="cuda", vq_interface=True, max_length=77): method forward (line 133) | def forward(self, text): method encode (line 140) | def encode(self, text): method decode (line 146) | def decode(self, text): class BERTEmbedder (line 150) | class BERTEmbedder(AbstractEncoder): method __init__ (line 152) | def __init__(self, n_embed, n_layer, vocab_size=30522, max_seq_len=77, method forward (line 163) | def forward(self, text): method encode (line 171) | def encode(self, text): function disabled_train (line 178) | def disabled_train(self, mode=True): class FrozenT5Embedder (line 184) | class FrozenT5Embedder(AbstractEncoder): method __init__ (line 186) | def __init__(self, version="google/t5-v1_1-large", device="cuda", max_... method freeze (line 194) | def freeze(self): method forward (line 200) | def forward(self, text): method encode (line 209) | def encode(self, text): class FrozenFaceEncoder (line 215) | class FrozenFaceEncoder(AbstractEncoder): method __init__ (line 216) | def __init__(self, model_path, augment=False): method forward (line 237) | def forward(self, img): method encode (line 251) | def encode(self, img): class FrozenCLIPEmbedder (line 254) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 256) | def __init__(self, version="openai/clip-vit-large-patch14", device="cu... method freeze (line 264) | def freeze(self): method forward (line 270) | def forward(self, text): method encode (line 279) | def encode(self, text): class ClipImageProjector (line 284) | class ClipImageProjector(AbstractEncoder): method __init__ (line 288) | def __init__(self, version="openai/clip-vit-large-patch14", max_length... method get_null_cond (line 301) | def get_null_cond(self, version, max_length): method preprocess (line 307) | def preprocess(self, x): method forward (line 317) | def forward(self, x): method encode (line 327) | def encode(self, im): class ProjectedFrozenCLIPEmbedder (line 330) | class ProjectedFrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 331) | def __init__(self, version="openai/clip-vit-large-patch14", device="cu... method forward (line 336) | def forward(self, text): method encode (line 340) | def encode(self, text): class FrozenCLIPImageEmbedder (line 343) | class FrozenCLIPImageEmbedder(AbstractEncoder): method __init__ (line 348) | def __init__( method preprocess (line 363) | def preprocess(self, x): method forward (line 373) | def forward(self, x): method encode (line 381) | def encode(self, im): class FrozenCLIPImageMutliEmbedder (line 387) | class FrozenCLIPImageMutliEmbedder(AbstractEncoder): method __init__ (line 392) | def __init__( method preprocess (line 409) | def preprocess(self, x): method forward (line 423) | def forward(self, x): method encode (line 440) | def encode(self, im): class SpatialRescaler (line 443) | class SpatialRescaler(nn.Module): method __init__ (line 444) | def __init__(self, method forward (line 462) | def forward(self,x): method encode (line 471) | def encode(self, x): class LowScaleEncoder (line 479) | class LowScaleEncoder(nn.Module): method __init__ (line 480) | def __init__(self, model_config, linear_start, linear_end, timesteps=1... method register_schedule (line 490) | def register_schedule(self, beta_schedule="linear", timesteps=1000, method q_sample (line 517) | def q_sample(self, x_start, t, noise=None): method forward (line 522) | def forward(self, x): method decode (line 532) | def decode(self, z): FILE: stable-dreamfusion/ldm/modules/evaluate/adm_evaluator.py function main (line 31) | def main(): class InvalidFIDException (line 84) | class InvalidFIDException(Exception): class FIDStatistics (line 88) | class FIDStatistics: method __init__ (line 89) | def __init__(self, mu: np.ndarray, sigma: np.ndarray): method frechet_distance (line 93) | def frechet_distance(self, other, eps=1e-6): class Evaluator (line 139) | class Evaluator: method __init__ (line 140) | def __init__( method warmup (line 156) | def warmup(self): method read_activations (line 159) | def read_activations(self, npz_path: str) -> Tuple[np.ndarray, np.ndar... method compute_activations (line 163) | def compute_activations(self, batches: Iterable[np.ndarray],silent=Fal... method read_statistics (line 186) | def read_statistics( method compute_statistics (line 196) | def compute_statistics(self, activations: np.ndarray) -> FIDStatistics: method compute_inception_score (line 201) | def compute_inception_score(self, activations: np.ndarray, split_size:... method compute_prec_recall (line 216) | def compute_prec_recall( class ManifoldEstimator (line 227) | class ManifoldEstimator: method __init__ (line 234) | def __init__( method warmup (line 263) | def warmup(self): method manifold_radii (line 270) | def manifold_radii(self, features: np.ndarray) -> np.ndarray: method evaluate (line 305) | def evaluate(self, features: np.ndarray, radii: np.ndarray, eval_featu... method evaluate_pr (line 347) | def evaluate_pr( class DistanceBlock (line 384) | class DistanceBlock: method __init__ (line 391) | def __init__(self, session): method pairwise_distances (line 415) | def pairwise_distances(self, U, V): method less_thans (line 424) | def less_thans(self, batch_1, radii_1, batch_2, radii_2): function _batch_pairwise_distances (line 436) | def _batch_pairwise_distances(U, V): class NpzArrayReader (line 455) | class NpzArrayReader(ABC): method read_batch (line 457) | def read_batch(self, batch_size: int) -> Optional[np.ndarray]: method remaining (line 461) | def remaining(self) -> int: method read_batches (line 464) | def read_batches(self, batch_size: int) -> Iterable[np.ndarray]: class BatchIterator (line 477) | class BatchIterator: method __init__ (line 478) | def __init__(self, gen_fn, length): method __len__ (line 482) | def __len__(self): method __iter__ (line 485) | def __iter__(self): class StreamingNpzArrayReader (line 489) | class StreamingNpzArrayReader(NpzArrayReader): method __init__ (line 490) | def __init__(self, arr_f, shape, dtype): method read_batch (line 496) | def read_batch(self, batch_size: int) -> Optional[np.ndarray]: method remaining (line 511) | def remaining(self) -> int: class MemoryNpzArrayReader (line 515) | class MemoryNpzArrayReader(NpzArrayReader): method __init__ (line 516) | def __init__(self, arr): method load (line 521) | def load(cls, path: str, arr_name: str): method read_batch (line 526) | def read_batch(self, batch_size: int) -> Optional[np.ndarray]: method remaining (line 534) | def remaining(self) -> int: function open_npz_array (line 539) | def open_npz_array(path: str, arr_name: str) -> NpzArrayReader: function _read_bytes (line 556) | def _read_bytes(fp, size, error_template="ran out of data"): function _open_npy_file (line 586) | def _open_npy_file(path: str, arr_name: str): function _download_inception_model (line 595) | def _download_inception_model(): function _create_feature_graph (line 608) | def _create_feature_graph(input_batch): function _create_softmax_graph (line 625) | def _create_softmax_graph(input_batch): function _update_shapes (line 639) | def _update_shapes(pool3): function _numpy_partition (line 658) | def _numpy_partition(arr, kth, **kwargs): FILE: stable-dreamfusion/ldm/modules/evaluate/evaluate_perceptualsim.py function normalize_tensor (line 18) | def normalize_tensor(in_feat, eps=1e-10): function cos_sim (line 25) | def cos_sim(in0, in1): class squeezenet (line 40) | class squeezenet(torch.nn.Module): method __init__ (line 41) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 72) | def forward(self, X): class alexnet (line 98) | class alexnet(torch.nn.Module): method __init__ (line 99) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 124) | def forward(self, X): class vgg16 (line 143) | class vgg16(torch.nn.Module): method __init__ (line 144) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 167) | def forward(self, X): class resnet (line 187) | class resnet(torch.nn.Module): method __init__ (line 188) | def __init__(self, requires_grad=False, pretrained=True, num=18): method forward (line 211) | def forward(self, X): class PNet (line 234) | class PNet(torch.nn.Module): method __init__ (line 237) | def __init__(self, pnet_type="vgg", pnet_rand=False, use_gpu=True): method forward (line 272) | def forward(self, in0, in1, retPerLayer=False): function ssim_metric (line 299) | def ssim_metric(img1, img2, mask=None): function psnr (line 304) | def psnr(img1, img2, mask=None,reshape=False): function perceptual_sim (line 328) | def perceptual_sim(img1, img2, vgg16): function load_img (line 334) | def load_img(img_name, size=None): function compute_perceptual_similarity (line 353) | def compute_perceptual_similarity(folder, pred_img, tgt_img, take_every_... function compute_perceptual_similarity_from_list (line 416) | def compute_perceptual_similarity_from_list(pred_imgs_list, tgt_imgs_list, function compute_perceptual_similarity_from_list_topk (line 502) | def compute_perceptual_similarity_from_list_topk(pred_imgs_list, tgt_img... FILE: stable-dreamfusion/ldm/modules/evaluate/frechet_video_distance.py function preprocess (line 35) | def preprocess(videos, target_resolution): function _is_in_graph (line 57) | def _is_in_graph(tensor_name): function create_id3_embedding (line 66) | def create_id3_embedding(videos,warmup=False,batch_size=16): function calculate_fvd (line 135) | def calculate_fvd(real_activations, FILE: stable-dreamfusion/ldm/modules/evaluate/ssim.py function gaussian (line 12) | def gaussian(window_size, sigma): function create_window (line 22) | def create_window(window_size, channel): function _ssim (line 31) | def _ssim( class SSIM (line 79) | class SSIM(torch.nn.Module): method __init__ (line 80) | def __init__(self, window_size=11, size_average=True): method forward (line 87) | def forward(self, img1, img2, mask=None): function ssim (line 116) | def ssim(img1, img2, window_size=11, mask=None, size_average=True): FILE: stable-dreamfusion/ldm/modules/evaluate/torch_frechet_video_distance.py function compute_frechet_distance (line 25) | def compute_frechet_distance(mu_sample,sigma_sample,mu_ref,sigma_ref) ->... function compute_stats (line 34) | def compute_stats(feats: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: function open_url (line 41) | def open_url(url: str, num_attempts: int = 10, verbose: bool = True, ret... function load_video (line 114) | def load_video(ip): function get_data_from_str (line 119) | def get_data_from_str(input_str,nprc = None): function get_stats (line 142) | def get_stats(stats): function compute_fvd (line 155) | def compute_fvd(ref_input, sample_input, bs=32, function compute_statistics (line 199) | def compute_statistics(videos_fake, videos_real, device: str='cuda', bs=... FILE: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/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: stable-dreamfusion/ldm/modules/losses/contperceptual.py class LPIPSWithDiscriminator (line 7) | class LPIPSWithDiscriminator(nn.Module): method __init__ (line 8) | def __init__(self, disc_start, logvar_init=0.0, kl_weight=1.0, pixello... method calculate_adaptive_weight (line 32) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 45) | def forward(self, inputs, reconstructions, posteriors, optimizer_idx, FILE: stable-dreamfusion/ldm/modules/losses/vqperceptual.py function hinge_d_loss_with_exemplar_weights (line 11) | def hinge_d_loss_with_exemplar_weights(logits_real, logits_fake, weights): function adopt_weight (line 20) | def adopt_weight(weight, global_step, threshold=0, value=0.): function measure_perplexity (line 26) | def measure_perplexity(predicted_indices, n_embed): function l1 (line 35) | def l1(x, y): function l2 (line 39) | def l2(x, y): class VQLPIPSWithDiscriminator (line 43) | class VQLPIPSWithDiscriminator(nn.Module): method __init__ (line 44) | def __init__(self, disc_start, codebook_weight=1.0, pixelloss_weight=1.0, method calculate_adaptive_weight (line 85) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 98) | def forward(self, codebook_loss, inputs, reconstructions, optimizer_idx, FILE: stable-dreamfusion/ldm/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 70) | def not_equals(val): function equals (line 76) | def equals(val): function max_neg_value (line 82) | def max_neg_value(tensor): function pick_and_pop (line 88) | def pick_and_pop(keys, d): function group_dict_by_key (line 93) | def group_dict_by_key(cond, d): function string_begins_with (line 102) | def string_begins_with(prefix, str): function group_by_key_prefix (line 106) | def group_by_key_prefix(prefix, d): function groupby_prefix_and_trim (line 110) | def groupby_prefix_and_trim(prefix, d): class Scale (line 117) | class Scale(nn.Module): method __init__ (line 118) | def __init__(self, value, fn): method forward (line 123) | def forward(self, x, **kwargs): class Rezero (line 128) | class Rezero(nn.Module): method __init__ (line 129) | def __init__(self, fn): method forward (line 134) | def forward(self, x, **kwargs): class ScaleNorm (line 139) | class ScaleNorm(nn.Module): method __init__ (line 140) | def __init__(self, dim, eps=1e-5): method forward (line 146) | def forward(self, x): class RMSNorm (line 151) | class RMSNorm(nn.Module): method __init__ (line 152) | def __init__(self, dim, eps=1e-8): method forward (line 158) | def forward(self, x): class Residual (line 163) | class Residual(nn.Module): method forward (line 164) | def forward(self, x, residual): class GRUGating (line 168) | class GRUGating(nn.Module): method __init__ (line 169) | def __init__(self, dim): method forward (line 173) | def forward(self, x, residual): class GEGLU (line 184) | class GEGLU(nn.Module): method __init__ (line 185) | def __init__(self, dim_in, dim_out): method forward (line 189) | def forward(self, x): class FeedForward (line 194) | class FeedForward(nn.Module): method __init__ (line 195) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 210) | def forward(self, x): class Attention (line 215) | class Attention(nn.Module): method __init__ (line 216) | def __init__( method forward (line 268) | def forward( class AttentionLayers (line 370) | class AttentionLayers(nn.Module): method __init__ (line 371) | def __init__( method forward (line 481) | def forward( class Encoder (line 541) | class Encoder(AttentionLayers): method __init__ (line 542) | def __init__(self, **kwargs): class TransformerWrapper (line 548) | class TransformerWrapper(nn.Module): method __init__ (line 549) | def __init__( method init_ (line 595) | def init_(self): method forward (line 598) | def forward( FILE: stable-dreamfusion/ldm/thirdp/psp/helpers.py class Flatten (line 12) | class Flatten(Module): method forward (line 13) | def forward(self, input): function l2_norm (line 17) | def l2_norm(input, axis=1): class Bottleneck (line 23) | class Bottleneck(namedtuple('Block', ['in_channel', 'depth', 'stride'])): function get_block (line 27) | def get_block(in_channel, depth, num_units, stride=2): function get_blocks (line 31) | def get_blocks(num_layers): class SEModule (line 58) | class SEModule(Module): method __init__ (line 59) | def __init__(self, channels, reduction): method forward (line 67) | def forward(self, x): class bottleneck_IR (line 77) | class bottleneck_IR(Module): method __init__ (line 78) | def __init__(self, in_channel, depth, stride): method forward (line 93) | def forward(self, x): class bottleneck_IR_SE (line 99) | class bottleneck_IR_SE(Module): method __init__ (line 100) | def __init__(self, in_channel, depth, stride): method forward (line 118) | def forward(self, x): FILE: stable-dreamfusion/ldm/thirdp/psp/id_loss.py class IDFeatures (line 7) | class IDFeatures(nn.Module): method __init__ (line 8) | def __init__(self, model_path): method forward (line 16) | def forward(self, x, crop=False): FILE: stable-dreamfusion/ldm/thirdp/psp/model_irse.py class Backbone (line 11) | class Backbone(Module): method __init__ (line 12) | def __init__(self, input_size, num_layers, mode='ir', drop_ratio=0.4, ... method forward (line 46) | def forward(self, x): function IR_50 (line 53) | def IR_50(input_size): function IR_101 (line 59) | def IR_101(input_size): function IR_152 (line 65) | def IR_152(input_size): function IR_SE_50 (line 71) | def IR_SE_50(input_size): function IR_SE_101 (line 77) | def IR_SE_101(input_size): function IR_SE_152 (line 83) | def IR_SE_152(input_size): FILE: stable-dreamfusion/ldm/util.py function pil_rectangle_crop (line 21) | def pil_rectangle_crop(im): function log_txt_as_img (line 41) | def log_txt_as_img(wh, xc, size=10): function ismap (line 65) | def ismap(x): function isimage (line 71) | def isimage(x): function exists (line 77) | def exists(x): function default (line 81) | def default(val, d): function mean_flat (line 87) | def mean_flat(tensor): function count_params (line 95) | def count_params(model, verbose=False): function instantiate_from_config (line 102) | def instantiate_from_config(config): function get_obj_from_str (line 112) | def get_obj_from_str(string, reload=False): class AdamWwithEMAandWings (line 120) | class AdamWwithEMAandWings(optim.Optimizer): method __init__ (line 122) | def __init__(self, params, lr=1.e-3, betas=(0.9, 0.999), eps=1.e-8, #... method __setstate__ (line 143) | def __setstate__(self, state): method step (line 149) | def step(self, closure=None): FILE: stable-dreamfusion/main.py class LoadFromFile (line 13) | class LoadFromFile (argparse.Action): method __call__ (line 14) | def __call__ (self, parser, namespace, values, option_string = None): FILE: stable-dreamfusion/meshutils.py function poisson_mesh_reconstruction (line 4) | def poisson_mesh_reconstruction(points, normals=None): function decimate_mesh (line 39) | def decimate_mesh(verts, faces, target, backend='pymeshlab', remesh=Fals... function clean_mesh (line 75) | def clean_mesh(verts, faces, v_pct=1, min_f=8, min_d=5, repair=True, rem... FILE: stable-dreamfusion/nerf/gui.py class OrbitCamera (line 10) | class OrbitCamera: method __init__ (line 11) | def __init__(self, W, H, r=2, fovy=60): method pose (line 24) | def pose(self): method intrinsics (line 38) | def intrinsics(self): method mvp (line 43) | def mvp(self): method orbit (line 54) | def orbit(self, dx, dy): method scale (line 61) | def scale(self, delta): method pan (line 64) | def pan(self, dx, dy, dz=0): class NeRFGUI (line 69) | class NeRFGUI: method __init__ (line 70) | def __init__(self, opt, trainer, loader=None, debug=True): method __del__ (line 99) | def __del__(self): method train_step (line 103) | def train_step(self): method prepare_buffer (line 128) | def prepare_buffer(self, outputs): method test_step (line 137) | def test_step(self): method register_dpg (line 172) | def register_dpg(self): method render (line 478) | def render(self): FILE: stable-dreamfusion/nerf/network.py class ResBlock (line 14) | class ResBlock(nn.Module): method __init__ (line 15) | def __init__(self, dim_in, dim_out, bias=True): method forward (line 29) | def forward(self, x): class BasicBlock (line 44) | class BasicBlock(nn.Module): method __init__ (line 45) | def __init__(self, dim_in, dim_out, bias=True): method forward (line 53) | def forward(self, x): class MLP (line 61) | class MLP(nn.Module): method __init__ (line 62) | def __init__(self, dim_in, dim_out, dim_hidden, num_layers, bias=True,... method forward (line 81) | def forward(self, x): class NeRFNetwork (line 89) | class NeRFNetwork(NeRFRenderer): method __init__ (line 90) | def __init__(self, method common_forward (line 118) | def common_forward(self, x): method finite_difference_normal (line 132) | def finite_difference_normal(self, x, epsilon=1e-2): method normal (line 149) | def normal(self, x): method forward (line 164) | def forward(self, x, d, l=None, ratio=1, shading='albedo'): method density (line 203) | def density(self, x): method background (line 214) | def background(self, d): method get_params (line 226) | def get_params(self, lr): FILE: stable-dreamfusion/nerf/network_grid.py class MLP (line 13) | class MLP(nn.Module): method __init__ (line 14) | def __init__(self, dim_in, dim_out, dim_hidden, num_layers, bias=True): method forward (line 27) | def forward(self, x): class NeRFNetwork (line 35) | class NeRFNetwork(NeRFRenderer): method __init__ (line 36) | def __init__(self, method common_forward (line 68) | def common_forward(self, x): method finite_difference_normal (line 81) | def finite_difference_normal(self, x, epsilon=1e-2): method normal (line 98) | def normal(self, x): method forward (line 104) | def forward(self, x, d, l=None, ratio=1, shading='albedo'): method density (line 133) | def density(self, x): method background (line 144) | def background(self, d): method get_params (line 156) | def get_params(self, lr): FILE: stable-dreamfusion/nerf/network_grid_taichi.py class MLP (line 13) | class MLP(nn.Module): method __init__ (line 14) | def __init__(self, dim_in, dim_out, dim_hidden, num_layers, bias=True): method forward (line 27) | def forward(self, x): class NeRFNetwork (line 35) | class NeRFNetwork(NeRFRenderer): method __init__ (line 36) | def __init__(self, method common_forward (line 67) | def common_forward(self, x): method finite_difference_normal (line 80) | def finite_difference_normal(self, x, epsilon=1e-2): method normal (line 97) | def normal(self, x): method forward (line 103) | def forward(self, x, d, l=None, ratio=1, shading='albedo'): method density (line 131) | def density(self, x): method background (line 142) | def background(self, d): method get_params (line 154) | def get_params(self, lr): FILE: stable-dreamfusion/nerf/network_grid_tcnn.py class MLP (line 15) | class MLP(nn.Module): method __init__ (line 16) | def __init__(self, dim_in, dim_out, dim_hidden, num_layers, bias=True): method forward (line 29) | def forward(self, x): class NeRFNetwork (line 37) | class NeRFNetwork(NeRFRenderer): method __init__ (line 38) | def __init__(self, method common_forward (line 82) | def common_forward(self, x): method normal (line 93) | def normal(self, x): method forward (line 108) | def forward(self, x, d, l=None, ratio=1, shading='albedo'): method density (line 141) | def density(self, x): method background (line 152) | def background(self, d): method get_params (line 164) | def get_params(self, lr): FILE: stable-dreamfusion/nerf/provider.py function visualize_poses (line 27) | def visualize_poses(poses, dirs, size=0.1): function get_view_direction (line 52) | def get_view_direction(thetas, phis, overhead, front): function rand_poses (line 73) | def rand_poses(size, device, opt, radius_range=[1, 1.5], theta_range=[0,... function circle_poses (line 152) | def circle_poses(device, radius=torch.tensor([3.2]), theta=torch.tensor(... class NeRFDataset (line 183) | class NeRFDataset: method __init__ (line 184) | def __init__(self, opt, device, type='train', H=256, W=256, size=100): method get_default_view_data (line 207) | def get_default_view_data(self): method collate (line 248) | def collate(self, index): method dataloader (line 316) | def dataloader(self, batch_size=None): FILE: stable-dreamfusion/nerf/renderer.py function sample_pdf (line 19) | def sample_pdf(bins, weights, n_samples, det=False): function near_far_from_bound (line 56) | def near_far_from_bound(rays_o, rays_d, bound, type='cube', min_near=0.05): function plot_pointcloud (line 82) | def plot_pointcloud(pc, color=None): class DMTet (line 94) | class DMTet(): method __init__ (line 95) | def __init__(self, device): method sort_edges (line 118) | def sort_edges(self, edges_ex2): method __call__ (line 128) | def __call__(self, pos_nx3, sdf_n, tet_fx4): function compute_edge_to_face_mapping (line 176) | def compute_edge_to_face_mapping(attr_idx): function normal_consistency (line 209) | def normal_consistency(face_normals, t_pos_idx): function laplacian_uniform (line 224) | def laplacian_uniform(verts, faces): function laplacian_smooth_loss (line 248) | def laplacian_smooth_loss(verts, faces): class NeRFRenderer (line 257) | class NeRFRenderer(nn.Module): method __init__ (line 258) | def __init__(self, opt): method density_blob (line 339) | def density_blob(self, x): method forward (line 351) | def forward(self, x, d): method density (line 354) | def density(self, x): method reset_extra_state (line 357) | def reset_extra_state(self): method export_mesh (line 366) | def export_mesh(self, path, resolution=None, decimate_target=-1, S=128): method run (line 560) | def run(self, rays_o, rays_d, light_d=None, ambient_ratio=1.0, shading... method run_cuda (line 710) | def run_cuda(self, rays_o, rays_d, light_d=None, ambient_ratio=1.0, sh... method init_tet (line 818) | def init_tet(self, mesh=None): method run_dmtet (line 862) | def run_dmtet(self, rays_o, rays_d, mvp, h, w, light_d=None, ambient_r... method run_taichi (line 966) | def run_taichi(self, rays_o, rays_d, light_d=None, ambient_ratio=1.0, ... method update_extra_state (line 1103) | def update_extra_state(self, decay=0.95, S=128): method render (line 1154) | def render(self, rays_o, rays_d, mvp, h, w, staged=False, max_ray_batc... FILE: stable-dreamfusion/nerf/utils.py function adjust_text_embeddings (line 34) | def adjust_text_embeddings(embeddings, azimuth, opt): function get_pos_neg_text_embeddings (line 60) | def get_pos_neg_text_embeddings(embeddings, azimuth_val, opt): function custom_meshgrid (line 102) | def custom_meshgrid(*args): function safe_normalize (line 109) | def safe_normalize(x, eps=1e-20): function get_rays (line 113) | def get_rays(poses, intrinsics, H, W, N=-1, error_map=None): function seed_everything (line 179) | def seed_everything(seed): function linear_to_srgb (line 190) | def linear_to_srgb(x): function srgb_to_linear (line 195) | def srgb_to_linear(x): class Trainer (line 199) | class Trainer(object): method __init__ (line 200) | def __init__(self, method prepare_embeddings (line 353) | def prepare_embeddings(self): method __del__ (line 423) | def __del__(self): method log (line 428) | def log(self, *args, **kwargs): method train_step (line 439) | def train_step(self, data, save_guidance_path:Path=None): method post_train_step (line 725) | def post_train_step(self): method eval_step (line 743) | def eval_step(self, data): method test_step (line 765) | def test_step(self, data, bg_color=None, perturb=False): method save_mesh (line 787) | def save_mesh(self, loader=None, save_path=None): method train (line 802) | def train(self, train_loader, valid_loader, test_loader, max_epochs): method evaluate (line 833) | def evaluate(self, loader, name=None): method test (line 838) | def test(self, loader, save_path=None, name=None, write_video=True): method train_gui (line 890) | def train_gui(self, train_loader, step=16): method test_gui (line 949) | def test_gui(self, pose, intrinsics, mvp, W, H, bg_color=None, spp=1, ... method train_one_epoch (line 1008) | def train_one_epoch(self, loader, max_epochs): method evaluate_one_epoch (line 1115) | def evaluate_one_epoch(self, loader, name=None): method save_checkpoint (line 1206) | def save_checkpoint(self, name=None, full=False, best=False): method load_checkpoint (line 1266) | def load_checkpoint(self, checkpoint=None, model_only=False): function get_CPU_mem (line 1337) | def get_CPU_mem(): function get_GPU_mem (line 1341) | def get_GPU_mem(): FILE: stable-dreamfusion/optimizer.py class Adan (line 23) | class Adan(Optimizer): method __init__ (line 47) | def __init__(self, method __setstate__ (line 80) | def __setstate__(self, state): method restart_opt (line 86) | def restart_opt(self): method step (line 102) | def step(self, closure=None): function _single_tensor_adan (line 201) | def _single_tensor_adan( function _multi_tensor_adan (line 259) | def _multi_tensor_adan( FILE: stable-dreamfusion/preprocess_image.py class BackgroundRemoval (line 14) | class BackgroundRemoval(): method __init__ (line 15) | def __init__(self, device='cuda'): method __call__ (line 32) | def __call__(self, image): class BLIP2 (line 41) | class BLIP2(): method __init__ (line 42) | def __init__(self, device='cuda'): method __call__ (line 49) | def __call__(self, image): class DPT (line 59) | class DPT(): method __init__ (line 60) | def __init__(self, task='depth', device='cuda'): method __call__ (line 97) | def __call__(self, image): FILE: stable-dreamfusion/raymarching/backend.py function find_cl_path (line 17) | def find_cl_path(): FILE: stable-dreamfusion/raymarching/raymarching.py function get_backend (line 14) | def get_backend(): class _near_far_from_aabb (line 31) | class _near_far_from_aabb(Function): method forward (line 34) | def forward(ctx, rays_o, rays_d, aabb, min_near=0.2): class _sph_from_ray (line 64) | class _sph_from_ray(Function): method forward (line 67) | def forward(ctx, rays_o, rays_d, radius): class _morton3D (line 95) | class _morton3D(Function): method forward (line 97) | def forward(ctx, coords): class _morton3D_invert (line 118) | class _morton3D_invert(Function): method forward (line 120) | def forward(ctx, indices): class _packbits (line 141) | class _packbits(Function): method forward (line 144) | def forward(ctx, grid, thresh, bitfield=None): class _flatten_rays (line 170) | class _flatten_rays(Function): method forward (line 172) | def forward(ctx, rays, M): class _march_rays_train (line 197) | class _march_rays_train(Function): method forward (line 200) | def forward(ctx, rays_o, rays_d, bound, density_bitfield, C, H, nears,... class _composite_rays_train (line 261) | class _composite_rays_train(Function): method forward (line 264) | def forward(ctx, sigmas, rgbs, ts, rays, T_thresh=1e-4, binarize=False): method backward (line 299) | def backward(ctx, grad_weights, grad_weights_sum, grad_depth, grad_ima... class _march_rays (line 323) | class _march_rays(Function): method forward (line 326) | def forward(ctx, n_alive, n_step, rays_alive, rays_t, rays_o, rays_d, ... class _composite_rays (line 374) | class _composite_rays(Function): method forward (line 377) | def forward(ctx, n_alive, n_step, rays_alive, rays_t, sigmas, rgbs, ts... FILE: stable-dreamfusion/raymarching/setup.py function find_cl_path (line 18) | def find_cl_path(): FILE: stable-dreamfusion/raymarching/src/bindings.cpp function PYBIND11_MODULE (line 5) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: stable-dreamfusion/shencoder/backend.py function find_cl_path (line 17) | def find_cl_path(): FILE: stable-dreamfusion/shencoder/setup.py function find_cl_path (line 18) | def find_cl_path(): FILE: stable-dreamfusion/shencoder/sphere_harmonics.py class _sh_encoder (line 14) | class _sh_encoder(Function): method forward (line 17) | def forward(ctx, inputs, degree, calc_grad_inputs=False): method backward (line 42) | def backward(ctx, grad): class SHEncoder (line 61) | class SHEncoder(nn.Module): method __init__ (line 62) | def __init__(self, input_dim=3, degree=4): method __repr__ (line 72) | def __repr__(self): method forward (line 75) | def forward(self, inputs, size=1): FILE: stable-dreamfusion/shencoder/src/bindings.cpp function PYBIND11_MODULE (line 5) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: stable-dreamfusion/taichi_modules/hash_encoder.py function random_initialize (line 15) | def random_initialize(data: ti.types.ndarray()): function ti_copy (line 21) | def ti_copy(data1: ti.template(), data2: ti.template()): function ti_copy_array (line 27) | def ti_copy_array(data1: ti.types.ndarray(), data2: ti.types.ndarray()): function ti_copy_field_array (line 33) | def ti_copy_field_array(data1: ti.template(), data2: ti.types.ndarray()): function fast_hash (line 39) | def fast_hash(pos_grid_local): function under_hash (line 49) | def under_hash(pos_grid_local, resolution): function grid_pos2hash_index (line 59) | def grid_pos2hash_index(indicator, pos_grid_local, resolution, map_size): function hash_encode_kernel (line 70) | def hash_encode_kernel( function hash_encode_kernel_half2 (line 120) | def hash_encode_kernel_half2( class HashEncoderTaichi (line 166) | class HashEncoderTaichi(torch.nn.Module): method __init__ (line 168) | def __init__(self, method zero_grad (line 300) | def zero_grad(self): method forward (line 303) | def forward(self, positions, bound=1): FILE: stable-dreamfusion/taichi_modules/intersection.py function simple_ray_aabb_intersec_taichi_forward (line 10) | def simple_ray_aabb_intersec_taichi_forward( class RayAABBIntersector (line 39) | class RayAABBIntersector(torch.autograd.Function): method forward (line 60) | def forward(ctx, rays_o, rays_d, center, half_size, max_hits): FILE: stable-dreamfusion/taichi_modules/ray_march.py function raymarching_train (line 10) | def raymarching_train(rays_o: ti.types.ndarray(ndim=2), function raymarching_train_backword (line 129) | def raymarching_train_backword(segments: ti.types.ndarray(ndim=2), class RayMarcherTaichi (line 145) | class RayMarcherTaichi(torch.nn.Module): method __init__ (line 147) | def __init__(self, batch_size=8192): method forward (line 221) | def forward(self, rays_o, rays_d, hits_t, density_bitfield, cascades, function raymarching_test_kernel (line 230) | def raymarching_test_kernel( function raymarching_test (line 306) | def raymarching_test(rays_o, rays_d, hits_t, alive_indices, density_bitf... FILE: stable-dreamfusion/taichi_modules/utils.py function scalbn (line 18) | def scalbn(x, exponent): function calc_dt (line 23) | def calc_dt(t, exp_step_factor, grid_size, scale): function frexp_bit (line 29) | def frexp_bit(x): function mip_from_pos (line 47) | def mip_from_pos(xyz, cascades): function mip_from_dt (line 56) | def mip_from_dt(dt, grid_size, cascades): function __expand_bits (line 64) | def __expand_bits(v): function __morton3D (line 73) | def __morton3D(xyz): function __morton3D_invert (line 79) | def __morton3D_invert(x): function morton3D_invert_kernel (line 89) | def morton3D_invert_kernel(indices: ti.types.ndarray(ndim=1), function morton3D_invert (line 98) | def morton3D_invert(indices): function morton3D_kernel (line 109) | def morton3D_kernel(xyzs: ti.types.ndarray(ndim=2), function morton3D (line 116) | def morton3D(coords1): function packbits (line 126) | def packbits(density_grid: ti.types.ndarray(ndim=1), function torch2ti (line 141) | def torch2ti(field: ti.template(), data: ti.types.ndarray()): function ti2torch (line 147) | def ti2torch(field: ti.template(), data: ti.types.ndarray()): function ti2torch_grad (line 153) | def ti2torch_grad(field: ti.template(), grad: ti.types.ndarray()): function torch2ti_grad (line 159) | def torch2ti_grad(field: ti.template(), grad: ti.types.ndarray()): function torch2ti_vec (line 165) | def torch2ti_vec(field: ti.template(), data: ti.types.ndarray()): function ti2torch_vec (line 171) | def ti2torch_vec(field: ti.template(), data: ti.types.ndarray()): function ti2torch_grad_vec (line 178) | def ti2torch_grad_vec(field: ti.template(), grad: ti.types.ndarray()): function torch2ti_grad_vec (line 185) | def torch2ti_grad_vec(field: ti.template(), grad: ti.types.ndarray()): function extract_model_state_dict (line 191) | def extract_model_state_dict(ckpt_path, function load_ckpt (line 210) | def load_ckpt(model, ckpt_path, model_name='model', prefixes_to_ignore=[]): function depth2img (line 219) | def depth2img(depth): FILE: stable-dreamfusion/taichi_modules/volume_render_test.py function composite_test (line 5) | def composite_test( FILE: stable-dreamfusion/taichi_modules/volume_train.py function composite_train_fw_array (line 10) | def composite_train_fw_array( function composite_train_fw (line 52) | def composite_train_fw(sigmas: ti.template(), rgbs: ti.template(), function check_value (line 102) | def check_value( class VolumeRendererTaichi (line 112) | class VolumeRendererTaichi(torch.nn.Module): method __init__ (line 114) | def __init__(self, batch_size=8192, data_type=data_type): method zero_grad (line 231) | def zero_grad(self): method forward (line 237) | def forward(self, sigmas, rgbs, deltas, ts, rays_a, T_threshold): FILE: stable-dreamfusion/tets/generate_tets.py function generate_tetrahedron_grid_file (line 21) | def generate_tetrahedron_grid_file(res=32, root='..'): function convert_from_quartet_to_npz (line 31) | def convert_from_quartet_to_npz(quartetfile = 'cube_32_tet.tet', npzfile...