Expose tasks components API in PyPI packages.

PiperOrigin-RevId: 488487666
This commit is contained in:
Jiuqiang Tang 2022-11-14 15:39:16 -08:00 committed by Copybara-Service
parent e714e656fe
commit cce1751dbf
4 changed files with 65 additions and 0 deletions

View File

@ -16,12 +16,18 @@
import mediapipe.tasks.python.audio.core import mediapipe.tasks.python.audio.core
import mediapipe.tasks.python.audio.audio_classifier import mediapipe.tasks.python.audio.audio_classifier
import mediapipe.tasks.python.audio.audio_embedder
AudioClassifier = audio_classifier.AudioClassifier AudioClassifier = audio_classifier.AudioClassifier
AudioClassifierOptions = audio_classifier.AudioClassifierOptions AudioClassifierOptions = audio_classifier.AudioClassifierOptions
AudioClassifierResult = audio_classifier.AudioClassifierResult
AudioEmbedder = audio_embedder.AudioEmbedder
AudioEmbedderOptions = audio_embedder.AudioEmbedderOptions
AudioEmbedderResult = audio_embedder.AudioEmbedderResult
RunningMode = core.audio_task_running_mode.AudioTaskRunningMode RunningMode = core.audio_task_running_mode.AudioTaskRunningMode
# Remove unnecessary modules to avoid duplication in API docs. # Remove unnecessary modules to avoid duplication in API docs.
del audio_classifier del audio_classifier
del audio_embedder
del core del core
del mediapipe del mediapipe

View File

@ -11,3 +11,43 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""MediaPipe Tasks Components Containers API."""
import mediapipe.tasks.python.components.containers.audio_data
import mediapipe.tasks.python.components.containers.bounding_box
import mediapipe.tasks.python.components.containers.category
import mediapipe.tasks.python.components.containers.classification_result
import mediapipe.tasks.python.components.containers.detections
import mediapipe.tasks.python.components.containers.embedding_result
import mediapipe.tasks.python.components.containers.landmark
import mediapipe.tasks.python.components.containers.landmark_detection_result
import mediapipe.tasks.python.components.containers.rect
AudioDataFormat = audio_data.AudioDataFormat
AudioData = audio_data.AudioData
BoundingBox = bounding_box.BoundingBox
Category = category.Category
Classifications = classification_result.Classifications
ClassificationResult = classification_result.ClassificationResult
Detection = detections.Detection
DetectionResult = detections.DetectionResult
Embedding = embedding_result.Embedding
EmbeddingResult = embedding_result.EmbeddingResult
Landmark = landmark.Landmark
NormalizedLandmark = landmark.NormalizedLandmark
LandmarksDetectionResult = landmark_detection_result.LandmarksDetectionResult
Rect = rect.Rect
NormalizedRect = rect.NormalizedRect
# Remove unnecessary modules to avoid duplication in API docs.
del audio_data
del bounding_box
del category
del classification_result
del detections
del embedding_result
del landmark
del landmark_detection_result
del rect
del mediapipe

View File

@ -11,3 +11,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""MediaPipe Tasks Components Processors API."""
import mediapipe.tasks.python.components.processors.classifier_options
import mediapipe.tasks.python.components.processors.embedder_options
ClassifierOptions = classifier_options.ClassifierOptions
EmbedderOptions = embedder_options.EmbedderOptions
# Remove unnecessary modules to avoid duplication in API docs.
del classifier_options
del embedder_options
del mediapipe

View File

@ -15,10 +15,16 @@
"""MediaPipe Tasks Text API.""" """MediaPipe Tasks Text API."""
import mediapipe.tasks.python.text.text_classifier import mediapipe.tasks.python.text.text_classifier
import mediapipe.tasks.python.text.text_embedder
TextClassifier = text_classifier.TextClassifier TextClassifier = text_classifier.TextClassifier
TextClassifierOptions = text_classifier.TextClassifierOptions TextClassifierOptions = text_classifier.TextClassifierOptions
TextClassifierResult = text_classifier.TextClassifierResult
TextEmbedder = text_embedder.TextEmbedder
TextEmbedderOptions = text_embedder.TextEmbedderOptions
TextEmbedderResult = text_embedder.TextEmbedderResult
# Remove unnecessary modules to avoid duplication in API docs. # Remove unnecessary modules to avoid duplication in API docs.
del mediapipe del mediapipe
del text_classifier del text_classifier
del text_embedder