modeloffaced

A Flutter package for live face detection and recognition.

Getting Started

This package allows you to:

  • Detect live face embeddings from camera input.
  • Store embeddings and related images in a local database.
  • Compare detected embeddings with existing users.
  • Display similarity scores and matched user details.

Basic Usage

Create a main.dart file in your Flutter app as follows:

import 'package:flutter/material.dart';
import 'package:modeloffaced/home_page.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Face Detection',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}
Important: Update Asset Paths
To correctly load images and the TFLite model, update the asset paths in the AssetsUtil class as below:

class AssetsUtil{
  static String HEAD_DOWN_IMAGE = "packages/modeloffaced/assets/images/head_down.png";
  static String HEAD_UP_IMAGE = "packages/modeloffaced/assets/images/head_up.png";
  static String HEAD_LEFT_IMAGE = "packages/modeloffaced/assets/images/head_left.png";
  static String HEAD_RIGHT_IMAGE = "packages/modeloffaced/assets/images/head_right.png";
  static String HEAD_STRAIGHT_IMAGE = "packages/modeloffaced/assets/images/head_straight.png";
  static String FACE_MODLE_512 = "packages/modeloffaced/assets/face_net_512.tflite";
}