-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit for the new repository. Direct copy from am15h/tflite_…
…flutter_plugin on April 26, 2023
- Loading branch information
0 parents
commit af6da39
Showing
230 changed files
with
20,568 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.DS_Store | ||
.atom/ | ||
.idea/ | ||
.vscode/* | ||
.melos_tool/* | ||
!.vscode/tasks.json | ||
!.vscode/settings.json | ||
|
||
.packages | ||
.pub/ | ||
.dart_tool/ | ||
pubspec.lock | ||
pubspec_overrides.yaml | ||
flutter_export_environment.sh | ||
|
||
examples/all_plugins/pubspec.yaml | ||
|
||
Podfile.lock | ||
Pods/ | ||
.symlinks/ | ||
**/Flutter/ephemeral/ | ||
**/Flutter/Flutter.podspec | ||
**/Flutter/App.framework/ | ||
**/Flutter/Flutter.framework/ | ||
**/Flutter/Generated.xcconfig | ||
**/Flutter/flutter_assets/ | ||
ServiceDefinitions.json | ||
xcuserdata/ | ||
|
||
local.properties | ||
keystore.properties | ||
.gradle/ | ||
gradlew | ||
gradlew.bat | ||
gradle-wrapper.jar | ||
*.iml | ||
|
||
GeneratedPluginRegistrant.h | ||
GeneratedPluginRegistrant.m | ||
GeneratedPluginRegistrant.java | ||
GeneratedPluginRegistrant.swift | ||
generated_plugin_registrant.dart | ||
|
||
build/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
|
||
.project | ||
.classpath | ||
.settings | ||
.last_build_id | ||
|
||
# Docs | ||
|
||
# Dependencies | ||
node_modules | ||
|
||
# Production | ||
website/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Below is a list of people and organizations that have contributed | ||
# to the Flutter project. Names should be added to the list like so: | ||
# | ||
# Name/Organization <email address> | ||
|
||
# *HUGE* thank you to Amish Garg, original author of the flutter-tflite | ||
# project and Google Summer of Code participant. | ||
# Original repo: https://github.com/am15h/tflite_flutter_plugin | ||
|
||
Google Inc. | ||
Paul Ruiz <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## 0.9.0 (Jun 28, 2021) | ||
* Support for Windows, Mac and Linux platforms. | ||
* Improved gpu delegate support and bug fixes. | ||
* Support for CoreML and XnnPack delegates. | ||
|
||
## 0.8.0 (Apr 21, 2021) | ||
* Null-safety major bug fix in tensor.dart | ||
* Expose byte-object interconversion APIs | ||
|
||
## 0.7.0 (Apr 21, 2021) | ||
* Stable null-safety support | ||
|
||
## 0.6.0 (Feb 26, 2021) | ||
* Update to Dart 2.12 and package:ffi 1.0.0. | ||
|
||
## 0.5.0 (Jul 17, 2020) | ||
* Expose interpreter's address | ||
* Create interpreter by address. | ||
|
||
## 0.4.2 (Jul 6, 2020) | ||
* Optimize getTensors and getTensor by Index | ||
* Update readme | ||
|
||
## 0.4.1 (Jun 23, 2020) | ||
* Bug fix, output values copy to bytebuffer | ||
|
||
## 0.4.0 (Jun 18, 2020) | ||
* run supports UintList8 and ByteBuffer objects | ||
* Bug fix, resize input tensor | ||
* Improved efficiency | ||
|
||
## 0.3.0 | ||
* New features | ||
* multi-dimensional reshape with type | ||
* Bug fixes | ||
* extension flatten on List fixed. | ||
* error on passing not dynamic type list to interpreter output fixed | ||
|
||
## 0.2.0 | ||
* Direct conversion support for more TfLiteTypes | ||
* int16, float16, int8, int64 | ||
* Pre-built tf 2.2.0 stable binaries | ||
|
||
## 0.1.3 | ||
* update usage instructions | ||
|
||
## 0.1.2 | ||
* fixed analysis issues to improve score | ||
|
||
## 0.1.1 | ||
* fixed warnings | ||
* longer package description | ||
|
||
## 0.1.0 | ||
|
||
* TfLite dart API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# TensorFlow Code of Conduct | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Conduct which could reasonably be considered inappropriate for the forum in which it occurs. | ||
|
||
All TensorFlow forums and spaces are meant for professional interactions, and any behavior which could reasonably be considered inappropriate in a professional setting is unacceptable. | ||
|
||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
|
||
## Scope | ||
|
||
This Code of Conduct applies to all content on tensorflow.org, TensorFlow’s GitHub organization, or any other official TensorFlow web presence allowing for community interactions, as well as at all official TensorFlow events, whether offline or online. | ||
|
||
The Code of Conduct also applies within project spaces and in public spaces whenever an individual is representing TensorFlow or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed or de facto representative at an online or offline event. | ||
|
||
|
||
## Conflict Resolution | ||
|
||
Conflicts in an open source project can take many forms, from someone having a bad day and using harsh and hurtful language in the issue queue, to more serious instances such as sexist/racist statements or threats of violence, and everything in between. | ||
|
||
If the behavior is threatening or harassing, or for other reasons requires immediate escalation, please see below. | ||
|
||
However, for the vast majority of issues, we aim to empower individuals to first resolve conflicts themselves, asking for help when needed, and only after that fails to escalate further. This approach gives people more control over the outcome of their dispute. | ||
|
||
If you are experiencing or witnessing conflict, we ask you to use the following escalation strategy to address the conflict: | ||
|
||
1. Address the perceived conflict directly with those involved, preferably in a real-time medium. | ||
2. If this fails, get a third party (e.g. a mutual friend, and/or someone with background on the issue, but not involved in conflict) to intercede. | ||
3. If you are still unable to resolve the conflict, and you believe it rises to harassment or another code of conduct violation, report it. | ||
|
||
|
||
## Reporting Violations | ||
|
||
Violations of the Code of Conduct can be reported to TensorFlow’s Project Stewards, Thea Lamkin ([email protected]), Paul Ruiz ([email protected]), and Joana Carrasqueira ([email protected]). The Project Steward will determine whether the Code of Conduct was violated, and will issue an appropriate sanction, possibly including a written warning or expulsion from the project, project sponsored spaces, or project forums. We ask that you make a good-faith effort to resolve your conflict via the conflict resolution policy before submitting a report. | ||
|
||
Violations of the Code of Conduct can occur in any setting, even those unrelated to the project. We will only consider complaints about conduct that has occurred within one year of the report. | ||
|
||
|
||
## Enforcement | ||
|
||
If the Project Stewards receive a report alleging a violation of the Code of Conduct, the Project Stewards will notify the accused of the report, and provide them an opportunity to discuss the report before a sanction is issued. The Project Stewards will do their utmost to keep the reporter anonymous. If the act is ongoing (such as someone engaging in harassment), or involves a threat to anyone's safety (e.g. threats of violence), the Project Stewards may issue sanctions without notice. | ||
|
||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://contributor-covenant.org/version/1/4, and includes some aspects of the Geek Feminism Code of Conduct and the Drupal Code of Conduct. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
TODO: Needs to be updated specifically for the flutter-tflite repo. | ||
|
||
|
||
# Contributing guidelines | ||
|
||
## How to become a contributor and submit your own code | ||
|
||
### Contributor License Agreements | ||
|
||
We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles. | ||
|
||
Please fill out either the individual or corporate Contributor License Agreement (CLA). | ||
|
||
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://code.google.com/legal/individual-cla-v1.0.html). | ||
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://code.google.com/legal/corporate-cla-v1.0.html). | ||
|
||
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests. | ||
|
||
***NOTE***: Only original source code from you and other people that have signed the CLA can be accepted into the main repository. | ||
|
||
### Contributing code | ||
|
||
If you have improvements to TensorFlow, send us your pull requests! For those | ||
just getting started, Github has a [howto](https://help.github.com/articles/using-pull-requests/). | ||
|
||
TensorFlow team members will be assigned to review your pull requests. Once the pull requests are approved and pass continuous integration checks, we will merge the pull requests. | ||
For some pull requests, we will apply the patch for each pull request to our internal version control system first, and export the change out as a new commit later, at which point the original pull request will be closed. The commits in the pull request will be squashed into a single commit with the pull request creator as the author. These pull requests will be labeled as pending merge internally. | ||
|
||
If you want to contribute but you're not sure where to start, take a look at the | ||
[issues with the "contributions welcome" label](https://github.com/tensorflow/flutter-tflite/labels/stat%3Acontributions%20welcome). | ||
These are issues that we believe are particularly well suited for outside | ||
contributions, often because we probably won't get to them right now. If you | ||
decide to start on an issue, leave a comment so that other people know that | ||
you're working on it. If you want to help out, but not alone, use the issue | ||
comment thread to coordinate. | ||
|
||
### Contribution guidelines and standards | ||
|
||
Before sending your pull request for | ||
[review](https://github.com/tensorflow/flutter-tflite/pulls), | ||
make sure your changes are consistent with the guidelines and follow the | ||
TensorFlow coding style. | ||
|
||
#### General guidelines and philosophy for contribution | ||
|
||
* Include unit tests when you contribute new features, as they help to | ||
a) prove that your code works correctly, and b) guard against future breaking | ||
changes to lower the maintenance cost. | ||
* Bug fixes also generally require unit tests, because the presence of bugs | ||
usually indicates insufficient test coverage. | ||
* When you contribute a new feature to TensorFlow, the maintenance burden is (by | ||
default) transferred to the TensorFlow team. This means that benefit of the | ||
contribution must be compared against the cost of maintaining the feature. | ||
|
||
#### License | ||
|
||
Include a license at the top of new files. | ||
|
||
* [C/C++ license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op.cc#L1) | ||
* [Python license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/nn.py#L1) | ||
* [Java license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/Graph.java#L1) | ||
* [Go license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/go/operation.go#L1) | ||
* [Bash license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/ci_build/ci_sanity.sh#L2) | ||
* [HTML license example](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/components/tf_backend/tf-backend.html#L2) | ||
* [JavaScript/TypeScript license example](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/components/tf_backend/backend.ts#L1) | ||
|
||
Bazel BUILD files also need to include a license section, e.g., | ||
[BUILD example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/BUILD#L61). | ||
|
||
#### C++ coding style | ||
|
||
Changes to TensorFlow C++ code should conform to | ||
[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). | ||
|
||
Use `clang-tidy` to check your C/C++ changes. To install clang-tidy on ubuntu:16.04, do: | ||
|
||
```bash | ||
apt-get install -y clang-tidy | ||
``` | ||
|
||
You can check a C/C++ file by doing: | ||
|
||
|
||
```bash | ||
clang-format <my_cc_file> --style=google > /tmp/my_cc_file.cc | ||
diff <my_cc_file> /tmp/my_cc_file.cc | ||
``` | ||
|
||
#### Python coding style | ||
|
||
Changes to TensorFlow Python code should conform to | ||
[Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) | ||
|
||
Use `pylint` to check your Python changes. To install `pylint` and | ||
retrieve TensorFlow's custom style definition: | ||
|
||
```bash | ||
pip install pylint | ||
wget -O /tmp/pylintrc https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/tools/ci_build/pylintrc | ||
``` | ||
|
||
To check a file with `pylint`: | ||
|
||
```bash | ||
pylint --rcfile=/tmp/pylintrc myfile.py | ||
``` | ||
|
||
#### Coding style for other languages | ||
|
||
* [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html) | ||
* [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) | ||
* [Google Shell Style Guide](https://google.github.io/styleguide/shell.xml) | ||
* [Google Objective-C Style Guide](https://google.github.io/styleguide/objcguide.html) | ||
|
||
#### Running sanity check | ||
|
||
If you have Docker installed on your system, you can perform a sanity check on | ||
your changes by running the command: | ||
|
||
```bash | ||
tensorflow/tools/ci_build/ci_build.sh CPU tensorflow/tools/ci_build/ci_sanity.sh | ||
``` | ||
|
||
This will catch most license, Python coding style and BUILD file issues that | ||
may exist in your changes. | ||
|
||
#### Running unit tests | ||
|
||
There are two ways to run TensorFlow unit tests. | ||
|
||
1. Using tools and libraries installed directly on your system. | ||
|
||
Refer to the | ||
[CPU-only developer Dockerfile](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel) and | ||
[GPU developer Dockerfile](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel-gpu) | ||
for the required packages. Alternatively, use the said | ||
[Docker images](https://hub.docker.com/r/tensorflow/tensorflow/tags/), e.g., | ||
`tensorflow/tensorflow:nightly-devel` and `tensorflow/tensorflow:nightly-devel-gpu` | ||
for development to avoid installing the packages directly on your system. | ||
|
||
Once you have the packages installed, you can run a specific unit test in | ||
bazel by doing as follows: | ||
|
||
If the tests are to be run on GPU, add CUDA paths to LD_LIBRARY_PATH and add | ||
the `cuda` option flag | ||
|
||
```bash | ||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH" | ||
|
||
export flags="--config=opt --config=cuda -k" | ||
``` | ||
|
||
For example, to run all tests under tensorflow/python, do: | ||
|
||
```bash | ||
bazel test ${flags} //tensorflow/python/... | ||
``` | ||
|
||
2. Using [Docker](https://www.docker.com) and TensorFlow's CI scripts. | ||
|
||
```bash | ||
# Install Docker first, then this will build and run cpu tests | ||
tensorflow/tools/ci_build/ci_build.sh CPU bazel test //tensorflow/... | ||
``` | ||
|
||
See | ||
[TensorFlow Builds](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/ci_build) for details. | ||
|
Oops, something went wrong.