MCPcopy Create free account

hub / github.com/EliaFantini/FastNRTF / functions

Functions76 in github.com/EliaFantini/FastNRTF

↓ 76 callersMethodto
Moves the optimizers to the device :param device: device to move the optimizers to :return: None
src/model.py:42
↓ 15 callersFunctionkeep_only_metrics_no_memory_log
function that takes as input a dictionary and returns a dictionary containing only the metrics @param metrics: dictionary containing the me
experiments/experiments_utils.py:27
↓ 14 callersFunctionewma_np
function that takes as input a numpy array and returns the exponential weighted moving average of the array @param data: numpy array contai
experiments/experiments_utils.py:57
↓ 9 callersMethodstep
Performs an update of the weights for all optimizers :param scaler: if given, it uses the scaler to use Pytorch's mixed precision
src/model.py:30
↓ 7 callersFunctiontone_loss
This function takes two tensors as input and returns the tone loss between them. The tone loss is defined as the L1.8 norm of the difference
src/utils.py:247
↓ 6 callersFunctionload_rgb_16bit
Loads a rgb image from disk encoded with 16 bit precision and returns it as a tensor. The image's values are automatically set to float in th
src/utils.py:47
↓ 6 callersMethodzero_grad
Sets the gradients to zero for all optimizers param set_to_none: If True, sets the gradient to None instead of zero to save some memo
src/model.py:21
↓ 4 callersFunctionget_SHembedder
Initializes the spherical harmonics embedder and returns its instance with the output dimension as an int :return: SHEncoder instance, outpu
src/utils.py:172
↓ 4 callersFunctionget_hashembedder
This function returns a hash embedder object and the output dimension of the hash embedder. :param bounding_box: list, optional The
src/utils.py:142
↓ 4 callersFunctionkeep_only_memory_log
function that takes as input a dictionary and returns a dictionary containing only the memory log @param metrics: dictionary containing th
experiments/experiments_utils.py:35
↓ 4 callersFunctionrelight_scene
(SCENE, POSES, alpha_transparency=False)
experiments/nvdiffrecmc_relight/blender/blender_nvdiffrecmc.py:45
↓ 4 callersFunctionuv_to_dir
Convert uv coordinates to a direction vector. :param u:int The u coordinate of the pixel. :param v: int The v coordinate
src/utils.py:183
↓ 3 callersFunctionexport_cameras
Exports cameras' settings from Blender to '.npz' file :param path: string, path to the output file (that will be created), containing the cam
blender/render_OLAT_images.py:256
↓ 3 callersFunctionlr_schedule
(iter, fraction)
experiments/nvdiffrecmc/train.py:342
↓ 3 callersFunctionoptimize_mesh
( denoiser, glctx, glctx_display, geometry, opt_material, lgt, dataset_train,
experiments/nvdiffrecmc/train.py:315
↓ 3 callersFunctionprepare_batch
(target, train_res, bg_type)
experiments/nvdiffrecmc/train.py:75
↓ 3 callersFunctionprint_average
function that given a list of float it prints the average of its elements with odd index and the average of its elements with even index
experiments/experiments_utils.py:8
↓ 2 callersFunction_srgb_to_rgb
Converts an image (passed as a tensor) from sRGB color space to RGB. :param f: tensor, sRGBimage :return: tensor, RGB image converted
src/utils.py:38
↓ 2 callersFunctionewma_list
function that takes as input a list of float and return the exponential weighted moving average of the list @param x: list of float contain
experiments/experiments_utils.py:43
↓ 2 callersFunctionimport_cameras_from_json
Imports cameras' settings into Blender, reading them from json file (compatible with nerf synthetic and nerfactor datasets) :param path:
blender/render_OLAT_images.py:227
↓ 2 callersFunctioninitial_guess_material
(geometry, mlp, FLAGS, init_mat=None)
experiments/nvdiffrecmc/train.py:160
↓ 2 callersFunctionplot
This function plots the data in a dictionary. :param data: dict, The dictionary should have the following structure: {
src/utils.py:109
↓ 2 callersMethodstep
Calls the step function on all the schedulers :return: None
src/model.py:78
↓ 2 callersFunctionvalidate
(glctx, geometry, opt_material, lgt, dataset_validate, out_dir, FLAGS, denoiser)
experiments/nvdiffrecmc/train.py:253
↓ 2 callersFunctionvalidate_itr
(glctx, target, ref_mesh, geometry, opt_material, lgt, FLAGS, denoiser, iter=0)
experiments/nvdiffrecmc/train.py:207
↓ 1 callersMethod__getitem__
(self, idx)
src/scene_dataset.py:46
↓ 1 callersMethod__init__
(self, input_dim=3, degree=4)
src/hash_encoding.py:163
↓ 1 callersMethod__init__
( self, W=64, D=8, skips=[4], din=9,
src/model.py:176
↓ 1 callersMethod__len__
(self)
src/scene_dataset.py:43
↓ 1 callersFunctioncreateLoss
(FLAGS)
experiments/nvdiffrecmc/train.py:54
↓ 1 callersFunctioncycle
(iterable)
experiments/nvdiffrecmc/train.py:376
↓ 1 callersFunctionewma
Exponentially-weighted moving average. :param data: list-like The data to be averaged. :param window: int, optional The
src/utils.py:81
↓ 1 callersFunctionfirst_layer_init
Initialize the first layer of a network with a uniform/normal distribution. :param m : torch.nn.Module The module to be initiali
src/model.py:120
↓ 1 callersFunctiongenerate_olat_envmaps
This function generates and saves the OLAT envmaps in the data folder inside the root folder of the project. :return: None
src/generate_olat_envmaps.py:7
↓ 1 callersFunctiongenerate_rnd_olat_cams
Generates random cameras around the object, pointing at it :param cam_path: path to the '.npz' file (that will be created) to store the camer
blender/render_OLAT_images.py:294
↓ 1 callersFunctionget_3x4_P_matrix_from_blender
Extracts P, K, RT matrices from Blender's camera object :param cam: Blender's camera, a Blender's object :return: P, K, RT matrices
blender/render_OLAT_images.py:216
↓ 1 callersFunctionget_3x4_RT_matrix_from_blender
Returns camera rotation and translation matrices from Blender. There are 3 coordinate systems involved: 1. The World coordinates: "world
blender/render_OLAT_images.py:162
↓ 1 callersFunctionget_calibration_matrix_K_from_blender
3x4 P matrix from Blender camera Builds intrinsic camera parameters from Blender camera data. See notes on this in blender.stackexchange.
blender/render_OLAT_images.py:124
↓ 1 callersFunctionget_hash_table
This function takes in a set of 3D points and a bounding box and returns a hash table of the voxels that are occupied by the points. :pa
src/hash_encoding.py:54
↓ 1 callersFunctionget_voxel_vertices
Returns voxel vertices xyz: 3D coordinates of samples. B x 3 bounding_box: min and max x,y,z coordinates of object bbox resolution:
src/hash_encoding.py:28
↓ 1 callersFunctionimage_to_pt
Converts every png image (generated OLAT images) into a pytorch tensor and saving it, after applying srgb_to_rgb conversion to them :para
src/utils.py:207
↓ 1 callersFunctionmain
Main function of the program. It loads the configuration's settings, renders the buffer containing the normals, light's output direction
run.py:12
↓ 1 callersFunctionmain
Main function of the program. It loads the configuration's settings, renders the buffer containing the normals, light's output direction
experiments/nvdiffrecmc_relight/run_nv.py:8
↓ 1 callersFunctionmake_scene
Given the 'index' camera, it computes all the normals, light's output direction and 3D position of every single point obtained by tracing
experiments/nvdiffrecmc_relight/src/relight_w_nvdiffrecmc.py:269
↓ 1 callersFunctionmake_scene
Given the 'index' camera, it computes all the normals, light's output direction and 3D position of every single point obtained by tracing ra
src/render_buffer.py:58
↓ 1 callersFunctionplot_100kOLAT_50kJOINT_exp
(data1: dict, data2: dict, scale: str)
experiments/experiments_utils.py:251
↓ 1 callersFunctionplot_OLAT_batch_size_exp
(data1: dict, data2: dict, data3: dict, scale: str)
experiments/experiments_utils.py:154
↓ 1 callersFunctionplot_OLAT_num_train_images_exp
(data1: dict, data2: dict, data3: dict, scale: str)
experiments/experiments_utils.py:102
↓ 1 callersFunctionplot_envmap_lr_exp
(data1: dict, data2: dict, data3: dict, scale: str)
experiments/experiments_utils.py:206
↓ 1 callersFunctionplot_noOLAT_onlyJOINT_exp
(data1: dict, scale: str)
experiments/experiments_utils.py:296
↓ 1 callersFunctionplot_pipeline_mem_analysis
(data1: dict, data2: dict, data3: dict, scale: str)
experiments/experiments_utils.py:315
↓ 1 callersFunctionplot_rgb_batch_exp
(data1: dict, data2: dict, scale: str)
experiments/experiments_utils.py:84
↓ 1 callersFunctionrelight
Tests the model by relighting the object with different envmaps :param data_dir: string, path to the data folder :param output_dir: stri
src/relight.py:17
↓ 1 callersFunctionrelight_w_nvdiffrecmc
(output_dir: str, data_dir: str, device, img_res: list, joint_datetime: str, num_views: int = 8, num_envmaps:
experiments/nvdiffrecmc_relight/src/relight_w_nvdiffrecmc.py:17
↓ 1 callersFunctionrender_buffer
For all training and validation cameras, it computes all the normals, light's output direction and 3D position of every single point obtaine
src/render_buffer.py:10
↓ 1 callersFunctionrender_olat_captures
Renders olat_train_rend_num+olat_val_rend_num OLAT images and stores them in output_path :param output_path: string, path to the folder where
blender/render_OLAT_images.py:372
↓ 1 callersFunctionrotate_envmap
Rotates the nvdiffrecmc's estimated envmap by -90 degrees, after downscaling it to the size [32,16] :param output_dir: string, path to the ou
src/utils.py:225
↓ 1 callersFunctionset_up_blender
:param root_path: string, root folder's path of the project :param samples_num: int, number of samples per pixel to be computed in the rende
blender/render_OLAT_images.py:25
↓ 1 callersFunctiontrain_joint
Trains the PRT model with both the generated OLAT images and the real captures :param output_dir: string, path to the output folder :par
src/train_joint.py:21
↓ 1 callersFunctiontrain_olat
Trains the PRT model with the generated OLAT images :param output_dir: string, path to the output folder :param data_dir: string, path t
src/train_olat.py:16
↓ 1 callersMethodtrilinear_interp
(self,weights, voxel_embedds)
src/hash_encoding.py:118
↓ 1 callersFunctionweight_init
Initialize the weights of a layer according to the activation function. :param m: torch.nn.Module The layer to initialize. :para
src/model.py:97
↓ 1 callersFunctionxatlas_uvmap
(glctx, geometry, mat, FLAGS)
experiments/nvdiffrecmc/train.py:110
Method__init
(self)
src/model.py:150
Method__init__
(self, bounding_box=[-1.0,1.0], n_levels=16, n_features_per_level=2, log2_hashmap_size=19, bas
src/hash_encoding.py:93
Method__init__
(self, transform_path: str, img_res: list, nerfactor: bool
src/scene_dataset.py:20
Method__init__
(self, op)
src/model.py:18
Method__init__
(self, multioptimizers, step, gamma)
src/model.py:69
Methodforward
(self, x)
src/hash_encoding.py:138
Methodforward
(self, input)
src/hash_encoding.py:205
Methodforward
(self, input)
src/model.py:153
Methodforward
Returns the model's output, representing the outgoing radiance of points pos in directions dout for light coming from directions din.
src/model.py:210
Functionhash
This function takes in a tensor of coordinates and returns a tensor of hash values. The hash values are computed using the following formula:
src/hash_encoding.py:9
Functionload_rgb
Loads a rgb image from disk and returns it as a tensor. The image's values are automatically set to float in the range [0,1]. If target_r
src/utils.py:15
Functionrender_buffer_nv
For all training and validation cameras, it computes all the normals, light's output direction and 3D position of every single point obtai
experiments/nvdiffrecmc_relight/src/relight_w_nvdiffrecmc.py:223
Methodto
Moves the schedulers to the device :param device: device to move the schedulers to :return: None
src/model.py:86