Remove redundant squeeze.

This commit is contained in:
h-alice 2025-01-21 11:25:33 +08:00
parent db4b749c98
commit 95bb92c933
No known key found for this signature in database
GPG Key ID: 5708F34144A70909

View File

@ -62,8 +62,7 @@ class Demography(ABC):
Four-dimensional numpy array (n, 224, 224, 3)
"""
image_batch = np.array(img)
# Remove batch dimension in advance if exists
image_batch = image_batch.squeeze()
# Check input dimension
if len(image_batch.shape) == 3:
# Single image - add batch dimension