├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── jniLibs │ │ │ ├── arm64-v8a │ │ │ │ └── libtensorflowlite_c.so │ │ │ ├── armeabi-v7a │ │ │ │ └── libtensorflowlite_c.so │ │ │ ├── x86 │ │ │ │ └── libtensorflowlite_c.so │ │ │ └── x86_64 │ │ │ │ └── libtensorflowlite_c.so │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── FaceNet │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── images │ ├── gestures.png │ ├── home.png │ ├── login.png │ ├── splashscreen.png │ └── tf-logo.jpeg └── mobilefacenet.tflite ├── install.bat ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── 1024.png │ │ ├── 114.png │ │ ├── 120.png │ │ ├── 180.png │ │ ├── 29.png │ │ ├── 40.png │ │ ├── 57.png │ │ ├── 58.png │ │ ├── 60.png │ │ ├── 80.png │ │ ├── 87.png │ │ └── Contents.json │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── constants │ └── ui_constants.dart ├── db │ └── database.dart ├── main.dart ├── pages │ ├── home.dart │ ├── profile.dart │ ├── sign-in.dart │ ├── sign-up.dart │ └── splashScreen.dart ├── services │ ├── camera.service.dart │ ├── facenet.service.dart │ └── ml_vision_service.dart └── widgets │ ├── FacePainter.dart │ ├── auth-action-button.dart │ └── display-picture-screen.dart ├── pubspec.lock ├── pubspec.yaml ├── screenshots ├── demo.mp4 ├── five.jpeg ├── four.jpeg ├── git_dashes.png ├── one.jpeg ├── tfloveflutter.png ├── three.jpeg └── two.jpeg └── test └── widget_test.dart /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | .vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 216dee60c0cc9449f0b29bcf922974d612263e24 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Sayan Nath 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![GitHub forks](https://img.shields.io/github/forks/sayannath/Face-Authentication-App?style=for-the-badge) 2 | ![GitHub Repo stars](https://img.shields.io/github/stars/sayannath/Face-Authentication-App?style=for-the-badge) 3 | ![GitHub last commit](https://img.shields.io/github/last-commit/sayannath/Face-Authentication-App?style=for-the-badge) 4 | ![Twitter Follow](https://img.shields.io/twitter/follow/sayannath2350?style=for-the-badge) 5 | 6 | # Face Authentication App 7 | 8 | 9 | > Face Authentication with TF-Line. Model architecture which is used is FaceNet. 10 | 11 | ## Screenshots 12 | 13 |

14 | 15 | 16 |
17 | 18 | 19 | 20 |

21 | 22 | ## Project Structure 23 | ``` 24 | . 25 | ├── constants 26 | │   └── ui_constants.dart 27 | ├── db 28 | │   └── database.dart 29 | ├── main.dart 30 | ├── pages 31 | │   ├── home.dart 32 | │   ├── profile.dart 33 | │   ├── sign-in.dart 34 | │   ├── sign-up.dart 35 | │   └── splashScreen.dart 36 | ├── services 37 | │   ├── camera.service.dart 38 | │   ├── facenet.service.dart 39 | │   └── ml_vision_service.dart 40 | └── widgets 41 | ├── FacePainter.dart 42 | ├── auth-action-button.dart 43 | └── display-picture-screen.dart 44 | 45 | 5 directories, 14 files 46 | ``` 47 | 48 | ## How to run 49 | ``` 50 | 1. Open your terminal 51 | 2. Copy the command 'git clone https://github.com/sayannath/Face-Authentication-App.git' 52 | 3. cd Face-Authentication-App 53 | 4. flutter pub get [Make sure Flutter is installed] 54 | 5. flutter run 55 | ``` 56 | ## Want to Install Flutter? 57 | [Click Here](https://flutter.dev/docs/get-started/install) 58 | 59 | ## Pull Request 60 | 61 | Pull Requests are welcome. Please follow these rules for the ease of understanding: 62 | * Make sure to check for available issues before raising one 63 | * Give me a maximum of 24-48 hours to respond 64 | * Have proper documentation on the parts you are changing/adding 65 | 66 | ## Developed & Maintained by 67 | 68 | 69 | 70 | 71 | 72 | [![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://github.com/sayannath) 73 | Buy Me A Coffee 74 | 75 |
76 | 77 | #### Show some ❤️ by starring the repository! 78 |
79 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'com.google.gms.google-services' 26 | apply plugin: 'kotlin-android' 27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 28 | 29 | android { 30 | aaptOptions { 31 | noCompress "tflite" 32 | noCompress "lite" 33 | } 34 | 35 | compileSdkVersion 28 36 | 37 | sourceSets { 38 | main.java.srcDirs += 'src/main/kotlin' 39 | } 40 | 41 | lintOptions { 42 | disable 'InvalidPackage' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.FaceNet" 48 | minSdkVersion 21 49 | targetSdkVersion 28 50 | versionCode flutterVersionCode.toInteger() 51 | versionName flutterVersionName 52 | } 53 | 54 | buildTypes { 55 | release { 56 | // TODO: Add your own signing config for the release build. 57 | // Signing with the debug keys for now, so `flutter run --release` works. 58 | signingConfig signingConfigs.debug 59 | } 60 | } 61 | 62 | dependencies { 63 | api 'com.google.firebase:firebase-ml-vision-face-model:17.0.2' 64 | } 65 | } 66 | 67 | flutter { 68 | source '../..' 69 | } 70 | 71 | dependencies { 72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 73 | implementation 'com.google.firebase:firebase-analytics:17.5.0' 74 | } -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "908209109268", 4 | "firebase_url": "https://facerecognitionauth.firebaseio.com", 5 | "project_id": "facerecognitionauth", 6 | "storage_bucket": "facerecognitionauth.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:908209109268:android:22aa62a69fde9e6a0e6a01", 12 | "android_client_info": { 13 | "package_name": "com.example.FaceNet" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "908209109268-8833dnentno68sbhh1q3sbd5k0epm8a3.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyDzlmpvIAirzjtO_1TDasHocRk3UrTrkig" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "908209109268-8833dnentno68sbhh1q3sbd5k0epm8a3.apps.googleusercontent.com", 32 | "client_type": 3 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | ], 39 | "configuration_version": "1" 40 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/arm64-v8a/libtensorflowlite_c.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/jniLibs/arm64-v8a/libtensorflowlite_c.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/armeabi-v7a/libtensorflowlite_c.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/jniLibs/armeabi-v7a/libtensorflowlite_c.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86/libtensorflowlite_c.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/jniLibs/x86/libtensorflowlite_c.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86_64/libtensorflowlite_c.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/jniLibs/x86_64/libtensorflowlite_c.so -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/FaceNet/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.FaceNet 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.3' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/images/gestures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/assets/images/gestures.png -------------------------------------------------------------------------------- /assets/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/assets/images/home.png -------------------------------------------------------------------------------- /assets/images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/assets/images/login.png -------------------------------------------------------------------------------- /assets/images/splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/assets/images/splashscreen.png -------------------------------------------------------------------------------- /assets/images/tf-logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/assets/images/tf-logo.jpeg -------------------------------------------------------------------------------- /assets/mobilefacenet.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/assets/mobilefacenet.tflite -------------------------------------------------------------------------------- /install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enableextensions 3 | 4 | cd %~dp0 5 | 6 | set URL=https://github.com/am15h/tflite_flutter_plugin/releases/download/ 7 | set TAG=v0.2.0 8 | 9 | set ANDROID_DIR=android\app\src\main\jniLibs\ 10 | set ANDROID_LIB=libtensorflowlite_c.so 11 | 12 | set ARM_DELEGATE=libtensorflowlite_c_arm_delegate.so 13 | set ARM_64_DELEGATE=libtensorflowlite_c_arm64_delegate.so 14 | set ARM=libtensorflowlite_c_arm.so 15 | set ARM_64=libtensorflowlite_c_arm64.so 16 | set X86=libtensorflowlite_c_x86.so 17 | set X86_64=libtensorflowlite_c_x86_64.so 18 | 19 | SET /A d = 0 20 | 21 | :GETOPT 22 | if /I "%1"=="-d" SET /A d = 1 23 | 24 | SETLOCAL 25 | if %d%==1 CALL :Download %ARM_DELEGATE% armeabi-v7a 26 | if %d%==1 CALL :Download %ARM_64_DELEGATE% arm64-v8a 27 | if %d%==0 CALL :Download %ARM% armeabi-v7a 28 | if %d%==0 CALL :Download %ARM_64% arm64-v8a 29 | CALL :Download %X86% x86 30 | CALL :Download %X86_64% x86_64 31 | EXIT /B %ERRORLEVEL% 32 | 33 | :Download 34 | curl -L -o %~1 %URL%%TAG%/%~1 35 | mkdir %ANDROID_DIR%%~2\ 36 | move /-Y %~1 %ANDROID_DIR%%~2\%ANDROID_LIB% 37 | EXIT /B 0 -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.FaceNet; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.FaceNet; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.FaceNet; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]} -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | FaceNet 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/constants/ui_constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class UIConstants { 5 | static const double ASSUMED_SCREEN_HEIGHT = 640.0; 6 | static const double ASSUMED_SCREEN_WIDTH = 360.0; 7 | 8 | static _fitContext(BuildContext context, assumedValue, currentValue, value) => 9 | (value / assumedValue) * currentValue; 10 | 11 | static fitToWidth(value, BuildContext context) => _fitContext( 12 | context, ASSUMED_SCREEN_WIDTH, MediaQuery.of(context).size.width, value); 13 | 14 | static fitToHeight(value, BuildContext context) => _fitContext(context, 15 | ASSUMED_SCREEN_HEIGHT, MediaQuery.of(context).size.height, value); 16 | 17 | static const splashScreenLogo = 'assets/images/splashscreen.png'; 18 | static const tfLogo = 'assets/images/tf-logo.jpeg'; 19 | } 20 | -------------------------------------------------------------------------------- /lib/db/database.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:path_provider/path_provider.dart'; 4 | 5 | class DataBaseService { 6 | // singleton boilerplate 7 | static final DataBaseService _cameraServiceService = DataBaseService._internal(); 8 | 9 | factory DataBaseService() { 10 | return _cameraServiceService; 11 | } 12 | // singleton boilerplate 13 | DataBaseService._internal(); 14 | 15 | /// file that stores the data on filesystem 16 | File jsonFile; 17 | 18 | /// Data learned on memory 19 | Map _db = Map(); 20 | Map get db => this._db; 21 | 22 | /// loads a simple json file. 23 | Future loadDB() async { 24 | 25 | var tempDir = await getApplicationDocumentsDirectory(); 26 | String _embPath = tempDir.path + '/emb.json'; 27 | 28 | jsonFile = new File(_embPath); 29 | 30 | if (jsonFile.existsSync()) { 31 | _db = json.decode(jsonFile.readAsStringSync()); 32 | } 33 | } 34 | 35 | /// [Name]: name of the new user 36 | /// [Data]: Face representation for Machine Learning model 37 | Future saveData(String user, String password, List modelData) async { 38 | String userAndPass = user + ':' + password; 39 | _db[userAndPass] = modelData; 40 | jsonFile.writeAsStringSync(json.encode(_db)); 41 | } 42 | 43 | 44 | /// deletes the created users 45 | cleanDB() { 46 | this._db = Map(); 47 | jsonFile.writeAsStringSync(json.encode({})); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:FaceNetAuthentication/pages/splashScreen.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | void main() { 5 | runApp(MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | title: 'Face Auth using TF-Lite', 14 | theme: ThemeData( 15 | primaryColor: Color(0xff25354E), 16 | scaffoldBackgroundColor: Colors.white, 17 | visualDensity: VisualDensity.adaptivePlatformDensity, 18 | buttonTheme: ButtonThemeData( 19 | buttonColor: Color(0xff25354E), 20 | shape: RoundedRectangleBorder( 21 | side: BorderSide(color: Color(0xff25354E)), 22 | borderRadius: BorderRadius.circular(25.0))), 23 | ), 24 | home: SplashScreen(), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/pages/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:camera/camera.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:FaceNetAuthentication/constants/ui_constants.dart'; 5 | import 'package:FaceNetAuthentication/db/database.dart'; 6 | import 'package:FaceNetAuthentication/pages/sign-in.dart'; 7 | import 'package:FaceNetAuthentication/pages/sign-up.dart'; 8 | import 'package:FaceNetAuthentication/services/facenet.service.dart'; 9 | import 'package:FaceNetAuthentication/services/ml_vision_service.dart'; 10 | 11 | class MyHomePage extends StatefulWidget { 12 | MyHomePage({Key key}) : super(key: key); 13 | @override 14 | _MyHomePageState createState() => _MyHomePageState(); 15 | } 16 | 17 | class _MyHomePageState extends State { 18 | // Services injection 19 | FaceNetService _faceNetService = FaceNetService(); 20 | MLVisionService _mlVisionService = MLVisionService(); 21 | DataBaseService _dataBaseService = DataBaseService(); 22 | 23 | CameraDescription cameraDescription; 24 | bool loading = false; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | _startUp(); 30 | } 31 | 32 | /// 1 Obtain a list of the available cameras on the device. 33 | /// 2 loads the face net model 34 | _startUp() async { 35 | _setLoading(true); 36 | 37 | List cameras = await availableCameras(); 38 | 39 | /// takes the front camera 40 | cameraDescription = cameras.firstWhere( 41 | (CameraDescription camera) => 42 | camera.lensDirection == CameraLensDirection.front, 43 | ); 44 | 45 | // start the services 46 | await _faceNetService.loadModel(); 47 | await _dataBaseService.loadDB(); 48 | _mlVisionService.initialize(); 49 | 50 | _setLoading(false); 51 | } 52 | 53 | // shows or hides the circular progress indicator 54 | _setLoading(bool value) { 55 | setState(() { 56 | loading = value; 57 | }); 58 | } 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | return Scaffold( 63 | appBar: AppBar( 64 | backgroundColor: Colors.white, 65 | elevation: 0.0, 66 | actions: [ 67 | Padding( 68 | padding: const EdgeInsets.only(left: 8.0, top: 8.0), 69 | child: Image.asset(UIConstants.tfLogo), 70 | ) 71 | ], 72 | ), 73 | body: !loading 74 | ? Container( 75 | height: MediaQuery.of(context).size.height, 76 | width: MediaQuery.of(context).size.width, 77 | child: Padding( 78 | padding: const EdgeInsets.only(left: 16.0, right: 16.0), 79 | child: SingleChildScrollView( 80 | physics: BouncingScrollPhysics(), 81 | child: Column( 82 | mainAxisAlignment: MainAxisAlignment.start, 83 | crossAxisAlignment: CrossAxisAlignment.start, 84 | children: [ 85 | Padding( 86 | padding: const EdgeInsets.only(top: 2.0), 87 | child: Text('Face Recognition System', 88 | style: Theme.of(context) 89 | .primaryTextTheme 90 | .headline6 91 | .copyWith( 92 | fontSize: 23, 93 | color: Color(0xff25354E), 94 | fontWeight: FontWeight.bold)), 95 | ), 96 | Padding( 97 | padding: const EdgeInsets.only(top: 8.0), 98 | child: Text( 99 | 'This app helps to\nAuthenticate Users by using\nFace Recognition', 100 | style: TextStyle(color: Color(0xff878787)), 101 | ), 102 | ), 103 | SizedBox( 104 | height: MediaQuery.of(context).size.height * 0.01, 105 | ), 106 | Image.asset( 107 | 'assets/images/login.png', 108 | height: UIConstants.fitToHeight(360, context), 109 | width: UIConstants.fitToWidth(360, context), 110 | ), 111 | SizedBox( 112 | height: MediaQuery.of(context).size.height * 0.11, 113 | ), 114 | Row( 115 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 116 | crossAxisAlignment: CrossAxisAlignment.center, 117 | children: [ 118 | SizedBox( 119 | width: UIConstants.fitToWidth(100, context), 120 | child: RaisedButton( 121 | padding: 122 | const EdgeInsets.symmetric(vertical: 16), 123 | child: Text('Sign In', 124 | style: TextStyle(color: Colors.white)), 125 | onPressed: () { 126 | Navigator.push( 127 | context, 128 | MaterialPageRoute( 129 | builder: (BuildContext context) => SignIn( 130 | cameraDescription: cameraDescription, 131 | ), 132 | ), 133 | ); 134 | }, 135 | ), 136 | ), 137 | SizedBox( 138 | width: UIConstants.fitToWidth(100, context), 139 | child: RaisedButton( 140 | padding: 141 | const EdgeInsets.symmetric(vertical: 16), 142 | child: Text('Sign Up', 143 | style: TextStyle(color: Colors.white)), 144 | onPressed: () { 145 | Navigator.push( 146 | context, 147 | MaterialPageRoute( 148 | builder: (BuildContext context) => SignUp( 149 | cameraDescription: cameraDescription, 150 | ), 151 | ), 152 | ); 153 | }, 154 | ), 155 | ) 156 | ], 157 | ) 158 | ], 159 | ), 160 | ), 161 | ), 162 | ) 163 | : Center( 164 | child: CircularProgressIndicator( 165 | valueColor: new AlwaysStoppedAnimation( 166 | Color(0xff25354E), 167 | ), 168 | ), 169 | )); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /lib/pages/profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:FaceNetAuthentication/db/database.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | import 'package:FaceNetAuthentication/constants/ui_constants.dart'; 6 | 7 | 8 | import 'home.dart'; 9 | 10 | class Profile extends StatefulWidget { 11 | const Profile({Key key, @required this.username}) : super(key: key); 12 | 13 | final String username; 14 | 15 | @override 16 | _ProfileState createState() => _ProfileState(); 17 | } 18 | 19 | class _ProfileState extends State { 20 | DataBaseService _dataBaseService = DataBaseService(); 21 | String name = ''; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | savedStatus(); 27 | getUsername(); 28 | } 29 | 30 | savedStatus() async { 31 | SharedPreferences prefs = await SharedPreferences.getInstance(); 32 | prefs.setBool('loggedIn', true); 33 | prefs.setString('name', widget.username); 34 | } 35 | 36 | getUsername() async { 37 | SharedPreferences prefs = await SharedPreferences.getInstance(); 38 | if (widget.username == null) { 39 | setState(() { 40 | name = prefs.getString('name').toString(); 41 | }); 42 | } else { 43 | setState(() { 44 | name = widget.username.toString(); 45 | }); 46 | } 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Scaffold( 52 | appBar: AppBar( 53 | title: Text('Profile'), 54 | centerTitle: true, 55 | ), 56 | body: Container( 57 | height: MediaQuery.of(context).size.height, 58 | width: MediaQuery.of(context).size.width, 59 | child: Column( 60 | mainAxisAlignment: MainAxisAlignment.center, 61 | crossAxisAlignment: CrossAxisAlignment.center, 62 | children: [ 63 | Image.asset('assets/images/home.png'), 64 | Text( 65 | 'Welcome back, ' + name + '!', 66 | style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold), 67 | ), 68 | SizedBox(height: 40), 69 | SizedBox( 70 | width: UIConstants.fitToWidth(150, context), 71 | child: RaisedButton( 72 | padding: const EdgeInsets.symmetric(vertical: 16), 73 | child: Text( 74 | 'Logout', 75 | style: TextStyle(color: Colors.white), 76 | ), 77 | onPressed: () { 78 | Navigator.of(context).pushAndRemoveUntil( 79 | MaterialPageRoute(builder: (BuildContext context) { 80 | return MyHomePage(); 81 | }), (Route route) => false); 82 | }, 83 | ), 84 | ) 85 | ], 86 | ), 87 | ), 88 | floatingActionButton: FloatingActionButton( 89 | backgroundColor: Color(0xff25354E), 90 | onPressed: () async { 91 | SharedPreferences prefs = await SharedPreferences.getInstance(); 92 | prefs.clear(); 93 | _dataBaseService.cleanDB(); 94 | Navigator.of(context).pushAndRemoveUntil( 95 | MaterialPageRoute(builder: (BuildContext context) { 96 | return MyHomePage(); 97 | }), (Route route) => false); 98 | }, 99 | child: Icon(Icons.delete), 100 | ), 101 | ); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /lib/pages/sign-in.dart: -------------------------------------------------------------------------------- 1 | // A screen that allows users to take a picture using a given camera. 2 | import 'dart:async'; 3 | import 'dart:io'; 4 | import 'dart:math' as math; 5 | 6 | import 'package:camera/camera.dart'; 7 | import 'package:firebase_ml_vision/firebase_ml_vision.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:path/path.dart' show join; 10 | import 'package:path_provider/path_provider.dart'; 11 | 12 | import 'package:FaceNetAuthentication/services/camera.service.dart'; 13 | import 'package:FaceNetAuthentication/services/facenet.service.dart'; 14 | import 'package:FaceNetAuthentication/services/ml_vision_service.dart'; 15 | import 'package:FaceNetAuthentication/widgets/FacePainter.dart'; 16 | import 'package:FaceNetAuthentication/widgets/auth-action-button.dart'; 17 | 18 | class SignIn extends StatefulWidget { 19 | final CameraDescription cameraDescription; 20 | 21 | const SignIn({ 22 | Key key, 23 | @required this.cameraDescription, 24 | }) : super(key: key); 25 | 26 | @override 27 | SignInState createState() => SignInState(); 28 | } 29 | 30 | class SignInState extends State { 31 | /// Service injection 32 | CameraService _cameraService = CameraService(); 33 | MLVisionService _mlVisionService = MLVisionService(); 34 | FaceNetService _faceNetService = FaceNetService(); 35 | 36 | Future _initializeControllerFuture; 37 | 38 | bool cameraInitializated = false; 39 | bool _detectingFaces = false; 40 | bool pictureTaked = false; 41 | 42 | // switchs when the user press the camera 43 | bool _saving = false; 44 | bool _bottomSheetVisible = false; 45 | 46 | String imagePath; 47 | Size imageSize; 48 | Face faceDetected; 49 | 50 | @override 51 | void initState() { 52 | super.initState(); 53 | 54 | /// starts the camera & start framing faces 55 | _start(); 56 | } 57 | 58 | @override 59 | void dispose() { 60 | // Dispose of the controller when the widget is disposed. 61 | _cameraService.dispose(); 62 | super.dispose(); 63 | } 64 | 65 | /// starts the camera & start framing faces 66 | _start() async { 67 | _initializeControllerFuture = _cameraService.startService(widget.cameraDescription); 68 | await _initializeControllerFuture; 69 | 70 | setState(() { 71 | cameraInitializated = true; 72 | }); 73 | 74 | _frameFaces(); 75 | } 76 | 77 | /// draws rectangles when detects faces 78 | _frameFaces() { 79 | imageSize = _cameraService.getImageSize(); 80 | 81 | _cameraService.cameraController.startImageStream((image) async { 82 | if (_cameraService.cameraController != null) { 83 | // if its currently busy, avoids overprocessing 84 | if (_detectingFaces) return; 85 | 86 | _detectingFaces = true; 87 | 88 | try { 89 | List faces = await _mlVisionService.getFacesFromImage(image); 90 | 91 | if (faces != null) { 92 | if (faces.length > 0) { 93 | // preprocessing the image 94 | setState(() { 95 | faceDetected = faces[0]; 96 | }); 97 | 98 | if (_saving) { 99 | _saving = false; 100 | _faceNetService.setCurrentPrediction(image, faceDetected); 101 | } 102 | 103 | } else { 104 | setState(() { 105 | faceDetected = null; 106 | }); 107 | } 108 | } 109 | 110 | _detectingFaces = false; 111 | } catch (e) { 112 | print(e); 113 | _detectingFaces = false; 114 | } 115 | } 116 | }); 117 | } 118 | 119 | /// handles the button pressed event 120 | Future onShot() async { 121 | 122 | if (faceDetected == null) { 123 | showDialog( 124 | context: context, 125 | child: AlertDialog( 126 | content: Text('No face detected!'), 127 | )); 128 | 129 | return false; 130 | } else { 131 | imagePath = join((await getTemporaryDirectory()).path, '${DateTime.now()}.png'); 132 | 133 | _saving = true; 134 | 135 | await Future.delayed(Duration(milliseconds: 500)); 136 | await _cameraService.cameraController.stopImageStream(); 137 | await Future.delayed(Duration(milliseconds: 200)); 138 | await _cameraService.takePicture(imagePath); 139 | 140 | setState(() { 141 | _bottomSheetVisible = true; 142 | pictureTaked = true; 143 | }); 144 | 145 | return true; 146 | } 147 | } 148 | 149 | @override 150 | Widget build(BuildContext context) { 151 | final double mirror = math.pi; 152 | final width = MediaQuery.of(context).size.width; 153 | return Scaffold( 154 | body: FutureBuilder( 155 | future: _initializeControllerFuture, 156 | builder: (context, snapshot) { 157 | if (snapshot.connectionState == ConnectionState.done) { 158 | if (pictureTaked) { 159 | return Container( 160 | width: width, 161 | child: Transform( 162 | alignment: Alignment.center, 163 | child: Image.file(File(imagePath)), 164 | transform: Matrix4.rotationY(mirror)), 165 | ); 166 | } else { 167 | return Transform.scale( 168 | scale: 1.0, 169 | child: AspectRatio( 170 | aspectRatio: MediaQuery.of(context).size.aspectRatio, 171 | child: OverflowBox( 172 | alignment: Alignment.center, 173 | child: FittedBox( 174 | fit: BoxFit.fitHeight, 175 | child: Container( 176 | width: width, 177 | height: width / _cameraService.cameraController.value.aspectRatio, 178 | child: Stack( 179 | fit: StackFit.expand, 180 | children: [ 181 | CameraPreview(_cameraService.cameraController), 182 | CustomPaint( 183 | painter: FacePainter(face: faceDetected, imageSize: imageSize), 184 | ) 185 | ], 186 | ), 187 | ), 188 | ), 189 | ), 190 | ), 191 | ); 192 | } 193 | } else { 194 | return Center(child: CircularProgressIndicator()); 195 | } 196 | }, 197 | ), 198 | floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, 199 | floatingActionButton: !_bottomSheetVisible 200 | ? AuthActionButton( 201 | _initializeControllerFuture, 202 | onPressed: onShot, 203 | isLogin: true, 204 | ) 205 | : Container(), 206 | ); 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /lib/pages/sign-up.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'dart:math' as math; 4 | 5 | import 'package:camera/camera.dart'; 6 | import 'package:firebase_ml_vision/firebase_ml_vision.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:path/path.dart' show join; 9 | import 'package:path_provider/path_provider.dart'; 10 | 11 | import 'package:FaceNetAuthentication/services/camera.service.dart'; 12 | import 'package:FaceNetAuthentication/services/facenet.service.dart'; 13 | import 'package:FaceNetAuthentication/services/ml_vision_service.dart'; 14 | import 'package:FaceNetAuthentication/widgets/FacePainter.dart'; 15 | import 'package:FaceNetAuthentication/widgets/auth-action-button.dart'; 16 | 17 | class SignUp extends StatefulWidget { 18 | final CameraDescription cameraDescription; 19 | 20 | const SignUp({Key key, @required this.cameraDescription}) : super(key: key); 21 | 22 | @override 23 | SignUpState createState() => SignUpState(); 24 | } 25 | 26 | class SignUpState extends State { 27 | String imagePath; 28 | Face faceDetected; 29 | Size imageSize; 30 | 31 | bool _detectingFaces = false; 32 | bool pictureTaked = false; 33 | 34 | Future _initializeControllerFuture; 35 | bool cameraInitializated = false; 36 | 37 | // switchs when the user press the camera 38 | bool _saving = false; 39 | bool _bottomSheetVisible = false; 40 | 41 | // service injection 42 | MLVisionService _mlVisionService = MLVisionService(); 43 | CameraService _cameraService = CameraService(); 44 | FaceNetService _faceNetService = FaceNetService(); 45 | 46 | @override 47 | void initState() { 48 | super.initState(); 49 | 50 | /// starts the camera & start framing faces 51 | _start(); 52 | } 53 | 54 | @override 55 | void dispose() { 56 | // Dispose of the controller when the widget is disposed. 57 | _cameraService.dispose(); 58 | super.dispose(); 59 | } 60 | 61 | /// starts the camera & start framing faces 62 | _start() async { 63 | _initializeControllerFuture = 64 | _cameraService.startService(widget.cameraDescription); 65 | await _initializeControllerFuture; 66 | 67 | setState(() { 68 | cameraInitializated = true; 69 | }); 70 | 71 | _frameFaces(); 72 | } 73 | 74 | /// handles the button pressed event 75 | Future onShot() async { 76 | print('onShot performed'); 77 | 78 | if (faceDetected == null) { 79 | showDialog( 80 | context: context, 81 | child: AlertDialog( 82 | content: Text('No face detected!'), 83 | )); 84 | 85 | return false; 86 | } else { 87 | imagePath = 88 | join((await getTemporaryDirectory()).path, '${DateTime.now()}.png'); 89 | 90 | _saving = true; 91 | 92 | await Future.delayed(Duration(milliseconds: 500)); 93 | await _cameraService.cameraController.stopImageStream(); 94 | await Future.delayed(Duration(milliseconds: 200)); 95 | await _cameraService.takePicture(imagePath); 96 | 97 | setState(() { 98 | _bottomSheetVisible = true; 99 | pictureTaked = true; 100 | }); 101 | 102 | return true; 103 | } 104 | } 105 | 106 | /// draws rectangles when detects faces 107 | _frameFaces() { 108 | imageSize = _cameraService.getImageSize(); 109 | 110 | _cameraService.cameraController.startImageStream((image) async { 111 | if (_cameraService.cameraController != null) { 112 | // if its currently busy, avoids overprocessing 113 | if (_detectingFaces) return; 114 | 115 | _detectingFaces = true; 116 | 117 | try { 118 | List faces = await _mlVisionService.getFacesFromImage(image); 119 | 120 | if (faces.length > 0) { 121 | setState(() { 122 | faceDetected = faces[0]; 123 | }); 124 | 125 | if (_saving) { 126 | _faceNetService.setCurrentPrediction(image, faceDetected); 127 | setState(() { 128 | _saving = false; 129 | }); 130 | } 131 | } else { 132 | setState(() { 133 | faceDetected = null; 134 | }); 135 | } 136 | 137 | _detectingFaces = false; 138 | } catch (e) { 139 | print(e); 140 | _detectingFaces = false; 141 | } 142 | } 143 | }); 144 | } 145 | 146 | @override 147 | Widget build(BuildContext context) { 148 | final double mirror = math.pi; 149 | final width = MediaQuery.of(context).size.width; 150 | return Scaffold( 151 | body: FutureBuilder( 152 | future: _initializeControllerFuture, 153 | builder: (context, snapshot) { 154 | if (snapshot.connectionState == ConnectionState.done) { 155 | if (pictureTaked) { 156 | return Container( 157 | width: width, 158 | child: Transform( 159 | alignment: Alignment.center, 160 | child: Image.file(File(imagePath)), 161 | transform: Matrix4.rotationY(mirror)), 162 | ); 163 | } else { 164 | return Transform.scale( 165 | scale: 1.0, 166 | child: AspectRatio( 167 | aspectRatio: MediaQuery.of(context).size.aspectRatio, 168 | child: OverflowBox( 169 | alignment: Alignment.center, 170 | child: FittedBox( 171 | fit: BoxFit.fitHeight, 172 | child: Container( 173 | width: width, 174 | height: width / 175 | _cameraService.cameraController.value.aspectRatio, 176 | child: Stack( 177 | fit: StackFit.expand, 178 | children: [ 179 | CameraPreview(_cameraService.cameraController), 180 | CustomPaint( 181 | painter: FacePainter( 182 | face: faceDetected, imageSize: imageSize), 183 | ), 184 | ], 185 | ), 186 | ), 187 | ), 188 | ), 189 | ), 190 | ); 191 | } 192 | } else { 193 | return Center(child: CircularProgressIndicator()); 194 | } 195 | }, 196 | ), 197 | floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, 198 | backgroundColor: Color(0xff25354E), 199 | floatingActionButton: !_bottomSheetVisible 200 | ? AuthActionButton( 201 | _initializeControllerFuture, 202 | onPressed: onShot, 203 | isLogin: false, 204 | ) 205 | : Container()); 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /lib/pages/splashScreen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:FaceNetAuthentication/constants/ui_constants.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | 7 | import 'package:FaceNetAuthentication/pages/home.dart'; 8 | 9 | import 'profile.dart'; 10 | 11 | class SplashScreen extends StatefulWidget { 12 | @override 13 | _SplashScreenState createState() => _SplashScreenState(); 14 | } 15 | 16 | class _SplashScreenState extends State { 17 | @override 18 | void initState() { 19 | super.initState(); 20 | startTime(); 21 | } 22 | 23 | startTime() async { 24 | var duration = new Duration(seconds: 3); 25 | return new Timer(duration, navigate); 26 | } 27 | 28 | void navigate() async { 29 | SharedPreferences prefs = await SharedPreferences.getInstance(); 30 | print(prefs.getBool('loggedIn')); 31 | print(prefs.getString('name')); 32 | if (prefs.getBool('loggedIn') == true) { 33 | Navigator.of(context) 34 | .pushReplacement(MaterialPageRoute(builder: (context) { 35 | return Profile( 36 | username: '', 37 | ); 38 | })); 39 | } else { 40 | Navigator.of(context) 41 | .pushReplacement(MaterialPageRoute(builder: (context) { 42 | return MyHomePage(); 43 | })); 44 | } 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return Scaffold( 50 | body: Container( 51 | height: MediaQuery.of(context).size.height, 52 | width: MediaQuery.of(context).size.width, 53 | child: Column( 54 | mainAxisAlignment: MainAxisAlignment.center, 55 | crossAxisAlignment: CrossAxisAlignment.center, 56 | children: [Image.asset(UIConstants.splashScreenLogo), Padding( 57 | padding: const EdgeInsets.only(top: 4.0), 58 | child: Text("Made with ❤ by Sayan Nath"), 59 | )], 60 | ), 61 | ), 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/services/camera.service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:camera/camera.dart'; 4 | import 'package:firebase_ml_vision/firebase_ml_vision.dart'; 5 | 6 | class CameraService { 7 | // singleton boilerplate 8 | static final CameraService _cameraServiceService = CameraService._internal(); 9 | 10 | factory CameraService() { 11 | return _cameraServiceService; 12 | } 13 | // singleton boilerplate 14 | CameraService._internal(); 15 | 16 | CameraController _cameraController; 17 | CameraController get cameraController => this._cameraController; 18 | 19 | CameraDescription _cameraDescription; 20 | 21 | ImageRotation _cameraRotation; 22 | ImageRotation get cameraRotation => this._cameraRotation; 23 | 24 | Future startService(CameraDescription cameraDescription) async { 25 | this._cameraDescription = cameraDescription; 26 | this._cameraController = CameraController( 27 | this._cameraDescription, 28 | ResolutionPreset.high, 29 | enableAudio: false, 30 | ); 31 | 32 | // sets the rotation of the image 33 | this._cameraRotation = rotationIntToImageRotation( 34 | this._cameraDescription.sensorOrientation, 35 | ); 36 | 37 | // Next, initialize the controller. This returns a Future. 38 | return this._cameraController.initialize(); 39 | } 40 | 41 | ImageRotation rotationIntToImageRotation(int rotation) { 42 | switch (rotation) { 43 | case 90: 44 | return ImageRotation.rotation90; 45 | case 180: 46 | return ImageRotation.rotation180; 47 | case 270: 48 | return ImageRotation.rotation270; 49 | default: 50 | return ImageRotation.rotation0; 51 | } 52 | } 53 | 54 | /// takes the picture and saves it in the given path 📸 55 | Future takePicture(String imagePath) async { 56 | await _cameraController.takePicture(imagePath); 57 | } 58 | 59 | /// returns the image size 📏 60 | Size getImageSize() { 61 | return Size( 62 | _cameraController.value.previewSize.height, 63 | _cameraController.value.previewSize.width, 64 | ); 65 | } 66 | 67 | dispose() { 68 | this._cameraController.dispose(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/services/facenet.service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'dart:typed_data'; 3 | 4 | import 'package:camera/camera.dart'; 5 | import 'package:firebase_ml_vision/firebase_ml_vision.dart'; 6 | import 'package:image/image.dart' as imglib; 7 | import 'package:tflite_flutter/tflite_flutter.dart' as tflite; 8 | 9 | import 'package:FaceNetAuthentication/db/database.dart'; 10 | 11 | class FaceNetService { 12 | // singleton boilerplate 13 | static final FaceNetService _faceNetService = FaceNetService._internal(); 14 | 15 | factory FaceNetService() { 16 | return _faceNetService; 17 | } 18 | // singleton boilerplate 19 | FaceNetService._internal(); 20 | 21 | DataBaseService _dataBaseService = DataBaseService(); 22 | 23 | tflite.Interpreter _interpreter; 24 | 25 | double threshold = 1.0; 26 | 27 | List _predictedData; 28 | List get predictedData => this._predictedData; 29 | 30 | // saved users data 31 | dynamic data = {}; 32 | 33 | Future loadModel() async { 34 | try { 35 | final gpuDelegateV2 = tflite.GpuDelegateV2( 36 | options: tflite.GpuDelegateOptionsV2( 37 | false, 38 | tflite.TfLiteGpuInferenceUsage.fastSingleAnswer, 39 | tflite.TfLiteGpuInferencePriority.minLatency, 40 | tflite.TfLiteGpuInferencePriority.auto, 41 | tflite.TfLiteGpuInferencePriority.auto)); 42 | 43 | var interpreterOptions = tflite.InterpreterOptions() 44 | ..addDelegate(gpuDelegateV2); 45 | this._interpreter = await tflite.Interpreter.fromAsset( 46 | 'mobilefacenet.tflite', 47 | options: interpreterOptions); 48 | print('Model loaded Successfully!'); 49 | } catch (e) { 50 | print('Failed to load Model.'); 51 | print(e); 52 | } 53 | } 54 | 55 | setCurrentPrediction(CameraImage cameraImage, Face face) { 56 | /// crops the face from the image and transforms it to an array of data 57 | List input = _preProcess(cameraImage, face); 58 | 59 | /// then reshapes input and ouput to model format 🧑‍🔧 60 | input = input.reshape([1, 112, 112, 3]); 61 | List output = List(1 * 192).reshape([1, 192]); 62 | 63 | /// runs and transforms the data 🤖 64 | this._interpreter.run(input, output); 65 | output = output.reshape([192]); 66 | 67 | this._predictedData = List.from(output); 68 | } 69 | 70 | /// takes the predicted data previously saved and do inference 71 | String predict() { 72 | /// search closer user prediction if exists 73 | return _searchResult(this._predictedData); 74 | } 75 | 76 | /// _preProess: crops the image to be more easy 77 | /// to detect and transforms it to model input. 78 | /// [cameraImage]: current image 79 | /// [face]: face detected 80 | List _preProcess(CameraImage image, Face faceDetected) { 81 | // crops the face 💇 82 | imglib.Image croppedImage = _cropFace(image, faceDetected); 83 | imglib.Image img = imglib.copyResizeCropSquare(croppedImage, 112); 84 | 85 | // transforms the cropped face to array data 86 | Float32List imageAsList = imageToByteListFloat32(img); 87 | return imageAsList; 88 | } 89 | 90 | /// crops the face from the image 💇 91 | /// [cameraImage]: current image 92 | /// [face]: face detected 93 | _cropFace(CameraImage image, Face faceDetected) { 94 | imglib.Image convertedImage = _convertCameraImage(image); 95 | double x = faceDetected.boundingBox.left - 10.0; 96 | double y = faceDetected.boundingBox.top - 10.0; 97 | double w = faceDetected.boundingBox.width + 10.0; 98 | double h = faceDetected.boundingBox.height + 10.0; 99 | return imglib.copyCrop( 100 | convertedImage, x.round(), y.round(), w.round(), h.round()); 101 | } 102 | 103 | /// converts ___CameraImage___ type to ___Image___ type 104 | /// [image]: image to be converted 105 | imglib.Image _convertCameraImage(CameraImage image) { 106 | int width = image.width; 107 | int height = image.height; 108 | var img = imglib.Image(width, height); 109 | const int hexFF = 0xFF000000; 110 | final int uvyButtonStride = image.planes[1].bytesPerRow; 111 | final int uvPixelStride = image.planes[1].bytesPerPixel; 112 | for (int x = 0; x < width; x++) { 113 | for (int y = 0; y < height; y++) { 114 | final int uvIndex = 115 | uvPixelStride * (x / 2).floor() + uvyButtonStride * (y / 2).floor(); 116 | final int index = y * width + x; 117 | final yp = image.planes[0].bytes[index]; 118 | final up = image.planes[1].bytes[uvIndex]; 119 | final vp = image.planes[2].bytes[uvIndex]; 120 | int r = (yp + vp * 1436 / 1024 - 179).round().clamp(0, 255); 121 | int g = (yp - up * 46549 / 131072 + 44 - vp * 93604 / 131072 + 91) 122 | .round() 123 | .clamp(0, 255); 124 | int b = (yp + up * 1814 / 1024 - 227).round().clamp(0, 255); 125 | img.data[index] = hexFF | (b << 16) | (g << 8) | r; 126 | } 127 | } 128 | var img1 = imglib.copyRotate(img, -90); 129 | return img1; 130 | } 131 | 132 | Float32List imageToByteListFloat32(imglib.Image image) { 133 | /// input size = 112 134 | var convertedBytes = Float32List(1 * 112 * 112 * 3); 135 | var buffer = Float32List.view(convertedBytes.buffer); 136 | int pixelIndex = 0; 137 | 138 | for (var i = 0; i < 112; i++) { 139 | for (var j = 0; j < 112; j++) { 140 | var pixel = image.getPixel(j, i); 141 | 142 | /// mean: 128 143 | /// std: 128 144 | buffer[pixelIndex++] = (imglib.getRed(pixel) - 128) / 128; 145 | buffer[pixelIndex++] = (imglib.getGreen(pixel) - 128) / 128; 146 | buffer[pixelIndex++] = (imglib.getBlue(pixel) - 128) / 128; 147 | } 148 | } 149 | return convertedBytes.buffer.asFloat32List(); 150 | } 151 | 152 | /// searchs the result in the DDBB (this function should be performed by Backend) 153 | /// [predictedData]: Array that represents the face by the MobileFaceNet model 154 | String _searchResult(List predictedData) { 155 | /// loads 'database' 🙄 156 | data = _dataBaseService.db; 157 | 158 | /// if no faces saved 159 | if (data.length == 0) return null; 160 | double minDist = 999; 161 | double currDist = 0.0; 162 | String predRes; 163 | 164 | /// search the closest result 👓 165 | for (String label in data.keys) { 166 | currDist = _euclideanDistance(data[label], predictedData); 167 | if (currDist <= threshold && currDist < minDist) { 168 | minDist = currDist; 169 | predRes = label; 170 | } 171 | } 172 | return predRes; 173 | } 174 | 175 | /// Adds the power of the difference between each point 176 | /// then computes the sqrt of the result 📐 177 | double _euclideanDistance(List e1, List e2) { 178 | double sum = 0.0; 179 | for (int i = 0; i < e1.length; i++) { 180 | sum += pow((e1[i] - e2[i]), 2); 181 | } 182 | return sqrt(sum); 183 | } 184 | 185 | void setPredictedData(value) { 186 | this._predictedData = value; 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /lib/services/ml_vision_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:camera/camera.dart'; 2 | import 'package:firebase_ml_vision/firebase_ml_vision.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'package:FaceNetAuthentication/services/camera.service.dart'; 6 | 7 | class MLVisionService { 8 | // singleton boilerplate 9 | static final MLVisionService _cameraServiceService = MLVisionService._internal(); 10 | 11 | factory MLVisionService() { 12 | return _cameraServiceService; 13 | } 14 | // singleton boilerplate 15 | MLVisionService._internal(); 16 | 17 | // service injection 18 | CameraService _cameraService = CameraService(); 19 | 20 | FaceDetector _faceDetector; 21 | FaceDetector get faceDetector => this._faceDetector; 22 | 23 | void initialize() { 24 | this._faceDetector = FirebaseVision.instance.faceDetector( 25 | FaceDetectorOptions( 26 | mode: FaceDetectorMode.accurate, 27 | ), 28 | ); 29 | } 30 | 31 | Future> getFacesFromImage(CameraImage image) async { 32 | 33 | /// preprocess the image 🧑🏻‍🔧 34 | FirebaseVisionImageMetadata _firebaseImageMetadata = FirebaseVisionImageMetadata( 35 | rotation: _cameraService.cameraRotation, 36 | rawFormat: image.format.raw, 37 | size: Size(image.width.toDouble(), image.height.toDouble()), 38 | planeData: image.planes.map( 39 | (Plane plane) { 40 | return FirebaseVisionImagePlaneMetadata( 41 | bytesPerRow: plane.bytesPerRow, 42 | height: plane.height, 43 | width: plane.width, 44 | ); 45 | }, 46 | ).toList(), 47 | ); 48 | 49 | /// Transform the image input for the _faceDetector 🎯 50 | FirebaseVisionImage _firebaseVisionImage = 51 | FirebaseVisionImage.fromBytes(image.planes[0].bytes, _firebaseImageMetadata); 52 | 53 | /// proces the image and makes inference 🤖 54 | List faces = await this._faceDetector.processImage(_firebaseVisionImage); 55 | return faces; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/widgets/FacePainter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:firebase_ml_vision/firebase_ml_vision.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class FacePainter extends CustomPainter { 7 | FacePainter({@required this.imageSize, @required this.face}); 8 | final Size imageSize; 9 | double scaleX, scaleY; 10 | Face face; 11 | @override 12 | void paint(Canvas canvas, Size size) { 13 | if (face == null) return; 14 | 15 | Paint paint; 16 | 17 | if (this.face.headEulerAngleY > 10 || this.face.headEulerAngleY < -10) { 18 | paint = Paint() 19 | ..style = PaintingStyle.stroke 20 | ..strokeWidth = 3.0 21 | ..color = Colors.red; 22 | } else { 23 | paint = Paint() 24 | ..style = PaintingStyle.stroke 25 | ..strokeWidth = 3.0 26 | ..color = Colors.green; 27 | } 28 | 29 | scaleX = size.width / imageSize.width; 30 | scaleY = size.height / imageSize.height; 31 | 32 | canvas.drawRRect( 33 | _scaleRect(rect: face.boundingBox, imageSize: imageSize, widgetSize: size, scaleX: scaleX, scaleY: scaleY), 34 | paint); 35 | } 36 | 37 | @override 38 | bool shouldRepaint(FacePainter oldDelegate) { 39 | return oldDelegate.imageSize != imageSize || oldDelegate.face != face; 40 | } 41 | } 42 | 43 | RRect _scaleRect( 44 | {@required Rect rect, @required Size imageSize, @required Size widgetSize, double scaleX, double scaleY}) { 45 | return RRect.fromLTRBR((widgetSize.width - rect.left.toDouble() * scaleX), rect.top.toDouble() * scaleY, 46 | widgetSize.width - rect.right.toDouble() * scaleX, rect.bottom.toDouble() * scaleY, Radius.circular(10)); 47 | } 48 | -------------------------------------------------------------------------------- /lib/widgets/auth-action-button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:FaceNetAuthentication/constants/ui_constants.dart'; 4 | import 'package:FaceNetAuthentication/db/database.dart'; 5 | import 'package:FaceNetAuthentication/pages/home.dart'; 6 | import 'package:FaceNetAuthentication/pages/profile.dart'; 7 | import 'package:FaceNetAuthentication/services/facenet.service.dart'; 8 | 9 | class User { 10 | String user; 11 | String password; 12 | 13 | User({@required this.user, @required this.password}); 14 | 15 | static User fromDB(String dbuser) { 16 | return new User(user: dbuser.split(':')[0], password: dbuser.split(':')[1]); 17 | } 18 | } 19 | 20 | class AuthActionButton extends StatefulWidget { 21 | AuthActionButton(this._initializeControllerFuture, 22 | {@required this.onPressed, @required this.isLogin}); 23 | final Future _initializeControllerFuture; 24 | final Function onPressed; 25 | final bool isLogin; 26 | @override 27 | _AuthActionButtonState createState() => _AuthActionButtonState(); 28 | } 29 | 30 | class _AuthActionButtonState extends State { 31 | /// service injection 32 | final FaceNetService _faceNetService = FaceNetService(); 33 | final DataBaseService _dataBaseService = DataBaseService(); 34 | 35 | final TextEditingController _userTextEditingController = 36 | TextEditingController(text: ''); 37 | final TextEditingController _passwordTextEditingController = 38 | TextEditingController(text: ''); 39 | 40 | User predictedUser; 41 | 42 | Future _signUp(context) async { 43 | /// gets predicted data from facenet service (user face detected) 44 | List predictedData = _faceNetService.predictedData; 45 | String user = _userTextEditingController.text; 46 | String password = _passwordTextEditingController.text; 47 | 48 | /// creates a new user in the 'database' 49 | await _dataBaseService.saveData(user, password, predictedData); 50 | 51 | /// resets the face stored in the face net sevice 52 | this._faceNetService.setPredictedData(null); 53 | Navigator.of(context).pushReplacement( 54 | MaterialPageRoute(builder: (BuildContext context) => MyHomePage())); 55 | } 56 | 57 | Future _signIn(context) async { 58 | String password = _passwordTextEditingController.text; 59 | 60 | if (this.predictedUser.password == password) { 61 | Navigator.of(context).pushReplacement(MaterialPageRoute( 62 | builder: (BuildContext context) => Profile( 63 | username: this.predictedUser.user, 64 | ))); 65 | } else { 66 | print(" WRONG PASSWORD!"); 67 | } 68 | } 69 | 70 | String _predictUser() { 71 | String userAndPass = _faceNetService.predict(); 72 | return userAndPass ?? null; 73 | } 74 | 75 | @override 76 | Widget build(BuildContext context) { 77 | return FloatingActionButton.extended( 78 | backgroundColor: Color(0xff25354E), 79 | label: widget.isLogin ? Text('Sign in') : Text('Sign up'), 80 | icon: Icon(Icons.camera_alt), 81 | // Provide an onPressed callback. 82 | onPressed: () async { 83 | try { 84 | // Ensure that the camera is initialized. 85 | await widget._initializeControllerFuture; 86 | // onShot event (takes the image and predict output) 87 | bool faceDetected = await widget.onPressed(); 88 | 89 | if (faceDetected) { 90 | if (widget.isLogin) { 91 | var userAndPass = _predictUser(); 92 | if (userAndPass != null) { 93 | this.predictedUser = User.fromDB(userAndPass); 94 | } 95 | } 96 | Scaffold.of(context) 97 | .showBottomSheet((context) => signSheet(context)); 98 | } 99 | } catch (e) { 100 | // If an error occurs, log the error to the console. 101 | print(e); 102 | } 103 | }, 104 | ); 105 | } 106 | 107 | signSheet(context) { 108 | return Container( 109 | padding: EdgeInsets.all(20), 110 | height: 300, 111 | child: Column( 112 | children: [ 113 | widget.isLogin && predictedUser != null 114 | ? Container( 115 | child: Text( 116 | 'Welcome Back! ' + predictedUser.user + '! 😄', 117 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 118 | ), 119 | ) 120 | : widget.isLogin 121 | ? Container( 122 | child: Text( 123 | 'User not found 😞', 124 | style: 125 | TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 126 | )) 127 | : Container(), 128 | !widget.isLogin 129 | ? TextField( 130 | controller: _userTextEditingController, 131 | textCapitalization: TextCapitalization.sentences, 132 | decoration: InputDecoration( 133 | prefixIcon: Icon( 134 | Icons.person, 135 | color: Color(0xff25354E), 136 | ), 137 | labelText: "Your Name"), 138 | ) 139 | : Container(), 140 | widget.isLogin && predictedUser == null 141 | ? Container() 142 | : TextField( 143 | controller: _passwordTextEditingController, 144 | decoration: InputDecoration( 145 | prefixIcon: Icon( 146 | Icons.security, 147 | color: Color(0xff25354E), 148 | ), 149 | labelText: "Password"), 150 | obscureText: true, 151 | ), 152 | widget.isLogin && predictedUser != null 153 | ? Padding( 154 | padding: const EdgeInsets.only(top: 32), 155 | child: SizedBox( 156 | width: UIConstants.fitToWidth(250, context), 157 | child: RaisedButton( 158 | padding: const EdgeInsets.symmetric(vertical: 16), 159 | child: 160 | Text('Login', style: TextStyle(color: Colors.white)), 161 | onPressed: () async { 162 | _signIn(context); 163 | }, 164 | ), 165 | ), 166 | ) 167 | : !widget.isLogin 168 | ? Padding( 169 | padding: const EdgeInsets.only(top: 32), 170 | child: SizedBox( 171 | width: UIConstants.fitToWidth(250, context), 172 | child: RaisedButton( 173 | padding: const EdgeInsets.symmetric(vertical: 16), 174 | child: Text('Sign Up!', 175 | style: TextStyle(color: Colors.white)), 176 | onPressed: () async { 177 | await _signUp(context); 178 | }, 179 | ), 180 | ), 181 | ) 182 | : Container(), 183 | ], 184 | ), 185 | ); 186 | } 187 | 188 | @override 189 | void dispose() { 190 | super.dispose(); 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /lib/widgets/display-picture-screen.dart: -------------------------------------------------------------------------------- 1 | // A widget that displays the picture taken by the user. 2 | import 'dart:io'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class DisplayPictureScreen extends StatelessWidget { 6 | final String imagePath; 7 | 8 | const DisplayPictureScreen({Key key, this.imagePath}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | appBar: AppBar(title: Text('Display the Picture')), 14 | // The image is stored as a file on the device. Use the `Image.file` 15 | // constructor with the given path to display the image. 16 | body: Image.file(File(imagePath)), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.13" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.6.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.5.0-nullsafety.1" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.1.0-nullsafety.1" 32 | camera: 33 | dependency: "direct main" 34 | description: 35 | name: camera 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.5.8+17" 39 | characters: 40 | dependency: transitive 41 | description: 42 | name: characters 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0-nullsafety.3" 46 | charcode: 47 | dependency: transitive 48 | description: 49 | name: charcode 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.2.0-nullsafety.1" 53 | clock: 54 | dependency: transitive 55 | description: 56 | name: clock 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.1.0-nullsafety.1" 60 | collection: 61 | dependency: transitive 62 | description: 63 | name: collection 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.15.0-nullsafety.3" 67 | convert: 68 | dependency: transitive 69 | description: 70 | name: convert 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.1" 74 | crypto: 75 | dependency: transitive 76 | description: 77 | name: crypto 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "2.1.5" 81 | cupertino_icons: 82 | dependency: "direct main" 83 | description: 84 | name: cupertino_icons 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.1.3" 88 | fake_async: 89 | dependency: transitive 90 | description: 91 | name: fake_async 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "1.2.0-nullsafety.1" 95 | ffi: 96 | dependency: transitive 97 | description: 98 | name: ffi 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "0.1.3" 102 | file: 103 | dependency: transitive 104 | description: 105 | name: file 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "5.2.1" 109 | firebase_ml_vision: 110 | dependency: "direct main" 111 | description: 112 | name: firebase_ml_vision 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "0.9.6+2" 116 | flutter: 117 | dependency: "direct main" 118 | description: flutter 119 | source: sdk 120 | version: "0.0.0" 121 | flutter_test: 122 | dependency: "direct dev" 123 | description: flutter 124 | source: sdk 125 | version: "0.0.0" 126 | flutter_web_plugins: 127 | dependency: transitive 128 | description: flutter 129 | source: sdk 130 | version: "0.0.0" 131 | image: 132 | dependency: "direct main" 133 | description: 134 | name: image 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.1.19" 138 | intl: 139 | dependency: transitive 140 | description: 141 | name: intl 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "0.16.1" 145 | matcher: 146 | dependency: transitive 147 | description: 148 | name: matcher 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "0.12.10-nullsafety.1" 152 | meta: 153 | dependency: transitive 154 | description: 155 | name: meta 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.3.0-nullsafety.3" 159 | path: 160 | dependency: "direct main" 161 | description: 162 | name: path 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.8.0-nullsafety.1" 166 | path_provider: 167 | dependency: "direct main" 168 | description: 169 | name: path_provider 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.6.27" 173 | path_provider_linux: 174 | dependency: transitive 175 | description: 176 | name: path_provider_linux 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.0.1+2" 180 | path_provider_macos: 181 | dependency: transitive 182 | description: 183 | name: path_provider_macos 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "0.0.4+3" 187 | path_provider_platform_interface: 188 | dependency: transitive 189 | description: 190 | name: path_provider_platform_interface 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.0.3" 194 | path_provider_windows: 195 | dependency: transitive 196 | description: 197 | name: path_provider_windows 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.0.4+3" 201 | petitparser: 202 | dependency: transitive 203 | description: 204 | name: petitparser 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "3.0.4" 208 | platform: 209 | dependency: transitive 210 | description: 211 | name: platform 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.2.1" 215 | plugin_platform_interface: 216 | dependency: transitive 217 | description: 218 | name: plugin_platform_interface 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.0.2" 222 | process: 223 | dependency: transitive 224 | description: 225 | name: process 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "3.0.13" 229 | quiver: 230 | dependency: transitive 231 | description: 232 | name: quiver 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "2.1.5" 236 | shared_preferences: 237 | dependency: "direct main" 238 | description: 239 | name: shared_preferences 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "0.5.12+4" 243 | shared_preferences_linux: 244 | dependency: transitive 245 | description: 246 | name: shared_preferences_linux 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "0.0.2+4" 250 | shared_preferences_macos: 251 | dependency: transitive 252 | description: 253 | name: shared_preferences_macos 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "0.0.1+11" 257 | shared_preferences_platform_interface: 258 | dependency: transitive 259 | description: 260 | name: shared_preferences_platform_interface 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "1.0.4" 264 | shared_preferences_web: 265 | dependency: transitive 266 | description: 267 | name: shared_preferences_web 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "0.1.2+7" 271 | shared_preferences_windows: 272 | dependency: transitive 273 | description: 274 | name: shared_preferences_windows 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "0.0.2+2" 278 | sky_engine: 279 | dependency: transitive 280 | description: flutter 281 | source: sdk 282 | version: "0.0.99" 283 | source_span: 284 | dependency: transitive 285 | description: 286 | name: source_span 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "1.8.0-nullsafety.2" 290 | stack_trace: 291 | dependency: transitive 292 | description: 293 | name: stack_trace 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "1.10.0-nullsafety.1" 297 | stream_channel: 298 | dependency: transitive 299 | description: 300 | name: stream_channel 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "2.1.0-nullsafety.1" 304 | string_scanner: 305 | dependency: transitive 306 | description: 307 | name: string_scanner 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "1.1.0-nullsafety.1" 311 | term_glyph: 312 | dependency: transitive 313 | description: 314 | name: term_glyph 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "1.2.0-nullsafety.1" 318 | test_api: 319 | dependency: transitive 320 | description: 321 | name: test_api 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "0.2.19-nullsafety.2" 325 | tflite_flutter: 326 | dependency: "direct main" 327 | description: 328 | name: tflite_flutter 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "0.5.0" 332 | typed_data: 333 | dependency: transitive 334 | description: 335 | name: typed_data 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "1.3.0-nullsafety.3" 339 | vector_math: 340 | dependency: transitive 341 | description: 342 | name: vector_math 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "2.1.0-nullsafety.3" 346 | win32: 347 | dependency: transitive 348 | description: 349 | name: win32 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "1.7.4+1" 353 | xdg_directories: 354 | dependency: transitive 355 | description: 356 | name: xdg_directories 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "0.1.0" 360 | xml: 361 | dependency: transitive 362 | description: 363 | name: xml 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "4.2.0" 367 | sdks: 368 | dart: ">=2.10.0-110 <2.11.0" 369 | flutter: ">=1.12.13+hotfix.5 <2.0.0" 370 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: FaceNetAuthentication 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | camera: ^0.5.8+5 27 | cupertino_icons: ^0.1.3 28 | firebase_ml_vision: ^0.9.6+2 29 | image: ^2.1.19 30 | path: ^1.7.0 31 | path_provider: ^1.6.27 32 | shared_preferences: ^0.5.12+4 33 | tflite_flutter: ^0.5.0 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | 39 | # For information on the generic Dart part of this file, see the 40 | # following page: https://dart.dev/tools/pub/pubspec 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | assets: 51 | - assets/mobilefacenet.tflite 52 | - assets/images/ 53 | # - images/a_dot_ham.jpeg 54 | -------------------------------------------------------------------------------- /screenshots/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/demo.mp4 -------------------------------------------------------------------------------- /screenshots/five.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/five.jpeg -------------------------------------------------------------------------------- /screenshots/four.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/four.jpeg -------------------------------------------------------------------------------- /screenshots/git_dashes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/git_dashes.png -------------------------------------------------------------------------------- /screenshots/one.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/one.jpeg -------------------------------------------------------------------------------- /screenshots/tfloveflutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/tfloveflutter.png -------------------------------------------------------------------------------- /screenshots/three.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/three.jpeg -------------------------------------------------------------------------------- /screenshots/two.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sayannath/Face-Authentication-App/11eaafd4bb026af55753fdab602d913b2bf923f1/screenshots/two.jpeg -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:FaceNetAuthentication/main.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_test/flutter_test.dart'; 11 | 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------