added review changes

This commit is contained in:
Raghucharan16 2025-03-01 14:34:19 +05:30
parent 058a0fa590
commit 643ac3dc35

View File

@ -45,7 +45,6 @@ class Buffalo_L(FacialRecognition):
if not os.path.exists(weights_path):
raise FileNotFoundError(f"Model file not found at: {weights_path}")
else:
logger.debug(f"Model file found at: {weights_path}")
self.model = get_model(weights_path)
@ -65,8 +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("Input must have shape (112, 112, 3) or (batch_size, 112, 112, 3).")
raise ValueError(f"Input must have shape (112, 112, 3) or (X, 112, 112, 3). Got {img.shape}")
# Convert RGB to BGR for the entire batch
img = img[:, :, :, ::-1]
return img