Exemple #1
0
def test_mtcnn_raises_invalid_min_size():
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(min_face_size=-1)
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(min_face_size=10)
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(min_face_size=1050)
    fdet.MTCNN(min_face_size=50)
Exemple #2
0
def test_mtcnn_raises_invalid_nms_thresholds():
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(nms_thresholds=0.5)
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(nms_thresholds=(0.5, 0.5))
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(nms_thresholds=(0.5, 0.5, 2.0))
    with pytest.raises(DetectorValueError):
        fdet.MTCNN(nms_thresholds=(-1.0, 0.5, 0.5))
    fdet.MTCNN(nms_thresholds=(0.5, 0.5, 0.7))
Exemple #3
0
def mtcnn(**kwargs):
    """mtcnn detector"""

    input_data = _process_input(kwargs)
    detector = fdet.MTCNN(min_face_size=kwargs.get('min_size'), thresholds=kwargs.get('thresholds'),
                          nms_thresholds=kwargs.get('nms'), cuda_devices=kwargs.get('gpu'),
                          cuda_enable=kwargs.get('cuda'))

    _detect(detector, input_data, kwargs)
Exemple #4
0
def mtcnn_detector():
    return fdet.MTCNN(cuda_enable=False)