Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SagiPolaczek/NeuralSVG
/ functions
Functions
216 in github.com/SagiPolaczek/NeuralSVG
⨍
Functions
216
◇
Types & classes
36
↓ 1 callers
Method
decode
(self, tokens)
CLIP_/clip/simple_tokenizer.py:143
↓ 1 callers
Function
default_bpe
()
CLIP_/clip/simple_tokenizer.py:11
↓ 1 callers
Method
encode_text
(self, text)
CLIP_/clip/model.py:464
↓ 1 callers
Function
exponential_decay_distribution
Create exponential decay distribution.
src/models/nerf_mlp_multi.py:560
↓ 1 callers
Method
forward
(self, image, text)
CLIP_/clip/model.py:479
↓ 1 callers
Method
forward_single_stroke
Forward pass for single stroke.
src/models/nerf_mlp_multi.py:302
↓ 1 callers
Function
generate_image_if_needed
Generate an image from text prompt if it doesn't already exist.
scripts/train.py:56
↓ 1 callers
Function
get_attention_map
(image, model, device, image_size: int)
src/models/attention_utils.py:24
↓ 1 callers
Function
get_clip_attention_map
( input_image: Image.Image, image_size: int, device: str = "cuda" )
src/models/attention_utils.py:11
↓ 1 callers
Method
get_color_name_to_value_map
Create mapping from color names to normalized RGB values.
src/models/painter_nerf.py:415
↓ 1 callers
Method
get_parameters
(self)
src/models/painter.py:482
↓ 1 callers
Method
get_save_dict
Get dictionary of data to save in checkpoint. Returns: Dict[str, Any]: Checkpoint data
src/training/coach.py:1028
↓ 1 callers
Function
get_truncated_normal
Create a truncated normal distribution. This utility function creates a scipy truncated normal distribution with the specified parameter
src/training/losses.py:321
↓ 1 callers
Method
get_w
Get timestep weight. Args: timestep: Current timestep Returns: float: Weight value
src/training/losses.py:276
↓ 1 callers
Method
handle_raw_image
Handle raw image https://github.com/BachiLi/diffvg/blob/85802a71fbcc72d79cb75716eb4da4392fd09532/apps/refine_svg.py#L64
src/models/painter.py:191
↓ 1 callers
Method
init_losses
Initialize loss functions. Returns: Dict[str, nn.Module]: Dictionary of loss modules
src/training/coach.py:836
↓ 1 callers
Method
init_model
Initialize the sketch model. Returns: SketchModel: Initialized model
src/training/coach.py:827
↓ 1 callers
Method
init_optimizer
Initialize the optimizer. Returns: torch.optim.Optimizer: Initialized optimizer Raises: ValueError: If optim
src/training/coach.py:849
↓ 1 callers
Method
init_scheduler
Initialize the learning rate scheduler. Returns: LRScheduler: Initialized scheduler Raises: ValueError: If s
src/training/coach.py:875
↓ 1 callers
Method
init_wandb
Initialize Weights & Biases logging.
src/training/logging/coach_logger.py:53
↓ 1 callers
Method
initialize_parameters
(self)
CLIP_/clip/model.py:413
↓ 1 callers
Method
is_final_step
Check if current step is the final training step. Returns: bool: True if current step is final
src/training/coach.py:803
↓ 1 callers
Function
load_regular_image
Load image without segmentation. Args: image_path: Input image path transform: Transform pipeline Returns: tuple: (i
src/data/data_setups.py:66
↓ 1 callers
Method
log_config
Log configuration parameters.
src/training/logging/coach_logger.py:60
↓ 1 callers
Method
log_git_info
Save git repository information.
src/training/logging/coach_logger.py:139
↓ 1 callers
Method
log_text_prompt
Save text prompt to file.
src/training/logging/coach_logger.py:93
↓ 1 callers
Function
main
Main training function.
scripts/train.py:108
↓ 1 callers
Method
normalize
Normalize input to [-1, 1] range.
src/models/nerf_mlp_multi.py:492
↓ 1 callers
Function
plot_batch_layers
Plot batch with layer SVGs.
src/training/utils/vis_utils.py:322
↓ 1 callers
Function
plot_batch_with_internal_dropout
Plot batch with dropout outputs.
src/training/utils/vis_utils.py:260
↓ 1 callers
Function
run_pretraining
Run the pretraining phase of the model.
scripts/train.py:95
↓ 1 callers
Method
sample_timestep
Sample diffusion timesteps. Args: train_step: Current training step batch_size: Number of samples Returns:
src/training/losses.py:101
↓ 1 callers
Method
sample_truncation_idx
Sample truncation index.
src/models/nerf_mlp_multi.py:440
↓ 1 callers
Function
seed_everything
Set random seeds for reproducibility.
scripts/train.py:32
↓ 1 callers
Function
segment_image
Segment foreground object from image.
src/data/data_setups.py:33
↓ 1 callers
Function
set_init_strokes_with_attention_map
( attention_map: torch.Tensor, input_image: torch.Tensor, num_strokes: int, image_size: int,
src/models/attention_utils.py:65
↓ 1 callers
Function
simply_plot_image
Plot single image.
src/training/utils/vis_utils.py:237
↓ 1 callers
Method
time_to
Check if it's time to perform an interval-based action. Args: interval (int): Interval to check Returns: boo
src/training/coach.py:792
↓ 1 callers
Function
whitespace_clean
(text)
CLIP_/clip/simple_tokenizer.py:62
↓ 1 callers
Method
x_augment
Apply augmentations to input.
src/training/losses.py:176
Method
__call__
Calculate learning rate for current step. Args: step (int): Current step Returns: float: Learning rate
src/training/coach.py:1139
Method
__call__
(self, im, k=10)
src/models/attention_utils.py:170
Method
__init__
(self, bpe_path: str = default_bpe())
CLIP_/clip/simple_tokenizer.py:69
Method
__init__
( self, embed_dim, num_heads, dropout=0.0, bias=True, add_bias
CLIP_/clip/auxilary.py:382
Method
__init__
(self, inplanes, planes, stride=1)
CLIP_/clip/model.py:14
Method
__init__
( self, spacial_dim: int, embed_dim: int, num_heads: int, output_dim: int = None )
CLIP_/clip/model.py:71
Method
__init__
(self, layers, output_dim, heads, input_resolution=224, width=64)
CLIP_/clip/model.py:124
Method
__init__
(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None)
CLIP_/clip/model.py:201
Method
__init__
( self, width: int, layers: int, heads: int, attn_mask: torch.Tensor = None )
CLIP_/clip/model.py:275
Method
__init__
( self, input_resolution: int, patch_size: int, width: int, layers: in
CLIP_/clip/model.py:293
Method
__init__
Initialize the training coach. Args: cfg: Configuration object model: Optional pre-initialized model
src/training/coach.py:47
Method
__init__
Initialize the learning rate scheduler. Args: func_type (str): Type of scheduling function max_steps (int): Maximum n
src/training/coach.py:1052
Method
__init__
Initialize SDS loss. Args: cfg: Configuration object device: Device to run on
src/training/losses.py:39
Method
__init__
Initialize logger. Args: cfg: Configuration object
src/training/logging/coach_logger.py:26
Method
__init__
Initialize multi-output NeRF MLP.
src/models/nerf_mlp_multi.py:24
Method
__init__
Initialize Gaussian embedding.
src/models/nerf_mlp_multi.py:460
Method
__init__
Initialize RGB Gaussian embedding.
src/models/nerf_mlp_multi.py:500
Method
__init__
Initialize renderer with config and device.
src/models/painter_nerf.py:30
Method
__init__
Initialize the Painter model.
src/models/painter.py:25
Method
__init__
(self)
src/models/attention_utils.py:162
Method
__init__
Initialize the base model.
src/models/model.py:22
Method
__post_init__
Initialize and validate experiment directories.
src/configs/log_config.py:20
Method
__post_init__
Validate configuration after initialization.
src/configs/model_config.py:43
Method
__post_init__
Validate configuration after initialization.
src/configs/train_steps_config.py:16
Method
__post_init__
(self)
src/configs/train_config.py:88
Method
__post_init__
(self)
src/configs/train_config.py:116
Method
__post_init__
Initialize and validate relationships between configurations.
src/configs/train_config.py:143
Method
__post_init__
Validate configuration after initialization.
src/configs/data_config.py:33
Method
__post_init__
Validate configuration after initialization.
src/configs/optim_config.py:46
Method
__setstate__
(self, state)
CLIP_/clip/auxilary.py:449
Function
_convert_weights_to_fp16
(l)
CLIP_/clip/model.py:499
Method
_get_toggle_colors_for_step
Get color toggle values for current step.
src/training/coach.py:459
Method
_is_in_canvas
(self, canvas_width: int, canvas_height: int, path: pydiffvg.Path)
src/models/painter.py:442
Method
_process_single_color
Process a single color during training. Args: toggle_color_value: Color value to condition on Returns: tuple
src/training/coach.py:478
Method
_save_visualization
Save visualization of current model state. Args: init_sketch: Initial sketch for comparison
src/training/coach.py:602
Method
_update_model_and_logging
Update model parameters and logging. Args: loss_dict: Dictionary of loss components
src/training/coach.py:568
Function
aggregated_loss_dict
Aggregate loss dictionaries. Args: agg_loss_dict: List of loss dicts Returns: Aggregated loss dict
src/training/utils/coach_utils.py:80
Method
dtype
(self)
CLIP_/clip/model.py:458
Method
forward
r""" Args: query, key, value: map a query and a set of key-value pairs to an output. See "Attention Is All You Nee
CLIP_/clip/auxilary.py:456
Method
forward
(self, x: torch.Tensor)
CLIP_/clip/model.py:54
Method
forward
(self, x)
CLIP_/clip/model.py:84
Method
forward
(self, x)
CLIP_/clip/model.py:164
Method
forward
(self, x: torch.Tensor)
CLIP_/clip/model.py:189
Method
forward
(self, x: torch.Tensor)
CLIP_/clip/model.py:196
Method
forward
(self, x: torch.Tensor, attn_mask=None, mode="train")
CLIP_/clip/model.py:268
Method
forward
(self, x: torch.Tensor, attn_mask=None, mode="train")
CLIP_/clip/model.py:285
Method
forward
(self, x: torch.Tensor, attn_mask=None, mode="train")
CLIP_/clip/model.py:325
Method
forward
Compute SDS loss.
src/training/losses.py:205
Method
forward
Forward pass through network.
src/models/nerf_mlp_multi.py:248
Method
forward
Forward pass through embedding.
src/models/nerf_mlp_multi.py:480
Method
forward
Forward pass through RGB embedding.
src/models/nerf_mlp_multi.py:539
Method
forward
Forward pass interface.
src/models/model.py:86
Method
infer
Run inference with trained model. Args: save_filename: Base filename for outputs output_dir: Directory to save output
src/training/coach.py:642
Method
infer_single_rgb
Run inference with a single RGB color. Args: save_filename (str): Base filename for saving outputs output_dir (str):
src/training/coach.py:763
Function
init_weights
Initialize network weights.
src/models/nerf_mlp_multi.py:553
Function
load
Load a CLIP model Parameters ---------- name : str A model name listed by `clip.available_models()`, or the path to a model check
CLIP_/clip/clip.py:93
Method
log_checkpoint
Save a model checkpoint.
src/training/logging/coach_logger.py:125
Method
log_image
Save and log an image.
src/training/logging/coach_logger.py:99
Method
log_metrics
Log training metrics.
src/training/logging/coach_logger.py:81
Method
log_svg
Save an SVG file.
src/training/logging/coach_logger.py:116
← previous
next →
101–200 of 216, ranked by callers