搜尋套件、儲存庫與 APP 分類

套件詳情v0.1.4

face_camera

一個 Flutter 相機外掛程式,可即時偵測人臉。此外,一旦偵測到人臉,它會自動拍攝照片,這在進行 kyc 自拍時非常實用。

AndroidiOS
近 30 天下載
1370
喜歡數
216
Pub 分數
130

安裝套件

flutter pub add face_camera

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

face_camera 套件是一個 Flutter 插件,專為使用裝置相機進行即時人臉偵測而設計。當偵測到人臉時,它會自動捕捉影像,非常適合用於身分驗證(KYC)過程中的自拍照場景。此套件基於機器學習建構,可無縫整合至 Android 與 iOS 平台,為開發者提供一種高效實做人臉感知相機功能的方式,無需複雜設定。該套件簡化了由面部存在觸發的影像捕獲流程,提升身分驗證工作流程中的使用者體驗。

適用情境

  • KYC身分驗證
  • 自動自拍捕捉
  • 應用程式中的即時人臉檢測
  • 透過臉部進行使用者驗證
  • 行動應用入門流程

主要特色

  • 即時人臉檢測
  • 人臉檢測時自動拍攝
  • 跨平台支援(Android & iOS)
  • 與 Flutter 的輕量級整合
  • 用於面部觸發擷取的簡單API

適合對象

  • 開發KYC應用的開發者
  • 需要自動自拍的應用程式
  • 身份驗證系統
  • 基於面部互動的移動應用
  • 需要低程式碼人臉偵測的專案

使用建議

  • 需要相機權限
  • 效能可能會在舊裝置上有所差異
  • 準確性取決於照明和臉部可見性
  • 不適合高安全性生物識別認證
  • 僅限人臉檢測,不包含識別或追蹤

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

face_camera

A Flutter camera plugin that detects face in real-time.
Preview

Installation

First, add face_camera as a dependency in your pubspec.yaml file.

face_camera: ^<latest-version>
iOS

  • Minimum iOS Deployment Target: 15.5.0
  • Follow this link and setup ML Kit this is required for face_camera to function properly on iOS

Add two rows to the ios/Runner/Info.plist:

  • one with the key Privacy - Camera Usage Description and a usage description.
  • and one with the key Privacy - Microphone Usage Description and a usage description.

If editing Info.plist as text, add:

<key>NSCameraUsageDescription</key>
<string>your usage description here</string>
<key>NSMicrophoneUsageDescription</key>
<string>your usage description here</string>
Android

  • Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.
minSdkVersion 21
Usage

  • The first step is to initialize face_camera in main.dart
void main() async{
  WidgetsFlutterBinding.ensureInitialized(); //Add this

  await FaceCamera.initialize(); //Add this

  runApp(const MyApp());
}
  • Create a new FaceCameraController controller, setting the onCapture callback.
  late FaceCameraController controller;

  @override
  void initState() {
    controller = FaceCameraController(
      autoCapture: true,
      defaultCameraLens: CameraLens.front,
      onCapture: (File? image) {
        
      },
    );
  super.initState();
}
  • Then render the component in your application using the required options.
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: SmartFaceCamera(
          controller: controller,
          message: 'Center your face in the square',
        )
    );
  }
Customization

Here is a list of properties available to customize your widget:

Name Type Description
controller FaceCameraController The controller for the [SmartFaceCamera] widget
showControls bool set false to hide all controls
showCaptureControl bool set false to hide capture control icon
showFlashControl bool set false to hide flash control control icon
showCameraLensControl bool set false to hide camera lens control icon
message String use this pass a message above the camera
messageStyle TextStyle style applied to the message widget
lensControlIcon Widget use this to render a custom widget for camera lens control
flashControlBuilder FlashControlBuilder use this to build custom widgets for flash control based on camera flash mode
messageBuilder MessageBuilder use this to build custom messages based on face position
indicatorShape IndicatorShape use this to change the shape of the face indicator
indicatorAssetImage String use this to pass an asset image when IndicatorShape is set to image
indicatorBuilder IndicatorBuilder use this to build custom widgets for the face indicator
captureControlBuilder CaptureControlBuilder use this to build custom widgets for capture control
autoDisableCaptureControl bool set true to disable capture control widget when no face is detected



Here is a list of properties available to customize your widget from the controller:

Name Type Description
onCapture Function(File?) callback invoked when camera captures image
onFaceDetected Function(DetectedFace?) callback invoked when camera detects face
imageResolution ImageResolution use this to set image resolution
defaultCameraLens CameraLens use this to set initial camera lens direction
defaultFlashMode CameraFlashMode use this to set initial flash mode
enableAudio bool set false to disable capture sound
autoCapture bool set true to capture image on face detected
ignoreFacePositioning bool set true to trigger onCapture even when the face is not well positioned
orientation CameraOrientation use this to lock camera orientation
performanceMode FaceDetectorMode Use this to set your preferred performance mode
Contributions

Contributions of any kind are more than welcome! Feel free to fork and improve face_camera in any way you want, make a pull request, or open an issue.

Support the Library

You can support the library by donating, liking it on Pub, starring it on GitHub, and reporting any bugs you encounter.

💖 Show Love on Selar

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。