From 60f6ff023ad0401127a565e12d1b686be0bd9e15 Mon Sep 17 00:00:00 2001 From: YongtaoGe <1447097496@qq.com> Date: Mon, 12 Aug 2024 05:06:11 +0000 Subject: [PATCH] Fix warnings in body_models.py --- smplx/body_models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/smplx/body_models.py b/smplx/body_models.py index f21afec..10a5ae9 100644 --- a/smplx/body_models.py +++ b/smplx/body_models.py @@ -14,6 +14,7 @@ # # Contact: ps-license@tuebingen.mpg.de +import warnings from typing import Optional, Dict, Union import os import os.path as osp @@ -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}') @@ -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 @@ -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