Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DavidBoja/SMPL-Fitting
/ functions
Functions
110 in github.com/DavidBoja/SMPL-Fitting
⨍
Functions
110
◇
Types & classes
15
↓ 32 callers
Method
cuda
(self)
body_models.py:72
↓ 24 callers
Method
update
(self,losses)
losses.py:202
↓ 12 callers
Function
send_to_socket
Send data to socket :param fig: plotly figure :param socket: socket object :param socket_type: type of socket to use
utils.py:479
↓ 9 callers
Function
load_config
(path="configs/config.yaml")
utils.py:27
↓ 8 callers
Function
load_scan
Load scan given its scan_path using open3d. Scan can be defined as: - .ply file - .ply.gz file :param scan_path: (str) of path
utils.py:715
↓ 6 callers
Method
__init__
(self, cfg: dict, loss_weights: dict,**kwargs)
losses.py:164
↓ 5 callers
Method
deform_verts
(self, pose: torch.tensor, betas: torch.tensor,
body_models.py:87
↓ 5 callers
Function
load_landmarks
Load landmarks from file and return the landmarks as torch tensor. Landmark file is defined in the following format: - .txt extensio
utils.py:607
↓ 5 callers
Function
process_body_model_path
(cfg: dict)
utils.py:129
↓ 4 callers
Method
forward
(self, **kwargs)
losses.py:185
↓ 4 callers
Function
get_normals
Find unit vertex normals.
utils.py:787
↓ 3 callers
Function
check_scan_prequisites_fit_bm
Check if the input_dict has all the required fields with defined values. Required data for fitting is the scans: - name, - vertices
utils.py:351
↓ 3 callers
Function
cleanup
Close sockets and terminate dash app subprocess. :param visualize: boolean indicating if visualization is on :param socket: socket object
utils.py:521
↓ 3 callers
Function
create_results_directory
Save results in save_path/YYYY_MM_DD_HH_MM_SS folder. If continue_run is folder of type YYYY_MM_DD_HH_MM_SS, then save results in save_pa
utils.py:238
↓ 3 callers
Function
get_already_fitted_scan_names
Return list of already fitted scans - founds as .npz files in the save_path directory :param cfg: config dictionary with
utils.py:333
↓ 3 callers
Function
get_skipped_scan_names
Get list of scan names that have been skipped because of missing data. :param cfg: config dictionary with save_path: pa
utils.py:424
↓ 3 callers
Method
landmark_indices
(self,landmarks_order)
body_models.py:68
↓ 3 callers
Function
load_loss_weights_config
(which_strategy,which_option,path=None)
utils.py:40
↓ 3 callers
Function
process_default_dtype
(cfg: dict)
utils.py:125
↓ 3 callers
Function
process_landmarks
This function processes the cfg["use_landmarks"] which states which landamrks to use during optimization. The function returns a standar
utils.py:153
↓ 3 callers
Function
process_visualize_steps
The optimization iteration steps to visualize from visualize_steps are processed into a list of iteration indices to visualize. :param
utils.py:103
↓ 3 callers
Function
run_dash_app_as_subprocess
Run dahs app in a subprocess. :param port: port to run the dash app on. The visualization should be available at localhost:<port> If
dash_app.py:87
↓ 3 callers
Function
save_configs
(cfg: dict)
utils.py:91
↓ 3 callers
Function
set_init_plot
Plot the initial plotly figure for the optimization. Plotting the input scan as point cloud and the initial body model template as point
visualization.py:20
↓ 3 callers
Function
setup_socket
Set up the socket for sending data to the Dash app Currently only zmq is supported. :param socket_type: type of socket to use
utils.py:451
↓ 3 callers
Function
to_txt
(list,path,name)
utils.py:282
↓ 3 callers
Function
viz_error_curves
Visualize error curves (losses) for the optimization. Vertical lines are added when weights of losses are changed. :param losses: (dic
visualization.py:114
↓ 3 callers
Function
viz_final_fit
Plot the final fit figure for the optimization. Plotting the input scan as mesh if faces are given, else plotting as point cloud. Plo
visualization.py:180
↓ 3 callers
Function
viz_iteration
Plot the points of the optimized body model for iteration :param fig: (plotly) figure :param pc: (torch.tensor) (N,3) :param it
visualization.py:76
↓ 2 callers
Function
fit_body_model
Fit a body body model (SMPL/SMPLX) to the input scan using data, landmark and prior losses :param: input_dict (dict): with keys:
refine_fitting.py:30
↓ 2 callers
Function
fit_body_model
Fit a body body model (SMPL/SMPLX) to the input scan using data, landmark and prior losses :param: input_dict (dict): with keys:
fit_body_model.py:30
↓ 2 callers
Function
fit_vertices
Fit template vertices onto scan. Either start from body model in T-pose or from previous fit. :param: input_dict (dict): with keys:
fit_vertices.py:26
↓ 2 callers
Function
infer_body_model
(N_verts)
body_models.py:8
↓ 2 callers
Function
initialize_fit_bm_loss_weights
Initialize the loss_weights if 0-th iteration is not provided in loss_weights dictionary :param loss_weights: dictionary of loss weights
utils.py:53
↓ 2 callers
Function
print_losses
(data_loss:torch.tensor, landmark_loss:torch.tensor, prior_loss:torch.tensor
utils.py:295
↓ 2 callers
Function
print_params
(pose: torch.tensor, beta:torch.tensor, trans:torch.tensor,
utils.py:286
↓ 2 callers
Method
update_loss_weights
(self,iteration)
losses.py:181
↓ 2 callers
Function
visualize_pve
Visualize the PVE errors as a color map on the fitted body model. :param verts: np.array (N,3) :param vert_errors: np.array (N,) :par
visualization.py:547
↓ 1 callers
Function
check_scan_prequisites_fit_verts
Check if all the scan dict has all the required fields If all the data is there, return True, else False Required data is: name, vertices
utils.py:389
↓ 1 callers
Function
close_sockets
Close a socket. :param socket: socket object
utils.py:499
↓ 1 callers
Function
closure
()
fit_vertices.py:132
↓ 1 callers
Function
create_dash_app
Create the dash app with 3 plot layout: 3d plot, error curves and the final fit. return: the dash app
dash_app.py:14
↓ 1 callers
Function
create_thread
Create a background thread to continuously update the figure. :param socket: the zmq socket :param app: the dash app
dash_app.py:50
↓ 1 callers
Function
create_wireframe_plot
Given vertices and faces, creates a wireframe of plotly segments. Used for visualizing the wireframe. :param verts:
visualization.py:259
↓ 1 callers
Function
create_zmq_socket
Set up the ZeroMQ socket for receiving data from the optimization script.
dash_app.py:35
↓ 1 callers
Function
exit_fitting_vertices
(current_loss, previous_loss, loss_difference, minimal_loss)
utils.py:899
↓ 1 callers
Method
forward
(self, pose, betas, **kwargs)
losses.py:343
↓ 1 callers
Function
initialize_A
Creates (N,3,4) homogeneous transformation matrix Either random or eye matrix for rotation and 0 for translation. Homogeneous
utils.py:866
↓ 1 callers
Function
initialize_fit_verts_loss_weights
Initialize the loss_weights if 0-th iteration is missing from the loss_weights dictionary :param loss_weights: dictionary of loss weights
utils.py:75
↓ 1 callers
Method
log_likelihood
Create graph operation for negative log-likelihood calculation
losses.py:314
↓ 1 callers
Method
merged_log_likelihood
(self, pose, betas)
losses.py:297
↓ 1 callers
Function
parse_landmark_txt_coords_formatting
Parse landamrk txt file with formatting x y z landmark_name :param data (List[str]) list of strings, each string represe
utils.py:539
↓ 1 callers
Function
parse_landmark_txt_index_formatting
Parse landamrk txt file with formatting landmark_index landmark_name :param data (List[str]) list of strings, each string
utils.py:574
↓ 1 callers
Function
print_loss_weights
(data_loss:torch.tensor, landmark_loss:torch.tensor, prior_los
utils.py:312
↓ 1 callers
Function
process_body_model_fit_verts
(cfg)
utils.py:137
↓ 1 callers
Function
process_caesar_landmarks
Process CAESAR dataset landmarks from .lnd file. Reading file from AUX to END flags. :param landmark_path (str): path to landmark .lnd
landmarks.py:176
↓ 1 callers
Function
process_dataset_name
(cfg:dict)
utils.py:216
↓ 1 callers
Function
set_seed
(sd)
utils.py:777
↓ 1 callers
Function
summed_L2
:param x: (torch.tensor) dim N x 3 :param y: (torch.tensor) dim N x 3
losses.py:207
↓ 1 callers
Function
terminate_dash_app_subprocess
Terminate the dash app subprocess asking nicely first, then forcefully. :param dash_app_process: the dash app subprocess :param dash
dash_app.py:108
↓ 1 callers
Method
track_loss
(self,loss_dict)
losses.py:178
↓ 1 callers
Function
update_normals
Rotates the normals by homogeneous transformation A (given as N x 3 x 4) A missing last row [0,0,0,1] Input: normals: pytorch Tensor of
utils.py:798
Method
N_verts
(self)
body_models.py:45
Method
__call__
(self, pose, betas, **kwargs)
body_models.py:75
Method
__getitem__
:return (dict): dictionary with keys: "name": name of scan "vertices": (N,3) np.array "faces": (N,3) np.a
datasets.py:123
Method
__getitem__
:return (dict): dictionary with keys: "name": name of scan "vertices": (N,3) np.array "faces": (N,3) np.a
datasets.py:293
Method
__getitem__
:return (dict): dictionary
datasets.py:477
Method
__init__
(self,**kwargs)
losses.py:25
Method
__init__
(self,partial_data_threshold: float,**kwargs)
losses.py:44
Method
__init__
(self,body_models_path: str,**kwargs)
losses.py:66
Method
__init__
(self, **kwargs)
losses.py:88
Method
__init__
(self, normal_threshold_angle: float = None, **kwargs)
losses.py:106
Method
__init__
(self,loss_names)
losses.py:198
Method
__init__
(self, prior_folder='prior', num_gaussians=6, dtype=torch.float32, epsilon=1e-16,
losses.py:218
Method
__init__
:param data_dir (str): path to caesar dataset :param load_countries (str or list): countries to load.
datasets.py:24
Method
__init__
:param data_dir (str): path to caesar dataset :param load_gt (bool): whether to load ground truth fitting or not
datasets.py:238
Method
__init__
Loading 4DHumanOutfit dataset Expecint the following structure: smpl params save as: parameters_path/subj_name/subj_name-
datasets.py:348
Method
__init__
(self, cfg: dict)
body_parameters.py:10
Method
__init__
(self, cfg: dict)
body_models.py:23
Method
__len__
(self)
datasets.py:229
Method
__len__
(self)
datasets.py:340
Method
__len__
(self)
datasets.py:519
Method
__new__
(cls, cfg)
body_parameters.py:68
Method
__new__
(cls, cfg)
body_models.py:115
Function
evaluate_chamfer
Evaluate the chamfer distance of the fitted body model to the scan. :param fitting_results_path: (str) Path to folder with fitting resu
evaluate_fitting.py:144
Function
evalute_pve
Evaluate the PVE of the fitted body model to the ground truth (GT) body. When evaluating a dataset - the GT is presumed to be given by
evaluate_fitting.py:21
Method
faces
(self)
body_models.py:65
Function
fit_body_model_onto_dataset
(cfg: dict)
refine_fitting.py:237
Function
fit_body_model_onto_dataset
(cfg: dict)
fit_body_model.py:199
Function
fit_body_model_onto_scan
(cfg: dict)
refine_fitting.py:276
Function
fit_body_model_onto_scan
(cfg: dict)
fit_body_model.py:236
Function
fit_vertices_onto_dataset
(cfg: dict)
fit_vertices.py:191
Function
fit_vertices_onto_scan
(cfg: dict)
fit_vertices.py:229
Method
forward
Directional Chamfer Distance from bm template to vertices Sum the distances from every point of the template to the closest point
losses.py:29
Method
forward
Directional Chamfer Distance from template to vertices Sum the distances from every point of the template to the closest point
losses.py:49
Method
forward
Difference between homo transformations between neighboring template points :param A: (torch.tensor) transformation matrix A
losses.py:74
Method
forward
summed L2 norm between scan_landmarks and template_landmarks :param scan_landmarks: (torch.tensor) dim (N,3) :param template
losses.py:91
Method
forward
For each template vertex i, find the closest nearest neighbors in the scan and compute the angle between their normals and the normal
losses.py:114
Method
forward
(self)
body_parameters.py:61
Method
get_mean
Returns the mean of the mixture
losses.py:292
next →
1–100 of 110, ranked by callers