MCPcopy Create free account
hub / github.com/microsoft/TRELLIS / tv_loss

Function tv_loss

trellis/utils/postprocessing_utils.py:368–370  ·  view source on GitHub ↗
(texture)

Source from the content-addressed store, hash-verified

366 return end_lr + 0.5 * (start_lr - end_lr) * (1 + np.cos(np.pi * step / total_steps))
367
368 def tv_loss(texture):
369 return torch.nn.functional.l1_loss(texture[:, :-1, :, :], texture[:, 1:, :, :]) + \
370 torch.nn.functional.l1_loss(texture[:, :, :-1, :], texture[:, :, 1:, :])
371
372 total_steps = 2500
373 with tqdm(total=total_steps, disable=not verbose, desc='Texture baking (opt): optimizing') as pbar:

Callers 1

bake_textureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected