├── android
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── assets
│ │ │ │ ├── labels
│ │ │ │ │ ├── .gitkeep
│ │ │ │ │ └── fruit_label_list
│ │ │ │ └── models
│ │ │ │ │ └── .gitkeep
│ │ │ ├── jniLibs
│ │ │ │ ├── arm64-v8a
│ │ │ │ │ ├── libhiai.so
│ │ │ │ │ ├── libhiai_ir.so
│ │ │ │ │ ├── libc++_shared.so
│ │ │ │ │ ├── libhiai_ir_build.so
│ │ │ │ │ └── libpaddle_lite_jni.so
│ │ │ │ └── armeabi-v7a
│ │ │ │ │ ├── libhiai.so
│ │ │ │ │ ├── libhiai_ir.so
│ │ │ │ │ ├── libc++_shared.so
│ │ │ │ │ ├── libhiai_ir_build.so
│ │ │ │ │ └── libpaddle_lite_jni.so
│ │ │ ├── res
│ │ │ │ ├── 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
│ │ │ │ └── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── realtimeod
│ │ │ │ ├── Utils.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── Predictor.java
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle.properties
├── .gitignore
├── .idea
│ ├── caches
│ │ └── build_file_checksums.ser
│ ├── libraries
│ │ ├── Gradle____local_aars_____app_libs_PaddlePredictor_jar_unspecified_jar.xml
│ │ ├── Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml
│ │ ├── Gradle____local_aars________build_app_intermediates_flutter_debug_libs_jar_unspecified_jar.xml
│ │ ├── Gradle__io_flutter_x86_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml
│ │ ├── Gradle__io_flutter_x86_64_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml
│ │ ├── Gradle__io_flutter_arm64_v8a_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml
│ │ ├── Gradle__io_flutter_armeabi_v7a_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml
│ │ ├── Gradle__androidx_arch_core_core_common_2_0_0_jar.xml
│ │ ├── Gradle__androidx_collection_collection_1_0_0_jar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_common_java8_2_0_0_jar.xml
│ │ ├── Gradle__androidx_loader_loader_1_0_0_aar.xml
│ │ ├── Gradle__junit_junit_4_12_jar.xml
│ │ ├── Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml
│ │ ├── Gradle__androidx_customview_customview_1_0_0_aar.xml
│ │ ├── Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml
│ │ ├── Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml
│ │ ├── Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml
│ │ ├── Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml
│ │ ├── Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml
│ │ ├── Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml
│ │ ├── Gradle__javax_inject_javax_inject_1_jar.xml
│ │ ├── Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml
│ │ ├── Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml
│ │ ├── Gradle__com_squareup_javawriter_2_1_1_jar.xml
│ │ ├── Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml
│ │ ├── Gradle__org_jetbrains_annotations_13_0_jar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml
│ │ ├── Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml
│ │ ├── Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml
│ │ ├── Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml
│ │ ├── Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml
│ │ ├── Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml
│ │ ├── Gradle__androidx_annotation_annotation_1_0_0_jar.xml
│ │ ├── Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml
│ │ ├── Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml
│ │ ├── Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_50_jar.xml
│ │ ├── Gradle__androidx_core_core_1_0_0_aar.xml
│ │ ├── Gradle__androidx_print_print_1_0_0_aar.xml
│ │ ├── Gradle__androidx_test_runner_1_1_1_aar.xml
│ │ ├── Gradle__androidx_test_monitor_1_1_1_aar.xml
│ │ ├── Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_50_jar.xml
│ │ ├── Gradle__androidx_fragment_fragment_1_0_0_aar.xml
│ │ ├── Gradle__io_flutter_flutter_embedding_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml
│ │ ├── Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml
│ │ ├── Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_50_jar.xml
│ │ ├── Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml
│ │ ├── Gradle__androidx_test_espresso_espresso_core_3_1_1_aar.xml
│ │ ├── Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml
│ │ ├── Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml
│ │ └── Gradle__androidx_test_espresso_espresso_idling_resource_3_1_1_aar.xml
│ ├── misc.xml
│ ├── runConfigurations.xml
│ ├── gradle.xml
│ ├── modules.xml
│ ├── codeStyles
│ │ └── Project.xml
│ └── workspace.xml
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── build.gradle
├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ ├── LaunchImage.imageset
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ ├── README.md
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ └── project.pbxproj
└── .gitignore
├── .idea
├── .gitignore
└── misc.xml
├── imgs
└── 20200324184756.jpg
├── test
└── widget_test.dart
├── README.md
├── lib
├── object_detector.dart
└── main.dart
├── pubspec.yaml
├── .gitignore
└── LICENSE
/android/app/src/main/assets/labels/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/models/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/labels/fruit_label_list:
--------------------------------------------------------------------------------
1 | apple
2 | banana
3 | orange
4 |
--------------------------------------------------------------------------------
/imgs/20200324184756.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/imgs/20200324184756.jpg
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 | android.enableR8=true
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/arm64-v8a/libhiai.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/arm64-v8a/libhiai.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi-v7a/libhiai.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/armeabi-v7a/libhiai.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/arm64-v8a/libhiai_ir.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/arm64-v8a/libhiai_ir.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi-v7a/libhiai_ir.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/armeabi-v7a/libhiai_ir.so
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/arm64-v8a/libhiai_ir_build.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/arm64-v8a/libhiai_ir_build.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/arm64-v8a/libpaddle_lite_jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/arm64-v8a/libpaddle_lite_jni.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi-v7a/libhiai_ir_build.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/armeabi-v7a/libhiai_ir_build.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi-v7a/libpaddle_lite_jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/android/app/src/main/jniLibs/armeabi-v7a/libpaddle_lite_jni.so
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KernelErr/realtime-object-detector/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Mar 18 01:06:47 CST 2020
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-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle____local_aars_____app_libs_PaddlePredictor_jar_unspecified_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle____local_aars________build_app_intermediates_flutter_debug_libs_jar_unspecified_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/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:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:realtimeod/main.dart';
12 |
13 | void main() {
14 | }
15 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__io_flutter_x86_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__io_flutter_x86_64_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__io_flutter_arm64_v8a_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__io_flutter_armeabi_v7a_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_java8_2_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__junit_junit_4_12_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_50_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_test_runner_1_1_1_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_1_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_50_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__io_flutter_flutter_embedding_debug_1_0_0_e1e6ced81d029258d449bdec2ba3cddca9c2ca0c_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_50_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/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.6.1'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
33 |
34 | allprojects {
35 | gradle.projectsEvaluated {
36 | tasks.withType(JavaCompile) {
37 | options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_1_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Real-time Object Detector
2 |
3 | 这是一款基于[Paddle-Lite](https://github.com/paddlepaddle/paddle-lite)的实时目标检测App,使用Flutter开发,模型默认支持的是YOLO v3。
4 |
5 | ## 开发环境
6 |
7 | - OS: Ubuntu
8 | - Flutter version 1.22.5
9 | - Dart version 2.10.4
10 | - Paddle Lite预编译库 2.6.1
11 | - armv8测试通过
12 |
13 | ## 介绍及截图
14 |
15 | 模型下载地址: https://pan.baidu.com/s/1lO1HWiD-AZC_bXx92RqhmA 提取码: jgmd
16 |
17 | 请将模型放至`android/app/src/main/assets/models/fruit`路径下。
18 |
19 | 详细介绍位置:[基于Paddle-Lite的实时目标检测程序(Flutter & YOLO v3)](https://oldblog.lirui.tech/2020/%E5%9F%BA%E4%BA%8Epaddle-lite%E7%9A%84%E5%AE%9E%E6%97%B6%E7%9B%AE%E6%A0%87%E6%A3%80%E6%B5%8B%E7%A8%8B%E5%BA%8F-flutter-yolo-v3/) 及 [使用飞桨框架部署SSD目标检测模型](https://oldblog.lirui.tech/2020/%E4%BD%BF%E7%94%A8%E9%A3%9E%E6%A1%A8%E6%A1%86%E6%9E%B6%E9%83%A8%E7%BD%B2ssd%E7%9B%AE%E6%A0%87%E6%A3%80%E6%B5%8B%E6%A8%A1%E5%9E%8B/)
20 |
21 | English tutorial: [Real-time Object Detection on Android using Paddle-Lite](https://oldblog.lirui.tech/2020/real-time-object-detection-on-android-using-paddle-lite/)
22 |
23 | Demo截图:
24 |
25 | 
26 |
--------------------------------------------------------------------------------
/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_1_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/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 | realtimeod
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 |
--------------------------------------------------------------------------------
/lib/object_detector.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:camera/camera.dart';
3 | import 'package:flutter/services.dart';
4 |
5 | class ObjectDetector extends ValueNotifier {
6 | ObjectDetector._() : super(null);
7 |
8 | static CameraController _controller;
9 |
10 | static bool _isDetecting = false;
11 | static const platform = const MethodChannel('paddlelite');
12 |
13 | static final ObjectDetector instance = ObjectDetector._();
14 | void init(CameraController controller) async {
15 | _controller = controller;
16 | _controller.initialize().then((_) {
17 | _controller.startImageStream((CameraImage image) {
18 | if (!_isDetecting) {
19 | _isDetecting = true;
20 | _runDetection(image);
21 | }
22 | });
23 | });
24 | }
25 |
26 | void _runDetection(CameraImage image) async {
27 | try {
28 | var inputImage = new Map();
29 | inputImage["planes"] = new List(image.planes.length);
30 | for (int i = 0; i < image.planes.length; i++) {
31 | var value = {};
32 | value["bytes"] = image.planes[i].bytes;
33 | value["bytesPerRow"] = image.planes[i].bytesPerRow;
34 | value["bytesPerPixel"] = image.planes[i].bytesPerPixel;
35 | value["height"] = image.planes[i].height;
36 | value["width"] = image.planes[i].width;
37 | inputImage["planes"][i] = value;
38 | }
39 | inputImage["height"] = image.height;
40 | inputImage["width"] = image.width;
41 | inputImage["rotation"] = 90;
42 |
43 | print("Run model.");
44 | var results = await platform.invokeMethod(
45 | 'detectObject',
46 | inputImage,
47 | );
48 | value = results;
49 |
50 | } finally {
51 | _isDetecting = false;
52 | }
53 | }
54 |
55 | @override
56 | void dispose() {
57 | super.dispose();
58 | suspend();
59 | }
60 |
61 | void suspend() {
62 | _controller?.dispose();
63 | _controller = null;
64 | value = null;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/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: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | aaptOptions {
32 | noCompress "assets"
33 | }
34 |
35 | sourceSets {
36 | main.java.srcDirs += 'src/main/kotlin'
37 | }
38 |
39 | lintOptions {
40 | disable 'InvalidPackage'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.example.realtimeod"
46 | minSdkVersion 21
47 | targetSdkVersion 28
48 | versionCode flutterVersionCode.toInteger()
49 | versionName flutterVersionName
50 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation fileTree(include: ['*.jar'], dir: 'libs')
68 | implementation 'com.android.support:appcompat-v7:28.0.0'
69 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
70 | testImplementation 'junit:junit:4.12'
71 | androidTestImplementation 'androidx.test:runner:1.1.1'
72 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
73 | }
74 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: realtimeod
2 | description: A real-time object detector based on Paddle-lite.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 1.0.0+1
15 |
16 | environment:
17 | sdk: ">=2.1.0 <3.0.0"
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 |
23 | # The following adds the Cupertino Icons font to your application.
24 | # Use with the CupertinoIcons class for iOS style icons.
25 | cupertino_icons: ^0.1.2
26 | camera: ^0.5.8+17
27 |
28 | dev_dependencies:
29 | flutter_test:
30 | sdk: flutter
31 |
32 |
33 | # For information on the generic Dart part of this file, see the
34 | # following page: https://dart.dev/tools/pub/pubspec
35 |
36 | # The following section is specific to Flutter.
37 | flutter:
38 |
39 | # The following line ensures that the Material Icons font is
40 | # included with your application, so that you can use the icons in
41 | # the material Icons class.
42 | uses-material-design: true
43 |
44 | # To add assets to your application, add an assets section, like this:
45 | # assets:
46 | # - images/a_dot_burr.jpeg
47 | # - images/a_dot_ham.jpeg
48 |
49 | # An image asset can refer to one or more resolution-specific "variants", see
50 | # https://flutter.dev/assets-and-images/#resolution-aware.
51 |
52 | # For details regarding adding assets from package dependencies, see
53 | # https://flutter.dev/assets-and-images/#from-packages
54 |
55 | # To add custom fonts to your application, add a fonts section here,
56 | # in this "flutter" section. Each entry in this list should have a
57 | # "family" key with the font family name, and a "fonts" key with a
58 | # list giving the asset and other descriptors for the font. For
59 | # example:
60 | # fonts:
61 | # - family: Schyler
62 | # fonts:
63 | # - asset: fonts/Schyler-Regular.ttf
64 | # - asset: fonts/Schyler-Italic.ttf
65 | # style: italic
66 | # - family: Trajan Pro
67 | # fonts:
68 | # - asset: fonts/TrajanPro.ttf
69 | # - asset: fonts/TrajanPro_Bold.ttf
70 | # weight: 700
71 | #
72 | # For details regarding fonts from package dependencies,
73 | # see https://flutter.dev/custom-fonts/#from-packages
74 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/realtimeod/Utils.java:
--------------------------------------------------------------------------------
1 | package com.example.realtimeod;
2 |
3 | import android.content.Context;
4 | import android.os.Environment;
5 |
6 | import java.io.BufferedInputStream;
7 | import java.io.BufferedOutputStream;
8 | import java.io.File;
9 | import java.io.FileNotFoundException;
10 | import java.io.FileOutputStream;
11 | import java.io.IOException;
12 | import java.io.InputStream;
13 | import java.io.OutputStream;
14 |
15 | public class Utils {
16 | private static final String TAG = Utils.class.getSimpleName();
17 |
18 | public static void copyFileFromAssets(Context appCtx, String srcPath, String dstPath) {
19 | if (srcPath.isEmpty() || dstPath.isEmpty()) {
20 | return;
21 | }
22 | InputStream is = null;
23 | OutputStream os = null;
24 | try {
25 | is = new BufferedInputStream(appCtx.getAssets().open(srcPath));
26 | os = new BufferedOutputStream(new FileOutputStream(new File(dstPath)));
27 | byte[] buffer = new byte[1024];
28 | int length = 0;
29 | while ((length = is.read(buffer)) != -1) {
30 | os.write(buffer, 0, length);
31 | }
32 | } catch (FileNotFoundException e) {
33 | e.printStackTrace();
34 | } catch (IOException e) {
35 | e.printStackTrace();
36 | } finally {
37 | try {
38 | os.close();
39 | is.close();
40 | } catch (IOException e) {
41 | e.printStackTrace();
42 | }
43 | }
44 | }
45 |
46 | public static void copyDirectoryFromAssets(Context appCtx, String srcDir, String dstDir) {
47 | if (srcDir.isEmpty() || dstDir.isEmpty()) {
48 | return;
49 | }
50 | try {
51 | if (!new File(dstDir).exists()) {
52 | new File(dstDir).mkdirs();
53 | }
54 | for (String fileName : appCtx.getAssets().list(srcDir)) {
55 | String srcSubPath = srcDir + File.separator + fileName;
56 | String dstSubPath = dstDir + File.separator + fileName;
57 | if (new File(srcSubPath).isDirectory()) {
58 | copyDirectoryFromAssets(appCtx, srcSubPath, dstSubPath);
59 | } else {
60 | copyFileFromAssets(appCtx, srcSubPath, dstSubPath);
61 | }
62 | }
63 | } catch (Exception e) {
64 | e.printStackTrace();
65 | }
66 | }
67 |
68 | public static float[] parseFloatsFromString(String string, String delimiter) {
69 | String[] pieces = string.trim().toLowerCase().split(delimiter);
70 | float[] floats = new float[pieces.length];
71 | for (int i = 0; i < pieces.length; i++) {
72 | floats[i] = Float.parseFloat(pieces[i].trim());
73 | }
74 | return floats;
75 | }
76 |
77 | public static long[] parseLongsFromString(String string, String delimiter) {
78 | String[] pieces = string.trim().toLowerCase().split(delimiter);
79 | long[] longs = new long[pieces.length];
80 | for (int i = 0; i < pieces.length; i++) {
81 | longs[i] = Long.parseLong(pieces[i].trim());
82 | }
83 | return longs;
84 | }
85 |
86 | public static String getSDCardDirectory() {
87 | return Environment.getExternalStorageDirectory().getAbsolutePath();
88 | }
89 |
90 | public static boolean isSupportedNPU() {
91 | String hardware = android.os.Build.HARDWARE;
92 | return hardware.equalsIgnoreCase("kirin810") || hardware.equalsIgnoreCase("kirin990");
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/services.dart';
4 | import 'package:camera/camera.dart';
5 | import 'package:realtimeod/object_detector.dart';
6 |
7 | List cameras;
8 |
9 | Future main() async {
10 | await WidgetsFlutterBinding.ensureInitialized();
11 | try {
12 | cameras = await availableCameras();
13 | } on CameraException catch (e) {
14 | print('Error: $e.code\nError Message: $e.message');
15 | }
16 | await _loadModel();
17 | runApp(ObjectDetectApp());
18 | }
19 |
20 | Future _loadModel() async {
21 | try {
22 | const platform = const MethodChannel('paddlelite');
23 | final String result = await platform.invokeMethod('loadModel');
24 | print(result);
25 | } on PlatformException catch (e) {
26 | print('Error: $e.code\nError Message: $e.message');
27 | }
28 | }
29 |
30 | class ObjectDetectApp extends StatefulWidget {
31 | @override
32 | _ObjectDetectAppState createState() => new _ObjectDetectAppState();
33 | }
34 |
35 | class _ObjectDetectAppState extends State
36 | with WidgetsBindingObserver {
37 | final ObjectDetector detector = ObjectDetector.instance;
38 | CameraController controller;
39 | GlobalKey _keyCameraPreview = GlobalKey();
40 | @override
41 | void initState() {
42 | super.initState();
43 | controller = CameraController(cameras[0], ResolutionPreset.medium);
44 | controller.initialize().then((_) {
45 | if (!mounted) {
46 | return;
47 | }
48 | setState(() {});
49 | detector.addListener(() {
50 | setState(() {});
51 | });
52 | detector.init(controller);
53 | });
54 | }
55 |
56 | @override
57 | void didChangeAppLifecycleState(AppLifecycleState state) {
58 | controller?.dispose();
59 | detector.dispose();
60 | super.dispose();
61 | }
62 |
63 | @override
64 | void dispose() {
65 | controller?.dispose();
66 | detector.dispose();
67 | super.dispose();
68 | }
69 |
70 | @override
71 | Widget build(BuildContext context) {
72 | return new MaterialApp(
73 | theme: ThemeData(primarySwatch: Colors.blueGrey),
74 | home: Scaffold(
75 | appBar: AppBar(
76 | title: Center(
77 | child: Text('Object Detector'),
78 | )),
79 | body: new Center(
80 | child: Column(children: [
81 | _cameraPreviewWidget(detector.value),
82 | ]),
83 | )));
84 | }
85 |
86 | Widget _cameraPreviewWidget(List value) {
87 | if (controller == null || !controller.value.isInitialized) {
88 | return const Text(
89 | 'Loading Camera',
90 | style: TextStyle(
91 | color: Colors.white,
92 | fontSize: 24.0,
93 | fontWeight: FontWeight.w900,
94 | ),
95 | );
96 | } else {
97 |
98 | return new Stack(alignment: FractionalOffset.center, children: [
99 | new AspectRatio(
100 | key: _keyCameraPreview,
101 | aspectRatio: controller.value.aspectRatio,
102 | child: new CameraPreview(controller)),
103 | new Positioned.fill(
104 | child: new CustomPaint(
105 | painter: new DrawObjects(value, _keyCameraPreview),
106 | )),
107 | ]);
108 | }
109 |
110 | }
111 | }
112 |
113 | class DrawObjects extends CustomPainter {
114 | List values;
115 | GlobalKey> keyCameraPreview;
116 | DrawObjects(this.values, this.keyCameraPreview);
117 |
118 | @override
119 | void paint(Canvas canvas, Size size) {
120 | print(values);
121 | if (values==null && values.isNotEmpty && values[0] == null) return;
122 | final RenderBox renderPreview =
123 | keyCameraPreview.currentContext.findRenderObject();
124 | final sizeRed = renderPreview.size;
125 |
126 | var ratioW = sizeRed.width / 608;
127 | var ratioH = sizeRed.height / 608;
128 | for (var value in values) {
129 | var index = value[0];
130 | Paint paint = new Paint();
131 | paint.color = Colors.red;
132 | paint.strokeWidth = 2;
133 | double x1 = value[2] * ratioW,
134 | x2 = value[4] * ratioW,
135 | y1 = value[3] * ratioH,
136 | y2 = value[5] * ratioH;
137 | TextSpan span = new TextSpan(
138 | style: new TextStyle(
139 | color: Colors.black,
140 | background: paint,
141 | fontWeight: FontWeight.bold,
142 | fontSize: 14),
143 | text: " " + value[1] + " " + (double.parse(value[6])*100).toStringAsFixed(2) +" % ");
144 | TextPainter tp = new TextPainter(text: span, textAlign: TextAlign.left,
145 | textDirection: TextDirection.ltr);
146 | tp.layout();
147 | tp.paint(canvas, new Offset(x1 + 1, y1 + 1));
148 | canvas.drawLine(new Offset(x1, y1), new Offset(x2, y1), paint);
149 | canvas.drawLine(new Offset(x1, y1), new Offset(x1, y2), paint);
150 | canvas.drawLine(new Offset(x1, y2), new Offset(x2, y2), paint);
151 | canvas.drawLine(new Offset(x2, y1), new Offset(x2, y2), paint);
152 | }
153 |
154 | }
155 |
156 | @override
157 | bool shouldRepaint(DrawObjects oldDelegate) {
158 | return true;
159 | }
160 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.gitignore.io/api/java,dart,linux,android,flutter,visualstudiocode
3 | # Edit at https://www.gitignore.io/?templates=java,dart,linux,android,flutter,visualstudiocode
4 |
5 | ### Android ###
6 | # Built application files
7 | *.apk
8 | *.ap_
9 | *.aab
10 |
11 | # Files for the ART/Dalvik VM
12 | *.dex
13 |
14 | # Java class files
15 | *.class
16 |
17 | # Generated files
18 | bin/
19 | gen/
20 | out/
21 | release/
22 |
23 | # Gradle files
24 | .gradle/
25 | build/
26 |
27 | # Local configuration file (sdk path, etc)
28 | local.properties
29 |
30 | # Proguard folder generated by Eclipse
31 | proguard/
32 |
33 | # Log Files
34 | *.log
35 |
36 | # Android Studio Navigation editor temp files
37 | .navigation/
38 |
39 | # Android Studio captures folder
40 | captures/
41 |
42 | # IntelliJ
43 | *.iml
44 | .idea/workspace.xml
45 | .idea/tasks.xml
46 | .idea/gradle.xml
47 | .idea/assetWizardSettings.xml
48 | .idea/dictionaries
49 | .idea/libraries
50 | # Android Studio 3 in .gitignore file.
51 | .idea/caches
52 | .idea/modules.xml
53 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you
54 | .idea/navEditor.xml
55 |
56 | # Keystore files
57 | # Uncomment the following lines if you do not want to check your keystore files in.
58 | #*.jks
59 | #*.keystore
60 |
61 | # External native build folder generated in Android Studio 2.2 and later
62 | .externalNativeBuild
63 |
64 | # Google Services (e.g. APIs or Firebase)
65 | # google-services.json
66 |
67 | # Freeline
68 | freeline.py
69 | freeline/
70 | freeline_project_description.json
71 |
72 | # fastlane
73 | fastlane/report.xml
74 | fastlane/Preview.html
75 | fastlane/screenshots
76 | fastlane/test_output
77 | fastlane/readme.md
78 |
79 | # Version control
80 | vcs.xml
81 |
82 | # lint
83 | lint/intermediates/
84 | lint/generated/
85 | lint/outputs/
86 | lint/tmp/
87 | # lint/reports/
88 |
89 | ### Android Patch ###
90 | gen-external-apklibs
91 | output.json
92 |
93 | # Replacement of .externalNativeBuild directories introduced
94 | # with Android Studio 3.5.
95 | .cxx/
96 |
97 | ### Dart ###
98 | # See https://www.dartlang.org/guides/libraries/private-files
99 |
100 | # Files and directories created by pub
101 | .dart_tool/
102 | .packages
103 | # If you're building an application, you may want to check-in your pubspec.lock
104 | pubspec.lock
105 |
106 | # Directory created by dartdoc
107 | # If you don't generate documentation locally you can remove this line.
108 | doc/api/
109 |
110 | # Avoid committing generated Javascript files:
111 | *.dart.js
112 | *.info.json # Produced by the --dump-info flag.
113 | *.js # When generated by dart2js. Don't specify *.js if your
114 | # project includes source files written in JavaScript.
115 | *.js_
116 | *.js.deps
117 | *.js.map
118 |
119 | ### Flutter ###
120 | # Flutter/Dart/Pub related
121 | **/doc/api/
122 | .flutter-plugins
123 | .flutter-plugins-dependencies
124 | .pub-cache/
125 | .pub/
126 |
127 | # Android related
128 | **/android/**/gradle-wrapper.jar
129 | **/android/.gradle
130 | **/android/captures/
131 | **/android/gradlew
132 | **/android/gradlew.bat
133 | **/android/local.properties
134 | **/android/**/GeneratedPluginRegistrant.java
135 |
136 | # iOS/XCode related
137 | **/ios/**/*.mode1v3
138 | **/ios/**/*.mode2v3
139 | **/ios/**/*.moved-aside
140 | **/ios/**/*.pbxuser
141 | **/ios/**/*.perspectivev3
142 | **/ios/**/*sync/
143 | **/ios/**/.sconsign.dblite
144 | **/ios/**/.tags*
145 | **/ios/**/.vagrant/
146 | **/ios/**/DerivedData/
147 | **/ios/**/Icon?
148 | **/ios/**/Pods/
149 | **/ios/**/.symlinks/
150 | **/ios/**/profile
151 | **/ios/**/xcuserdata
152 | **/ios/.generated/
153 | **/ios/Flutter/App.framework
154 | **/ios/Flutter/Flutter.framework
155 | **/ios/Flutter/Generated.xcconfig
156 | **/ios/Flutter/app.flx
157 | **/ios/Flutter/app.zip
158 | **/ios/Flutter/flutter_assets/
159 | **/ios/ServiceDefinitions.json
160 | **/ios/Runner/GeneratedPluginRegistrant.*
161 |
162 | # Exceptions to above rules.
163 | !**/ios/**/default.mode1v3
164 | !**/ios/**/default.mode2v3
165 | !**/ios/**/default.pbxuser
166 | !**/ios/**/default.perspectivev3
167 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
168 |
169 | ### Java ###
170 | # Compiled class file
171 |
172 | # Log file
173 |
174 | # BlueJ files
175 | *.ctxt
176 |
177 | # Mobile Tools for Java (J2ME)
178 | .mtj.tmp/
179 |
180 | # Package Files #
181 | *.jar
182 | *.war
183 | *.nar
184 | *.ear
185 | *.zip
186 | *.tar.gz
187 | *.rar
188 |
189 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
190 | hs_err_pid*
191 |
192 | ### Linux ###
193 | *~
194 |
195 | # temporary files which can be created if a process still has a handle open of a deleted file
196 | .fuse_hidden*
197 |
198 | # KDE directory preferences
199 | .directory
200 |
201 | # Linux trash folder which might appear on any partition or disk
202 | .Trash-*
203 |
204 | # .nfs files are created when an open file is removed but is still being accessed
205 | .nfs*
206 |
207 | ### VisualStudioCode ###
208 | .vscode/*
209 | !.vscode/settings.json
210 | !.vscode/tasks.json
211 | !.vscode/launch.json
212 | !.vscode/extensions.json
213 |
214 | ### VisualStudioCode Patch ###
215 | # Ignore all local history of files
216 | .history
217 |
218 | # End of https://www.gitignore.io/api/java,dart,linux,android,flutter,visualstudiocode
219 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/realtimeod/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.realtimeod;
2 |
3 |
4 | import androidx.annotation.NonNull;
5 | import io.flutter.embedding.android.FlutterActivity;
6 | import io.flutter.embedding.engine.FlutterEngine;
7 | import io.flutter.plugin.common.MethodChannel;
8 |
9 | import android.content.res.AssetManager;
10 | import android.os.Handler;
11 | import android.os.Looper;
12 | import android.renderscript.RenderScript;
13 | import android.os.Bundle;
14 | import android.graphics.Bitmap;
15 | import android.graphics.BitmapFactory;
16 | import android.content.Context;
17 | import android.util.Log;
18 |
19 | import io.flutter.plugin.common.MethodCall;
20 | import io.flutter.plugin.common.MethodChannel;
21 | import io.flutter.plugins.GeneratedPluginRegistrant;
22 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
23 | import io.flutter.plugin.common.MethodChannel.Result;
24 | import io.flutter.plugin.common.PluginRegistry.Registrar;
25 | import java.util.List;
26 | import java.util.Map;
27 | import java.util.HashMap;
28 |
29 | public class MainActivity extends FlutterActivity {
30 | private static final String CHANNEL = "paddlelite";
31 | private static boolean modalLoaded = false;
32 | protected static Predictor predictor = new Predictor();
33 | private RenderScript rs;
34 |
35 | // Model settings of object detection
36 | protected String modelPath = "models/fruit";
37 | protected String labelPath = "labels/fruit_label_list";
38 | protected int cpuThreadNum = 8;
39 | protected String cpuPowerMode = "LITE_POWER_FULL";
40 | protected String inputColorFormat = "RGB";
41 | protected long[] inputShape = new long[]{1, 3, 608, 608};
42 | protected float[] inputMean = new float[]{0.485f, 0.456f, 0.406f};
43 | protected float[] inputStd = new float[]{0.229f, 0.224f, 0.225f};
44 | protected float scoreThreshold = 0.5f;
45 |
46 | @Override
47 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
48 | rs = RenderScript.create(this);
49 | super.configureFlutterEngine(flutterEngine);
50 | new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL)
51 | .setMethodCallHandler(
52 | (call, result) -> {
53 | if (call.method.equals("loadModel")) {
54 | loadModel(result);
55 | } else if(call.method.equals("detectObject")){
56 | HashMap image = call.arguments();
57 | detectObject(image,result);
58 | } else {
59 | result.notImplemented();
60 | }
61 | }
62 | );
63 | }
64 |
65 | protected void loadModel(final Result result) {
66 | new Thread(new Runnable() {
67 | public void run() {
68 | try {
69 | predictor.init(MainActivity.this, modelPath, labelPath, cpuThreadNum,
70 | cpuPowerMode,
71 | inputColorFormat,
72 | inputShape, inputMean,
73 | inputStd, scoreThreshold,rs);
74 | modalLoaded=true;
75 | MethodResultWrapper resultWrapper = new MethodResultWrapper(result);
76 | resultWrapper.success("Modal Loaded Sucessfully");
77 | } catch (Exception e) {
78 | e.printStackTrace();
79 | MethodResultWrapper resultWrapper = new MethodResultWrapper(result);
80 | resultWrapper.error("Modal failed to loaded", e.getMessage(), null);
81 | }
82 | }
83 | }).start();
84 | }
85 |
86 | public void detectObject(final HashMap image, final Result result) {
87 | new Thread(new Runnable() {
88 | public void run() {
89 | MethodResultWrapper resultWrapper = new MethodResultWrapper(result);
90 | if (!modalLoaded)
91 | resultWrapper.error("Model is not loaded", null, null);
92 |
93 | try {
94 | predictor.setInputImage(image);
95 | List