From df7ce56db0f8134e129c3403f21d86b4935d2c92 Mon Sep 17 00:00:00 2001 From: Tian Lin Date: Sun, 16 May 2021 06:38:27 -0700 Subject: [PATCH] Update tflite-model-maker APIs to 0.3.2. PiperOrigin-RevId: 374055079 --- tensorflow_examples/lite/model_maker/README.md | 17 ++++++++++++----- tensorflow_examples/lite/model_maker/RELEASE.md | 4 ++++ .../lite/model_maker/pip_package/setup.py | 4 ++-- .../lite/model_maker/public/__init__.py | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/tensorflow_examples/lite/model_maker/README.md b/tensorflow_examples/lite/model_maker/README.md index ecf9af751bf..b58c5c52d4f 100644 --- a/tensorflow_examples/lite/model_maker/README.md +++ b/tensorflow_examples/lite/model_maker/README.md @@ -42,6 +42,11 @@ cd examples/tensorflow_examples/lite/model_maker/pip_package pip install -e . ``` +TensorFlow Lite Model Maker depends on TensorFlow +[pip package](https://www.tensorflow.org/install/pip). For GPU support, please +refer to TensorFlow's [GPU guide](https://www.tensorflow.org/install/gpu) or +[installation guide](https://www.tensorflow.org/install). + ## End-to-End Example For instance, it could have an end-to-end image classification example that @@ -49,32 +54,32 @@ utilizes this library with just 4 lines of code, each of which representing one step of the overall process. For more detail, you could refer to [Colab for image classification](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_image_classification.ipynb). -* 1. Import the required modules. +* Step 1. Import the required modules. ```python from tflite_model_maker import image_classifier from tflite_model_maker.image_classifier import DataLoader ``` -* 2. Load input data specific to an on-device ML app. +* Step 2. Load input data specific to an on-device ML app. ```python data = DataLoader.from_folder('flower_photos/') ``` -* 3. Customize the TensorFlow model. +* Step 3. Customize the TensorFlow model. ```python model = image_classifier.create(data) ``` -* 4. Evaluate the model. +* Step 4. Evaluate the model. ```python loss, accuracy = model.evaluate() ``` -* 5. Export to Tensorflow Lite model and label file in `export_dir`. +* Step 5. Export to Tensorflow Lite model and label file in `export_dir`. ```python model.export(export_dir='/tmp/') @@ -86,6 +91,8 @@ Currently, we support image classification, text classification and question answer tasks. Meanwhile, we provide demo code for each of them in demo folder. * [Overview for TensorFlow Lite Model Maker](https://www.tensorflow.org/lite/guide/model_maker) +* [Python API Reference](https://www.tensorflow.org/lite/api_docs/python/tflite_model_maker) * [Colab for image classification](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_image_classification.ipynb) * [Colab for text classification](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_text_classification.ipynb) * [Colab for BERT question answer](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_question_answer.ipynb) +* [Colab for object detection](https://www.tensorflow.org/lite/tutorials/model_maker_object_detection) diff --git a/tensorflow_examples/lite/model_maker/RELEASE.md b/tensorflow_examples/lite/model_maker/RELEASE.md index 546354f3450..113629fb030 100644 --- a/tensorflow_examples/lite/model_maker/RELEASE.md +++ b/tensorflow_examples/lite/model_maker/RELEASE.md @@ -1,5 +1,9 @@ # Release 0.3 +## 0.3.2 + +* Minor fix: Move librosa to an optional library for audio task. + ## 0.3.1 * Polish document showing in diff --git a/tensorflow_examples/lite/model_maker/pip_package/setup.py b/tensorflow_examples/lite/model_maker/pip_package/setup.py index f4c7da9b62d..7a67d76c115 100644 --- a/tensorflow_examples/lite/model_maker/pip_package/setup.py +++ b/tensorflow_examples/lite/model_maker/pip_package/setup.py @@ -57,14 +57,14 @@ # Set package version. if nightly: project_name = '{}-nightly'.format(project_name) - version = '0.3.2' # Version prefix, usually major.minor.micro. + version = '0.3.3' # Version prefix, usually major.minor.micro. version = '{:s}.dev{:s}'.format(version, datestring) classifiers += [ 'Development Status :: 4 - Beta', ] else: # LINT.IfChange(model_maker_pip_version) - version = '0.3.1' + version = '0.3.2' # LINT.ThenChange(../public/__init__.py, ../RELEASE.md) # Path to model_maker dir: /tensorflow_examples/lite/model_maker diff --git a/tensorflow_examples/lite/model_maker/public/__init__.py b/tensorflow_examples/lite/model_maker/public/__init__.py index ad94f8bb9f0..806b98a7404 100644 --- a/tensorflow_examples/lite/model_maker/public/__init__.py +++ b/tensorflow_examples/lite/model_maker/public/__init__.py @@ -58,4 +58,4 @@ from tensorflow_examples.lite.model_maker.core.task import configs # pylint: enable=g-bad-import-order -__version__ = '0.3.1' +__version__ = '0.3.2'