From 571c0b1fef8d8347f29a3823c2bac3d226e3f8ef Mon Sep 17 00:00:00 2001 From: Jiuqiang Tang Date: Mon, 7 Nov 2022 15:15:58 -0800 Subject: [PATCH] Expose MediaPipe Tasks Audio and Text APIs in MediaPipe PyPI packages. PiperOrigin-RevId: 486777537 --- mediapipe/tasks/python/__init__.py | 2 ++ mediapipe/tasks/python/audio/__init__.py | 14 ++++++++++++++ mediapipe/tasks/python/text/__init__.py | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/mediapipe/tasks/python/__init__.py b/mediapipe/tasks/python/__init__.py index 776839140..9a9573445 100644 --- a/mediapipe/tasks/python/__init__.py +++ b/mediapipe/tasks/python/__init__.py @@ -14,8 +14,10 @@ """MediaPipe Tasks API.""" +from . import audio from . import components from . import core +from . import text from . import vision BaseOptions = core.base_options.BaseOptions diff --git a/mediapipe/tasks/python/audio/__init__.py b/mediapipe/tasks/python/audio/__init__.py index 65c1214af..947f95d9d 100644 --- a/mediapipe/tasks/python/audio/__init__.py +++ b/mediapipe/tasks/python/audio/__init__.py @@ -11,3 +11,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +"""MediaPipe Tasks Audio API.""" + +import mediapipe.tasks.python.audio.core +import mediapipe.tasks.python.audio.audio_classifier + +AudioClassifier = audio_classifier.AudioClassifier +AudioClassifierOptions = audio_classifier.AudioClassifierOptions +RunningMode = core.audio_task_running_mode.AudioTaskRunningMode + +# Remove unnecessary modules to avoid duplication in API docs. +del audio_classifier +del core +del mediapipe diff --git a/mediapipe/tasks/python/text/__init__.py b/mediapipe/tasks/python/text/__init__.py index 65c1214af..e2473f56b 100644 --- a/mediapipe/tasks/python/text/__init__.py +++ b/mediapipe/tasks/python/text/__init__.py @@ -11,3 +11,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +"""MediaPipe Tasks Text API.""" + +import mediapipe.tasks.python.text.text_classifier + +TextClassifier = text_classifier.TextClassifier +TextClassifierOptions = text_classifier.TextClassifierOptions + +# Remove unnecessary modules to avoid duplication in API docs. +del mediapipe +del text_classifier