File tree Expand file tree Collapse file tree 10 files changed +103
-10
lines changed
Expand file tree Collapse file tree 10 files changed +103
-10
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ tensorflow_lite_support/tools/pip_package/build_pip_package.sh:
4444tensorflow_lite_support/tools/pip_package/metadata_writers.__init__.py:
4545tensorflow_lite_support/tools/pip_package/setup.py:
4646tensorflow_lite_support/tools/pip_package/simple_console_for_windows.py:
47+ tensorflow_lite_support/tools/pip_package/task.__init__.py:
4748tensorflow_lite_support/tools/pip_package/task_audio.__init__.py:
4849tensorflow_lite_support/tools/pip_package/task_core.__init__.py:
4950tensorflow_lite_support/tools/pip_package/task_processor.__init__.py:
Original file line number Diff line number Diff line change 1818from tensorflow_lite_support .python .task .audio .core import audio_record
1919from tensorflow_lite_support .python .task .audio .core .pybinds import _pywrap_audio_buffer
2020
21- _CppAudioFormat = _pywrap_audio_buffer .AudioFormat
2221_LoadAudioBufferFromFile = _pywrap_audio_buffer .LoadAudioBufferFromFile
22+ AudioFormat = _pywrap_audio_buffer .AudioFormat
2323
2424
2525class TensorAudio (object ):
2626 """A wrapper class to store the input audio."""
2727
28- def __init__ (self , audio_format : _CppAudioFormat , buffer_size : int ) -> None :
28+ def __init__ (self , audio_format : AudioFormat , buffer_size : int ) -> None :
2929 """Initializes the `TensorAudio` object.
3030
3131 Args:
@@ -137,7 +137,7 @@ def load_from_array(self,
137137 self ._buffer [- shift :, :] = src [offset :offset + size ].copy ()
138138
139139 @property
140- def format (self ) -> _CppAudioFormat :
140+ def format (self ) -> AudioFormat :
141141 """Gets the audio format of the audio."""
142142 return self ._format
143143
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ function prepare_src() {
9898 # Task Library is not supported on Windows yet.
9999 mkdir ${TMPDIR} /tflite_support/task
100100 mkdir ${TMPDIR} /tflite_support/task/core
101+ cp tensorflow_lite_support/tools/pip_package/task.__init__.py ${TMPDIR} /tflite_support/task/__init__.py
101102 cp tensorflow_lite_support/tools/pip_package/task_core.__init__.py ${TMPDIR} /tflite_support/task/core/__init__.py
102103 mkdir ${TMPDIR} /tflite_support/task/vision
103104 cp tensorflow_lite_support/tools/pip_package/task_vision.__init__.py ${TMPDIR} /tflite_support/task/vision/__init__.py
Original file line number Diff line number Diff line change 1+ # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ # ==============================================================================
15+ """The TensorFlow Lite Task Library.
16+
17+ TensorFlow Lite Task Library contains a set of powerful and easy-to-use
18+ task-specific libraries for app developers to create ML experiences with
19+ TensorFlow Lite. It provides optimized out-of-box model interfaces for popular
20+ machine learning tasks, such as image and text classification. The model
21+ interfaces are specifically designed for each task to achieve the best
22+ performance and usability.
23+
24+ Read more in the [Task Library Guide](
25+ https://tensorflow.org/lite/inference_with_metadata/task_library/overview).
26+ """
27+
28+ from . import audio
29+ from . import core
30+ from . import processor
31+ from . import text
32+ from . import vision
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414# ==============================================================================
15- """An import entry for Task Audio Library."""
15+ """TensorFlow Lite Task Library Audio APIs.
16+
17+ This module provides interface to run TensorFlow Lite audio models.
18+ """
1619
1720from tensorflow_lite_support .python .task .audio import audio_classifier
1821from tensorflow_lite_support .python .task .audio import audio_embedder
2427AudioEmbedder = audio_embedder .AudioEmbedder
2528AudioEmbedderOptions = audio_embedder .AudioEmbedderOptions
2629AudioRecord = audio_record .AudioRecord
30+ AudioFormat = tensor_audio .AudioFormat
2731TensorAudio = tensor_audio .TensorAudio
32+
33+ # Remove unnecessary modules to avoid duplication in API docs.
34+ del audio_classifier
35+ del audio_embedder
36+ del audio_record
37+ del tensor_audio
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414# ==============================================================================
15- """An import entry for the Task Core module."""
15+ """TensorFlow Lite Task Library's core module.
16+
17+ This module contains classes used across multiple tasks in the Task Library."""
1618
1719from tensorflow_lite_support .python .task .core .proto import base_options_pb2
1820
1921BaseOptions = base_options_pb2 .BaseOptions
22+
23+ # Remove unnecessary modules to avoid duplication in API docs.
24+ del base_options_pb2
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414# ==============================================================================
15- """An import entry for the Task Processor module."""
15+ """TensorFlow Lite Task Library's processor module.
16+
17+ This module contains classes related to the pre-processing and post-processing
18+ steps of the Task Library.
19+ """
1620
1721from tensorflow_lite_support .python .task .processor .proto import bounding_box_pb2
1822from tensorflow_lite_support .python .task .processor .proto import classification_options_pb2
3741Segmentation = segmentations_pb2 .Segmentation
3842SearchOptions = search_options_pb2 .SearchOptions
3943SearchResult = search_result_pb2 .SearchResult
44+
45+ # Remove unnecessary modules to avoid duplication in API docs.
46+ del bounding_box_pb2
47+ del classification_options_pb2
48+ del classifications_pb2
49+ del detection_options_pb2
50+ del detections_pb2
51+ del embedding_options_pb2
52+ del embedding_pb2
53+ del segmentation_options_pb2
54+ del segmentations_pb2
55+ del search_options_pb2
56+ del search_result_pb2
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414# ==============================================================================
15- """An import entry for Task Text Library."""
15+ """TensorFlow Lite Task Library Text APIs.
16+
17+ This module provides interface to run TensorFlow Lite natural language
18+ processing models.
19+ """
1620
1721from tensorflow_lite_support .python .task .text import text_embedder
1822from tensorflow_lite_support .python .task .text import text_searcher
2125TextEmbedderOptions = text_embedder .TextEmbedderOptions
2226TextSearcher = text_searcher .TextSearcher
2327TextSearcherOptions = text_searcher .TextSearcherOptions
28+
29+ # Remove unnecessary modules to avoid duplication in API docs.
30+ del text_embedder
31+ del text_searcher
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414# ==============================================================================
15- """An import entry for Task Vision Library."""
15+ """TensorFlow Lite Task Library Vision APIs.
16+
17+ This module provides interface to run TensorFlow Lite computer vision models.
18+ """
1619
1720from tensorflow_lite_support .python .task .vision import image_classifier
1821from tensorflow_lite_support .python .task .vision import image_embedder
3235ImageSearcher = image_searcher .ImageSearcher
3336ImageSearcherOptions = image_searcher .ImageSearcherOptions
3437TensorImage = tensor_image .TensorImage
38+
39+ # Remove unnecessary modules to avoid duplication in API docs.
40+ del image_classifier
41+ del image_embedder
42+ del image_segmenter
43+ del image_searcher
44+ del object_detector
45+ del tensor_image
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414# ==============================================================================
15- """The TFLite Support Library.
15+ """The TensorFlow Lite Support Library.
1616
1717Install the pip package:
1818
1919```
2020pip install tflite-support
2121```
2222
23+ This package provides two major features:
24+ * Metadata writers: add metadata to TensorFlow Lite models.
25+ * Task Library: run TensorFlow Lite models of major machine learning tasks.
26+
2327To learn more about metadata, flatbuffers and TensorFlow Lite models, check out
2428the [metadata section](https://www.tensorflow.org/lite/convert/metadata) of the
25- TF Lite guide.
29+ TensorFlow Lite guide.
30+
31+ To learn more about Task Library, check out the
32+ [documentation](https://www.tensorflow.org/lite/inference_with_metadata/task_library/overview)
33+ on the TensorFlow Lite website.
2634"""
2735
2836# In the original project structure, all python targets are accessed by paths
You can’t perform that action at this time.
0 commit comments