Commit Graph

27 Commits

Author SHA1 Message Date
Jared Duke
b10e572627 Avoid ContextCompat dependency in TFLite Java demo
PiperOrigin-RevId: 315807853
Change-Id: I86aa10eea7d173455068736a9471742f5614c64c
2020-06-10 18:18:55 -07:00
A. Unique TensorFlower
7344c2f3f5 ...This is Androidx Migration...
PiperOrigin-RevId: 315791679
Change-Id: Ided4946f98a111f07dbffac2d4b30fa33b3123a6
2020-06-10 16:31:43 -07:00
Jared Duke
17729960be Update TFLite dependencies in all gradle builds
Upgrade from 2.0.0 to 2.1.0, and ensure that the
nightly version always pull in the latest build
(via `changing = true`).

PiperOrigin-RevId: 303420760
Change-Id: I14d5bd2b4c181e05a392ccf97fed578088831f5b
2020-03-27 15:41:16 -07:00
A. Unique TensorFlower
c5dce1fd00 Remove uses of 'aapt_version' attribute.
Bazel 1.0 [1] enables aapt2 by default, so this attribute doesn't do anything.
Bazel 2.0 [2] will prohibit [3] any uses of this attribute.

This also means that building with Bazel versions <1.0 would potentially use aapt1, but this might actually be a good thing.  TF has a minimum version requirement of 0.19, and many aapt2-related fixes have been made in the 0.2x series.

[1] https://blog.bazel.build/2019/10/10/bazel-1.0.html
[2] https://github.com/bazelbuild/bazel/issues/10000
[3] b3f54f6732/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java (L262)
[4] dc73a9889f/WORKSPACE (L92)

PiperOrigin-RevId: 281679131
Change-Id: I47818b8b59eeb78a8c439523ce72e388428f2da9
2019-11-20 22:36:55 -08:00
dengziming
ebe9a2e7c1 Fix few typos in the annotations and docs
Signed-off-by: dengziming <dengziming1993@gmail.com>
2019-09-24 10:47:54 +08:00
Frank Chen
57e0d1acc2 Mechanical replacement of download.tensorflow.org with https equivalent.
PiperOrigin-RevId: 259862509
2019-07-24 18:49:22 -07:00
Jared Duke
fc870cd334 Upgrade all APKs to build with aapt2
PiperOrigin-RevId: 255223242
2019-06-26 16:18:54 -07:00
A. Unique TensorFlower
3e0a311fa0 Apply 'buildozer fix moveLicensesAndDistribs movePackageToTop' to all BUILD files.
PiperOrigin-RevId: 251836013
2019-06-06 06:06:34 -07:00
A. Unique TensorFlower
58012efe68 Clean up stray chars from strings.xml
PiperOrigin-RevId: 251257290
2019-06-03 10:26:17 -07:00
A. Unique TensorFlower
4469ed4ed8 Apply 'buildozer fix moveLicensesAndDistribs movePackageToTop' to all BUILD files.
PiperOrigin-RevId: 249807024
2019-05-24 03:53:05 -07:00
TensorFlower Gardener
ba01cc376f Merge pull request from fcbruce:fix-android
PiperOrigin-RevId: 247678575
2019-05-10 17:53:59 -07:00
Koan-Sin Tan
df5e86cf06 changes to address issues from review 2019-04-28 09:31:38 +08:00
Koan-Sin Tan
e8dbc07a31 enable using the new NNAPI delegate in Java
1. add a wrapper for NNAPI delegate can be accessed in Java
2. modify the demo app to use it
2019-04-21 11:37:07 +08:00
Jared Duke
6d28416115 Move the GpuDelegate into the lite.gpu package
Also enable GPU support to the Android classification demo
by default, using the new GPU nightly releases.

PiperOrigin-RevId: 244205002
2019-04-18 10:05:35 -07:00
Jared Duke
f47745d60a Make the GPU AAR a standalone plugin
PiperOrigin-RevId: 243346812
2019-04-12 15:58:15 -07:00
Jared Duke
3fe8c6b43b Enable GPU in TFLite camera demo for bazel builds
PiperOrigin-RevId: 242002157
2019-04-04 14:08:01 -07:00
lvli
eab88efade fix tflite android demo: fix normalization for mobile-net 2019-03-06 22:05:36 +08:00
Jared Duke
edfb0bba7f Fix androidx dependency for Android example
PiperOrigin-RevId: 231611822
2019-01-30 10:03:40 -08:00
A. Unique TensorFlower
a669a87180 V13 androidx migration
PiperOrigin-RevId: 231490618
2019-01-29 16:03:48 -08:00
A. Unique TensorFlower
b59aa4b893 Update landscape layout with model, device, and number of thread selectors.
PiperOrigin-RevId: 229584823
2019-01-16 10:52:51 -08:00
Andrew Selle
0bc02af7db Fix demo app to handle some cases more properly
- Don't crash when threads are changes with a delegate. This is done by now recreating interpreter every time threads is changes.
- Don't call showToast() every updateFrame() when classifier is null. This prevents hanging and allows the proper error message to be displayed.

PiperOrigin-RevId: 229503428
2019-01-15 23:17:46 -08:00
Jared Duke
864fe25ff7 Align Android gradle build files
Use Gradle 3.1.4 and modernize the TFLite example gradle files.

PiperOrigin-RevId: 228547238
2019-01-09 10:57:36 -08:00
Dan Jarvis
7578e120de Fix crash on closing the app when classifier failed to initialize
When testing on an API 21 emulator, the classifier fails to initialize.
`E/TfLiteCameraDemo: Failed to initialize an image classifier.`

In this situation, the app crashes when pressing Back to exit.  Here's the cause:
```
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.android.tflitecamerademo.ImageClassifier.close()' on a null object reference
                                                                                        at com.example.android.tflitecamerademo.Camera2BasicFragment.onDestroy(Camera2BasicFragment.java:331)
                                                                                        at android.app.Fragment.performDestroy(Fragment.java:2266)
```
The fix is to check for null before calling `.close()`.

I'll investigate why the classifier is failing to initialize separately. :-)
2018-12-09 11:22:52 -05:00
Andrew Selle
a3f24855d6 Allow TensorFlow demo app to switch between devices
Please approve this CL. It will be submitted automatically, and its GitHub pull request will be marked as merged.

- ListView gui for model (float and quant)
- ListView gui for devices (optional gpu, nnapi and cpu)
- Add a few AAR options.

PiperOrigin-RevId: 224626109
2018-12-07 23:41:10 -08:00
A. Unique TensorFlower
47b751c932 Changed CPU <-> NNAPI toggle UI element from ToggleButton to RadioButton.
PiperOrigin-RevId: 224586292
2018-12-07 15:25:37 -08:00
Andrew Selle
7a9363e165 Update model for classification app
- Use model referred from our models.md list.
- Download both float/quant

PiperOrigin-RevId: 224394551
2018-12-06 13:22:15 -08:00
Austin Anderson
61c6c84964 Migrate TensorFlow Lite out of tensorflow/contrib
This change moves //tensorflow/contrib/lite to //tensorflow/lite in preparation
for TensorFlow 2.0's deprecation of contrib/. If you refer to TF Lite build
targets or headers, you will need to update them manually. If you use TF Lite
from the TensorFlow python package, "tf.contrib.lite" now points to "tf.lite".
Please update your imports as soon as possible.

For more details, see https://groups.google.com/a/tensorflow.org/forum/#!topic/tflite/iIIXOTOFvwQ

@angersson and @aselle are conducting this migration. Please contact them if
you have any further questions.

PiperOrigin-RevId: 219536476
2018-10-31 14:20:28 -07:00