added review changes

This commit is contained in:
Raghucharan16 2025-03-01 14:48:47 +05:30
parent 643ac3dc35
commit e2d1d5acb4

View File

@ -64,7 +64,7 @@ class Buffalo_L(FacialRecognition):
if len(img.shape) == 3:
img = np.expand_dims(img, axis=0) # Convert single image to batch of 1
elif len(img.shape) != 4:
raise ValueError(f"Input must have shape (112, 112, 3) or (X, 112, 112, 3). Got {img.shape}")
raise ValueError(f"Input must be (112, 112, 3) or (X, 112, 112, 3). Got {img.shape}")
# Convert RGB to BGR for the entire batch
img = img[:, :, :, ::-1]
return img
@ -92,4 +92,5 @@ class Buffalo_L(FacialRecognition):
embeddings.append(embedding.flatten().tolist())
# Return single embedding if batch_size is 1, otherwise return list of embeddings
return embeddings[0] if batch_size == 1 else embeddings
return embeddings[0] if batch_size == 1 else embeddings