GithubHelp home page GithubHelp logo

omar-alshyokh / flutter_opencv_dlib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alnitak/flutter_opencv_dlib

0.0 0.0 0.0 149.43 MB

Flutter realtime face detection and face recognition using OpenCV and dlib

License: Apache License 2.0

Shell 0.01% Ruby 0.01% C++ 96.91% C 2.17% Objective-C 0.05% Java 0.01% Dart 0.46% Swift 0.01% CMake 0.36% Batchfile 0.01%

flutter_opencv_dlib's Introduction

Flutter OpenCV dlib

Realtime face detection and face recognition using OpenCV and dlib

Getting Started (WIP)

flutter_opencv_dlib-linux.mp4
flutter_opencv_dlib-android.mp4

This plugin is almost tested only on Linux and Android, any help is greatly appreciated!

On Android (not tested on iOS) the camera plugin is used to grab frames and send them to this plugin.

The camera plugin seems to have a different behavior running on the emulator or on a real device: the viewfinder is rotated. For this purpose, in the example/lib/main.dart there is the [isRunninOnEmulator] const used to define the starting viewfinder rotation.

The the camera on Linux, uses frames provided by [cv::VideoCapture] OpenCV lib, it stores them into a OpenGL texture and send them back to a Texture() Flutter widget. This should work on Windows and Mac, but it's not implemented. So the camera is not yet available on these OSes (any help would be greatly appreciated), but the plugin should work for example providing photos/images to it.

The c/c++ shared source code (for all platforms) is stored into ios/Classes/cpp for further iOS release.

In the assets dir are stored some models used here. They are available here and are licensed under Creative Commons Zero v1.0 Universal

For Linux within the example dir you should run lib/main_desktop.dart: flutter run --release -t ./lib/main_desktop.dart which uses the OpenCV camera instead the camera plugin.

WARNING

Running in debug mode the performances are very poor. In profile or release mode you'll get much more FPS

Compiling libs

Linux

install OpenCV and dlib with the package manager of your linux distribution.

Android

Opencv v4.6.0 and dlib v19.24 are precompiled and stored into android/src/main. If you want to update them, you can use the below instructions:

OpenCV

dlib

  • go to BUILD_LIBS/buildDlib
  • run gitCloneDlib
  • run buildDlib-android

Windows

OpenCV

dlib

  • go to BUILD_LIBS/buildDlib
  • run gitCloneDlib.bat
  • run buildDlib-windows.bat

windows install reference: learnopencv.com

flutter_opencv_dlib's People

Contributors

alnitak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.