{"id":23071262,"url":"https://github.com/kashifmin/flutter_tensorflow_lite","last_synced_at":"2025-07-16T11:13:59.456Z","repository":{"id":56841178,"uuid":"130695920","full_name":"kashifmin/flutter_tensorflow_lite","owner":"kashifmin","description":"A Flutter plugin to access TensorFlow Lite apis.","archived":false,"fork":false,"pushed_at":"2018-07-28T10:32:11.000Z","size":8283,"stargazers_count":74,"open_issues_count":2,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T16:39:26.102Z","etag":null,"topics":["android","dart","dartlang","flutter","flutter-plugin","ios","kotlin","tensorflow"],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/tensorflow_lite","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kashifmin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-23T12:50:51.000Z","updated_at":"2024-05-31T01:10:00.000Z","dependencies_parsed_at":"2022-08-29T12:51:03.697Z","dependency_job_id":null,"html_url":"https://github.com/kashifmin/flutter_tensorflow_lite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kashifmin/flutter_tensorflow_lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kashifmin%2Fflutter_tensorflow_lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kashifmin%2Fflutter_tensorflow_lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kashifmin%2Fflutter_tensorflow_lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kashifmin%2Fflutter_tensorflow_lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kashifmin","download_url":"https://codeload.github.com/kashifmin/flutter_tensorflow_lite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kashifmin%2Fflutter_tensorflow_lite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265505486,"owners_count":23778518,"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","dart","dartlang","flutter","flutter-plugin","ios","kotlin","tensorflow"],"created_at":"2024-12-16T07:12:14.168Z","updated_at":"2025-07-16T11:13:59.415Z","avatar_url":"https://github.com/kashifmin.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tensorflow_lite\n\n[![pub package](https://img.shields.io/pub/v/tensorflow_lite.svg)](https://pub.dartlang.org/packages/tensorflow_lite)\n\n\nA Flutter plugin to access TensorFlow Lite apis.\n[TensorFlow Lite](https://www.tensorflow.org/mobile/tflite/) is TensorFlow’s lightweight solution for mobile and embedded devices.\nWith TensorFlow Lite you can deploy machine learning models on phones in your Android/iOS app.\n\n## Usage\nAdd `tensorflow_lite` to your [pubspec.yaml](https://flutter.io/platform-plugins/)\n\nCopy your models to an asset dir like `assets/mobilenet_quant_v1_224.tflite`\nAnd add it to your pubspec.yaml\n\n```yaml\n   assets:\n     - assets/mobilenet_quant_v1_224.tflite\n```\n\nImport tensorflow_lite in your app\n\n```dart\nimport 'package:tensorflow_lite/tensorflow_lite.dart';\n```\n\nCreate a new Interpreter instance based on your tflite model file\n\n```dart\nInterpreter model = await Interpreter.createInstance(modelFilePath: modelPath);\n```\n\nPass some bytes to the model to get the output\n\n```dart\ndynamic result = await _interpreter.run(imageToByteList(image), new Uint8List(_labelList.length));\n```\n\n# Image Classification example\n\n`tensorflow_lite` also includes a wrapper for image classification models which can be easily loaded\nwithout much of boilerplate code.\n\n```dart\nFuture\u003cNull\u003e loadRecognitions() async {\n    var classifier = await TFLiteImageClassifier.createInstance(\n      assets: rootBundle,\n      modelPath: \"assets/mobilenet_quant_v1_224.tflite\",\n      labelPath: \"assets/labels.txt\",\n      inputSize: 224,\n    );\n    print('Classifier ready');\n    var imageBytes = (await rootBundle.load(\"assets/cat500.png\")).buffer;\n    img.Image image = img.decodePng(imageBytes.asUint8List());\n    image = img.copyResize(image, 224, 224);\n    _recognitions = await classifier.recognizeImage(image);\n    setState(() {});\n\n    await classifier.close();\n  }\n```\n\nPlease check the example for full usage.\n\n## Note\n- Works only on Android\n- Tested only on image classification\n\n## Contributing\nI am new to Flutter and I haven't worked on iOS yet.\nSo if you are an iOS developer, i'd be glad to receive some contribution.\nJust send a PR or open up an issue!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkashifmin%2Fflutter_tensorflow_lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkashifmin%2Fflutter_tensorflow_lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkashifmin%2Fflutter_tensorflow_lite/lists"}