mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
disable mtcnn batching by default due to unexpected behaviour
This commit is contained in:
parent
c46d886a67
commit
add4c73944
@ -82,8 +82,21 @@ class MtCnnClient(Detector):
|
|||||||
|
|
||||||
def _supports_batch_detection(self) -> bool:
|
def _supports_batch_detection(self) -> bool:
|
||||||
import mtcnn
|
import mtcnn
|
||||||
|
import os
|
||||||
|
supports_batch_detection = os.getenv(
|
||||||
|
"ENABLE_MTCNN_BATCH_DETECTION", "false"
|
||||||
|
).lower() == "true"
|
||||||
|
if not supports_batch_detection:
|
||||||
|
logger.warning(
|
||||||
|
"Batch detection is disabled for mtcnn by default "
|
||||||
|
"since the results are not consistent with single image detection. "
|
||||||
|
"You can force enable it by setting the environment variable "
|
||||||
|
"ENABLE_MTCNN_BATCH_DETECTION to true."
|
||||||
|
)
|
||||||
|
return False
|
||||||
try:
|
try:
|
||||||
mtcnn_version = mtcnn.__version__
|
mtcnn_version = mtcnn.__version__
|
||||||
|
supports_batch_detection = mtcnn_version >= "1.0.0"
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
import mtcnn.metadata
|
import mtcnn.metadata
|
||||||
|
Loading…
x
Reference in New Issue
Block a user