mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
added review changes
This commit is contained in:
parent
643ac3dc35
commit
e2d1d5acb4
@ -64,7 +64,7 @@ class Buffalo_L(FacialRecognition):
|
|||||||
if len(img.shape) == 3:
|
if len(img.shape) == 3:
|
||||||
img = np.expand_dims(img, axis=0) # Convert single image to batch of 1
|
img = np.expand_dims(img, axis=0) # Convert single image to batch of 1
|
||||||
elif len(img.shape) != 4:
|
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
|
# Convert RGB to BGR for the entire batch
|
||||||
img = img[:, :, :, ::-1]
|
img = img[:, :, :, ::-1]
|
||||||
return img
|
return img
|
||||||
@ -92,4 +92,5 @@ class Buffalo_L(FacialRecognition):
|
|||||||
embeddings.append(embedding.flatten().tolist())
|
embeddings.append(embedding.flatten().tolist())
|
||||||
|
|
||||||
# Return single embedding if batch_size is 1, otherwise return list of embeddings
|
# 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
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user