{"id":13645394,"url":"https://github.com/hiennguyen92/flutter_realtime_object_detection","last_synced_at":"2025-10-25T05:21:25.029Z","repository":{"id":54335855,"uuid":"387261400","full_name":"hiennguyen92/flutter_realtime_object_detection","owner":"hiennguyen92","description":"Flutter App real-time object detection with Tensorflow Lite","archived":false,"fork":false,"pushed_at":"2023-09-07T01:27:08.000Z","size":67461,"stargazers_count":57,"open_issues_count":2,"forks_count":23,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-02T01:25:21.762Z","etag":null,"topics":["android","flutter","ios","mobilenet","posenet","real-time-object-detection","ssd-mobilenet","tensorflow-lite","yolo"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hiennguyen92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-18T20:15:12.000Z","updated_at":"2024-07-23T20:10:44.000Z","dependencies_parsed_at":"2024-01-14T12:29:03.761Z","dependency_job_id":null,"html_url":"https://github.com/hiennguyen92/flutter_realtime_object_detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiennguyen92%2Fflutter_realtime_object_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiennguyen92%2Fflutter_realtime_object_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiennguyen92%2Fflutter_realtime_object_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiennguyen92%2Fflutter_realtime_object_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiennguyen92","download_url":"https://codeload.github.com/hiennguyen92/flutter_realtime_object_detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223868120,"owners_count":17217032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flutter","ios","mobilenet","posenet","real-time-object-detection","ssd-mobilenet","tensorflow-lite","yolo"],"created_at":"2024-08-02T01:02:34.442Z","updated_at":"2025-10-25T05:21:25.024Z","avatar_url":"https://github.com/hiennguyen92.png","language":"Dart","funding_links":[],"categories":["Object Detection Applications"],"sub_categories":[],"readme":"# Flutter realtime object detection with Tensorflow Lite\n\nFlutter realtime object detection with Tensorflow Lite\n\n## Info\n\nAn app made with Flutter and TensorFlow Lite for realtime object detection using model YOLO, SSD, MobileNet, PoseNet.\n\n\n\n## :star: Features\n\n* Realtime object detection on the live camera\n* Using Model: YOLOv2-Tiny, SSDMobileNet, MobileNet, PoseNet\n* Save image has been detected\n* MVVM architecture\n\n  \u003cbr\u003e\n\n## 🚀\u0026nbsp; Installation\n\n1. Install Packages\n```\ncamera: get the streaming image buffers\nhttps://pub.dev/packages/camera\n```\n  * \u003ca href='https://pub.dev/packages/camera'\u003ehttps://pub.dev/packages/camera\u003c/a\u003e\n```\ntflite: run model TensorFlow Lite\nhttps://pub.dev/packages/tflite\n```\n  * \u003ca href='https://pub.dev/packages/tflite'\u003ehttps://pub.dev/packages/tflite\u003c/a\u003e\n```\nprovider: state management\nhttps://pub.dev/packages/provider\n```\n  * \u003ca href='https://pub.dev/packages/provider'\u003ehttps://pub.dev/packages/provider\u003c/a\u003e\n\n  \u003cbr\u003e\n2. Configure Project\n\n* Android\n```\nandroid/app/build.gradle\n\nandroid {\n    ...\n    aaptOptions {\n        noCompress 'tflite'\n        noCompress 'lite'\n    }\n    ...\n}\n\n\nminSdkVersion 21\n```\n  \u003cbr\u003e\n3. Load model\n\n```\nloadModel() async {\n    Tflite.close();\n    await Tflite.loadModel(\n        model: \"assets/models/yolov2_tiny.tflite\",  \n        //ssd_mobilenet.tflite, mobilenet_v1.tflite, posenet_mv1_checkpoints.tflite\n        labels: \"assets/models/yolov2_tiny.txt\",    \n        //ssd_mobilenet.txt, mobilenet_v1.txt\n        //numThreads: 1, // defaults to 1\n        //isAsset: true, // defaults: true, set to false to load resources outside assets\n        //useGpuDelegate: false // defaults: false, use GPU delegate\n    );\n  }\n```\n  \u003cbr\u003e\n4. Run model\n\nFor Realtime Camera\n```\n  //YOLOv2-Tiny\n  Future\u003cList\u003cdynamic\u003e?\u003e runModelOnFrame(CameraImage image) async {\n     var recognitions = await Tflite.detectObjectOnFrame(\n          bytesList: image.planes.map((plane) {\n            return plane.bytes;\n          }).toList(),\n          model: \"YOLO\",\n          imageHeight: image.height,\n          imageWidth: image.width,\n          imageMean: 0,                 // defaults to 127.5\n          imageStd: 255.0,              // defaults to 127.5\n          threshold: 0.2,               // defaults to 0.1\n          numResultsPerClass: 1,\n        );   \n    return recognitions;\n  }\n\n  //SSDMobileNet\n  Future\u003cList\u003cdynamic\u003e?\u003e runModelOnFrame(CameraImage image) async {\n     var recognitions = await Tflite.detectObjectOnFrame(\n          bytesList: image.planes.map((plane) {\n            return plane.bytes;\n          }).toList(),\n          model: \"SSDMobileNet\",\n          imageHeight: image.height,\n          imageWidth: image.width,\n          imageMean: 127.5,\n          imageStd: 127.5,\n          threshold: 0.4,\n          numResultsPerClass: 1,\n        );   \n    return recognitions;\n  }\n\n  //MobileNet\n  Future\u003cList\u003cdynamic\u003e?\u003e runModelOnFrame(CameraImage image) async {\n     var recognitions = await Tflite.runModelOnFrame(\n          bytesList: image.planes.map((plane) {\n            return plane.bytes;\n          }).toList(),\n          imageHeight: image.height,\n          imageWidth: image.width,\n          numResults: 5\n        );   \n    return recognitions;\n  }\n\n  //PoseNet\n  Future\u003cList\u003cdynamic\u003e?\u003e runModelOnFrame(CameraImage image) async {\n     var recognitions = await Tflite.runPoseNetOnFrame(\n          bytesList: image.planes.map((plane) {\n            return plane.bytes;\n          }).toList(),\n          imageHeight: image.height,\n          imageWidth: image.width,\n          numResults: 5\n        );   \n    return recognitions;\n  }\n```\nFor Image\n```\n  Future\u003cList\u003cdynamic\u003e?\u003e runModelOnImage(File image) async {\n    var recognitions = await Tflite.detectObjectOnImage(\n        path: image.path,\n        model: \"YOLO\",\n        threshold: 0.3,\n        imageMean: 0.0,\n        imageStd: 127.5,\n        numResultsPerClass: 1\n    );\n    return recognitions;\n  }\n```\n```\nOutput format:\n\nYOLO,SSDMobileNet\n  [{\n    detectedClass: \"dog\",\n    confidenceInClass: 0.989,\n    rect: {\n        x: 0.0,\n        y: 0.0,\n        w: 100.0,\n        h: 100.0\n    }\n  },...]\n\nMobileNet\n[{\n    index: 0,\n    label: \"WithMask\",\n    confidence: 0.989\n  },...]\n\nPoseNet\n[{\n    score: 0.5,\n    keypoints: {\n        0: {\n            x: 0.2,\n            y: 0.12,\n            part: nose,\n            score: 0.803\n        },\n        1: {\n            x: 0.2,\n            y: 0.1,\n            part: leftEye,\n            score: 0.8666\n        },\n        ...\n    }\n  },...]\n\n```\n  \u003cbr\u003e\n5. Issue\n\n```\n* IOS\nDowngrading TensorFlowLiteC to 2.2.0\n\nDowngrade your TensorFlowLiteC in /ios/Podfile.lock to 2.2.0\nrun pod install in your /ios folder\n```\n  \u003cbr\u003e\n6. Source code\n\n```\nplease checkout repo github\nhttps://github.com/hiennguyen92/flutter_realtime_object_detection\n```\n  * \u003ca href='https://github.com/hiennguyen92/flutter_realtime_object_detection'\u003ehttps://github.com/hiennguyen92/flutter_realtime_object_detection\u003c/a\u003e\n## :bulb: Demo\n\n1. Demo Illustration: https://www.youtube.com/watch?v=__i7PRmz5kY\u0026ab_channel=HienNguyen\n2. Image\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/hiennguyen92/flutter_realtime_object_detection/main/images/image1.jpg\" width=\"250\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/hiennguyen92/flutter_realtime_object_detection/main/images/image2.jpg\" width=\"250\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/hiennguyen92/flutter_realtime_object_detection/main/images/image3.jpg\" width=\"250\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/hiennguyen92/flutter_realtime_object_detection/main/images/image4.jpg\" width=\"250\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/hiennguyen92/flutter_realtime_object_detection/main/images/image5.jpg\" width=\"250\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/hiennguyen92/flutter_realtime_object_detection/main/images/image6.jpg\" width=\"250\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n \u003c/table\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiennguyen92%2Fflutter_realtime_object_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiennguyen92%2Fflutter_realtime_object_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiennguyen92%2Fflutter_realtime_object_detection/lists"}