Merge pull request #3866 from kinaryml:fix-tasks-api-python-311-errors
PiperOrigin-RevId: 489346167
This commit is contained in:
commit
cd056e114a
|
@ -70,7 +70,8 @@ class AudioClassifierOptions:
|
||||||
"""
|
"""
|
||||||
base_options: _BaseOptions
|
base_options: _BaseOptions
|
||||||
running_mode: _RunningMode = _RunningMode.AUDIO_CLIPS
|
running_mode: _RunningMode = _RunningMode.AUDIO_CLIPS
|
||||||
classifier_options: _ClassifierOptions = _ClassifierOptions()
|
classifier_options: Optional[_ClassifierOptions] = dataclasses.field(
|
||||||
|
default_factory=_ClassifierOptions)
|
||||||
result_callback: Optional[Callable[[AudioClassifierResult, int], None]] = None
|
result_callback: Optional[Callable[[AudioClassifierResult, int], None]] = None
|
||||||
|
|
||||||
@doc_controls.do_not_generate_docs
|
@doc_controls.do_not_generate_docs
|
||||||
|
|
|
@ -71,7 +71,8 @@ class AudioEmbedderOptions:
|
||||||
"""
|
"""
|
||||||
base_options: _BaseOptions
|
base_options: _BaseOptions
|
||||||
running_mode: _RunningMode = _RunningMode.AUDIO_CLIPS
|
running_mode: _RunningMode = _RunningMode.AUDIO_CLIPS
|
||||||
embedder_options: _EmbedderOptions = _EmbedderOptions()
|
embedder_options: Optional[_EmbedderOptions] = dataclasses.field(
|
||||||
|
default_factory=_EmbedderOptions)
|
||||||
result_callback: Optional[Callable[[AudioEmbedderResult, int], None]] = None
|
result_callback: Optional[Callable[[AudioEmbedderResult, int], None]] = None
|
||||||
|
|
||||||
@doc_controls.do_not_generate_docs
|
@doc_controls.do_not_generate_docs
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"""MediaPipe text classifier task."""
|
"""MediaPipe text classifier task."""
|
||||||
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from mediapipe.python import packet_creator
|
from mediapipe.python import packet_creator
|
||||||
from mediapipe.python import packet_getter
|
from mediapipe.python import packet_getter
|
||||||
|
@ -48,7 +49,8 @@ class TextClassifierOptions:
|
||||||
classifier_options: Options for the text classification task.
|
classifier_options: Options for the text classification task.
|
||||||
"""
|
"""
|
||||||
base_options: _BaseOptions
|
base_options: _BaseOptions
|
||||||
classifier_options: _ClassifierOptions = _ClassifierOptions()
|
classifier_options: Optional[_ClassifierOptions] = dataclasses.field(
|
||||||
|
default_factory=_ClassifierOptions)
|
||||||
|
|
||||||
@doc_controls.do_not_generate_docs
|
@doc_controls.do_not_generate_docs
|
||||||
def to_pb2(self) -> _TextClassifierGraphOptionsProto:
|
def to_pb2(self) -> _TextClassifierGraphOptionsProto:
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"""MediaPipe text embedder task."""
|
"""MediaPipe text embedder task."""
|
||||||
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from mediapipe.python import packet_creator
|
from mediapipe.python import packet_creator
|
||||||
from mediapipe.python import packet_getter
|
from mediapipe.python import packet_getter
|
||||||
|
@ -49,7 +50,8 @@ class TextEmbedderOptions:
|
||||||
embedder_options: Options for the text embedder task.
|
embedder_options: Options for the text embedder task.
|
||||||
"""
|
"""
|
||||||
base_options: _BaseOptions
|
base_options: _BaseOptions
|
||||||
embedder_options: _EmbedderOptions = _EmbedderOptions()
|
embedder_options: Optional[_EmbedderOptions] = dataclasses.field(
|
||||||
|
default_factory=_EmbedderOptions)
|
||||||
|
|
||||||
@doc_controls.do_not_generate_docs
|
@doc_controls.do_not_generate_docs
|
||||||
def to_pb2(self) -> _TextEmbedderGraphOptionsProto:
|
def to_pb2(self) -> _TextEmbedderGraphOptionsProto:
|
||||||
|
|
|
@ -181,9 +181,11 @@ class GestureRecognizerOptions:
|
||||||
min_hand_presence_confidence: Optional[float] = 0.5
|
min_hand_presence_confidence: Optional[float] = 0.5
|
||||||
min_tracking_confidence: Optional[float] = 0.5
|
min_tracking_confidence: Optional[float] = 0.5
|
||||||
canned_gesture_classifier_options: Optional[
|
canned_gesture_classifier_options: Optional[
|
||||||
_ClassifierOptions] = _ClassifierOptions()
|
_ClassifierOptions] = dataclasses.field(
|
||||||
|
default_factory=_ClassifierOptions)
|
||||||
custom_gesture_classifier_options: Optional[
|
custom_gesture_classifier_options: Optional[
|
||||||
_ClassifierOptions] = _ClassifierOptions()
|
_ClassifierOptions] = dataclasses.field(
|
||||||
|
default_factory=_ClassifierOptions)
|
||||||
result_callback: Optional[Callable[
|
result_callback: Optional[Callable[
|
||||||
[GestureRecognizerResult, image_module.Image, int], None]] = None
|
[GestureRecognizerResult, image_module.Image, int], None]] = None
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,8 @@ class ImageClassifierOptions:
|
||||||
"""
|
"""
|
||||||
base_options: _BaseOptions
|
base_options: _BaseOptions
|
||||||
running_mode: _RunningMode = _RunningMode.IMAGE
|
running_mode: _RunningMode = _RunningMode.IMAGE
|
||||||
classifier_options: _ClassifierOptions = _ClassifierOptions()
|
classifier_options: Optional[_ClassifierOptions] = dataclasses.field(
|
||||||
|
default_factory=_ClassifierOptions)
|
||||||
result_callback: Optional[Callable[
|
result_callback: Optional[Callable[
|
||||||
[ImageClassifierResult, image_module.Image, int], None]] = None
|
[ImageClassifierResult, image_module.Image, int], None]] = None
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,8 @@ class ImageEmbedderOptions:
|
||||||
"""
|
"""
|
||||||
base_options: _BaseOptions
|
base_options: _BaseOptions
|
||||||
running_mode: _RunningMode = _RunningMode.IMAGE
|
running_mode: _RunningMode = _RunningMode.IMAGE
|
||||||
embedder_options: _EmbedderOptions = _EmbedderOptions()
|
embedder_options: Optional[_EmbedderOptions] = dataclasses.field(
|
||||||
|
default_factory=_EmbedderOptions)
|
||||||
result_callback: Optional[Callable[
|
result_callback: Optional[Callable[
|
||||||
[ImageEmbedderResult, image_module.Image, int], None]] = None
|
[ImageEmbedderResult, image_module.Image, int], None]] = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user