Search in sources :

Example 1 with RNFaceDetector

use of org.reactnative.facedetector.RNFaceDetector in project react-native-camera by react-native-community.

the class FileFaceDetectionAsyncTask method detectorForOptions.

private static RNFaceDetector detectorForOptions(ReadableMap options, Context context) {
    RNFaceDetector detector = new RNFaceDetector(context);
    detector.setTracking(false);
    if (options.hasKey(MODE_OPTION_KEY)) {
        detector.setMode(options.getInt(MODE_OPTION_KEY));
    }
    if (options.hasKey(RUN_CLASSIFICATIONS_OPTION_KEY)) {
        detector.setClassificationType(options.getInt(RUN_CLASSIFICATIONS_OPTION_KEY));
    }
    if (options.hasKey(DETECT_LANDMARKS_OPTION_KEY)) {
        detector.setLandmarkType(options.getInt(DETECT_LANDMARKS_OPTION_KEY));
    }
    return detector;
}
Also used : RNFaceDetector(org.reactnative.facedetector.RNFaceDetector)

Example 2 with RNFaceDetector

use of org.reactnative.facedetector.RNFaceDetector in project react-native-camera by react-native-community.

the class RNCameraView method setupFaceDetector.

/**
 * Initial setup of the face detector
 */
private void setupFaceDetector() {
    mFaceDetector = new RNFaceDetector(mThemedReactContext);
    mFaceDetector.setMode(mFaceDetectorMode);
    mFaceDetector.setLandmarkType(mFaceDetectionLandmarks);
    mFaceDetector.setClassificationType(mFaceDetectionClassifications);
    mFaceDetector.setTracking(mTrackingEnabled);
}
Also used : RNFaceDetector(org.reactnative.facedetector.RNFaceDetector)

Example 3 with RNFaceDetector

use of org.reactnative.facedetector.RNFaceDetector in project react-native-camera by lwansbrough.

the class RNCameraView method setupFaceDetector.

/**
 * Initial setup of the face detector
 */
private void setupFaceDetector() {
    mFaceDetector = new RNFaceDetector(mThemedReactContext);
    mFaceDetector.setMode(mFaceDetectorMode);
    mFaceDetector.setLandmarkType(mFaceDetectionLandmarks);
    mFaceDetector.setClassificationType(mFaceDetectionClassifications);
    mFaceDetector.setTracking(mTrackingEnabled);
}
Also used : RNFaceDetector(org.reactnative.facedetector.RNFaceDetector)

Example 4 with RNFaceDetector

use of org.reactnative.facedetector.RNFaceDetector in project react-native-camera by lwansbrough.

the class FileFaceDetectionAsyncTask method detectorForOptions.

private static RNFaceDetector detectorForOptions(ReadableMap options, Context context) {
    RNFaceDetector detector = new RNFaceDetector(context);
    detector.setTracking(false);
    if (options.hasKey(MODE_OPTION_KEY)) {
        detector.setMode(options.getInt(MODE_OPTION_KEY));
    }
    if (options.hasKey(RUN_CLASSIFICATIONS_OPTION_KEY)) {
        detector.setClassificationType(options.getInt(RUN_CLASSIFICATIONS_OPTION_KEY));
    }
    if (options.hasKey(DETECT_LANDMARKS_OPTION_KEY)) {
        detector.setLandmarkType(options.getInt(DETECT_LANDMARKS_OPTION_KEY));
    }
    return detector;
}
Also used : RNFaceDetector(org.reactnative.facedetector.RNFaceDetector)

Aggregations

RNFaceDetector (org.reactnative.facedetector.RNFaceDetector)4