Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings in body_models.py #206

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions smplx/body_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# Contact: [email protected]

import warnings
from typing import Optional, Dict, Union
import os
import os.path as osp
Expand Down Expand Up @@ -146,7 +147,7 @@ def __init__(
self.batch_size = batch_size
shapedirs = data_struct.shapedirs
if (shapedirs.shape[-1] < self.SHAPE_SPACE_DIM):
print(f'WARNING: You are using a {self.name()} model, with only'
warnings.warn(f'WARNING: You are using a {self.name()} model, with only'
f' {shapedirs.shape[-1]} shape coefficients.\n'
f'num_betas={num_betas}, shapedirs.shape={shapedirs.shape}, '
f'self.SHAPE_SPACE_DIM={self.SHAPE_SPACE_DIM}')
Expand Down Expand Up @@ -1059,7 +1060,7 @@ def __init__(
shapedirs = shapedirs[:, :, None]
if (shapedirs.shape[-1] < self.SHAPE_SPACE_DIM +
self.EXPRESSION_SPACE_DIM):
print(f'WARNING: You are using a {self.name()} model, with only'
warnings.warn(f'WARNING: You are using a {self.name()} model, with only'
' 10 shape and 10 expression coefficients.')
expr_start_idx = 10
expr_end_idx = 20
Expand Down Expand Up @@ -1924,7 +1925,7 @@ def __init__(
shapedirs = shapedirs[:, :, None]
if (shapedirs.shape[-1] < self.SHAPE_SPACE_DIM +
self.EXPRESSION_SPACE_DIM):
print(f'WARNING: You are using a {self.name()} model, with only'
warnings.warn(f'WARNING: You are using a {self.name()} model, with only'
' 10 shape and 10 expression coefficients.')
expr_start_idx = 10
expr_end_idx = 20
Expand Down