Migrate remaining MP Tasks Libraries to ts_declarations
PiperOrigin-RevId: 488752799
This commit is contained in:
parent
1689112b23
commit
496720308c
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# This task takes audio data and outputs the classification result.
|
||||
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library")
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
|
||||
|
||||
package(default_visibility = ["//mediapipe/tasks:internal"])
|
||||
|
||||
|
@ -10,12 +10,9 @@ licenses(["notice"])
|
|||
|
||||
mediapipe_ts_library(
|
||||
name = "audio_classifier",
|
||||
srcs = [
|
||||
"audio_classifier.ts",
|
||||
"audio_classifier_options.ts",
|
||||
"audio_classifier_result.ts",
|
||||
],
|
||||
srcs = ["audio_classifier.ts"],
|
||||
deps = [
|
||||
":audio_classifier_types",
|
||||
"//mediapipe/framework:calculator_jspb_proto",
|
||||
"//mediapipe/framework:calculator_options_jspb_proto",
|
||||
"//mediapipe/tasks/cc/audio/audio_classifier/proto:audio_classifier_graph_options_jspb_proto",
|
||||
|
@ -31,3 +28,17 @@ mediapipe_ts_library(
|
|||
"//mediapipe/web/graph_runner:wasm_mediapipe_lib_ts",
|
||||
],
|
||||
)
|
||||
|
||||
mediapipe_ts_declaration(
|
||||
name = "audio_classifier_types",
|
||||
srcs = [
|
||||
"audio_classifier_options.d.ts",
|
||||
"audio_classifier_result.d.ts",
|
||||
],
|
||||
deps = [
|
||||
"//mediapipe/tasks/web/components/containers:category",
|
||||
"//mediapipe/tasks/web/components/containers:classification_result",
|
||||
"//mediapipe/tasks/web/core",
|
||||
"//mediapipe/tasks/web/core:classifier_options",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -29,6 +29,9 @@ import {createMediaPipeLib, FileLocator} from '../../../../web/graph_runner/wasm
|
|||
import {AudioClassifierOptions} from './audio_classifier_options';
|
||||
import {AudioClassifierResult} from './audio_classifier_result';
|
||||
|
||||
export * from './audio_classifier_options';
|
||||
export * from './audio_classifier_result';
|
||||
|
||||
const MEDIAPIPE_GRAPH =
|
||||
'mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph';
|
||||
|
||||
|
|
|
@ -14,7 +14,4 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Audio Classifier
|
||||
export * from '../../../tasks/web/audio/audio_classifier/audio_classifier_options';
|
||||
export * from '../../../tasks/web/audio/audio_classifier/audio_classifier_result';
|
||||
export * from '../../../tasks/web/audio/audio_classifier/audio_classifier';
|
||||
|
|
|
@ -9,5 +9,6 @@ mediapipe_ts_library(
|
|||
srcs = ["index.ts"],
|
||||
deps = [
|
||||
"//mediapipe/tasks/web/text/text_classifier",
|
||||
"//mediapipe/tasks/web/text/text_embedder",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -14,7 +14,5 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Text Classifier
|
||||
export * from '../../../tasks/web/text/text_classifier/text_classifier_options';
|
||||
export * from '../../../tasks/web/text/text_classifier/text_classifier_result';
|
||||
export * from '../../../tasks/web/text/text_classifier/text_classifier';
|
||||
export * from '../../../tasks/web/text/text_embedder/text_embedder';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# This task takes text input performs Natural Language classification (including
|
||||
# BERT-based text classification).
|
||||
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library")
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
|
||||
|
||||
package(default_visibility = ["//mediapipe/tasks:internal"])
|
||||
|
||||
|
@ -11,12 +11,9 @@ licenses(["notice"])
|
|||
|
||||
mediapipe_ts_library(
|
||||
name = "text_classifier",
|
||||
srcs = [
|
||||
"text_classifier.ts",
|
||||
"text_classifier_options.ts",
|
||||
"text_classifier_result.ts",
|
||||
],
|
||||
srcs = ["text_classifier.ts"],
|
||||
deps = [
|
||||
":text_classifier_types",
|
||||
"//mediapipe/framework:calculator_jspb_proto",
|
||||
"//mediapipe/framework:calculator_options_jspb_proto",
|
||||
"//mediapipe/tasks/cc/components/containers/proto:classifications_jspb_proto",
|
||||
|
@ -32,3 +29,16 @@ mediapipe_ts_library(
|
|||
"//mediapipe/web/graph_runner:wasm_mediapipe_lib_ts",
|
||||
],
|
||||
)
|
||||
|
||||
mediapipe_ts_declaration(
|
||||
name = "text_classifier_types",
|
||||
srcs = [
|
||||
"text_classifier_options.d.ts",
|
||||
"text_classifier_result.d.ts",
|
||||
],
|
||||
deps = [
|
||||
"//mediapipe/tasks/web/components/containers:category",
|
||||
"//mediapipe/tasks/web/components/containers:classification_result",
|
||||
"//mediapipe/tasks/web/core:classifier_options",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -29,6 +29,9 @@ import {createMediaPipeLib, FileLocator} from '../../../../web/graph_runner/wasm
|
|||
import {TextClassifierOptions} from './text_classifier_options';
|
||||
import {TextClassifierResult} from './text_classifier_result';
|
||||
|
||||
export * from './text_classifier_options';
|
||||
export * from './text_classifier_result';
|
||||
|
||||
const INPUT_STREAM = 'text_in';
|
||||
const CLASSIFICATIONS_STREAM = 'classifications_out';
|
||||
const TEXT_CLASSIFIER_GRAPH =
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# This task takes text input and performs embedding
|
||||
#
|
||||
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library")
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
|
||||
|
||||
package(default_visibility = ["//mediapipe/tasks:internal"])
|
||||
|
||||
|
@ -11,13 +11,11 @@ licenses(["notice"])
|
|||
|
||||
mediapipe_ts_library(
|
||||
name = "text_embedder",
|
||||
srcs = [
|
||||
"text_embedder.ts",
|
||||
"text_embedder_options.d.ts",
|
||||
"text_embedder_result.d.ts",
|
||||
],
|
||||
srcs = ["text_embedder.ts"],
|
||||
deps = [
|
||||
":text_embedder_types",
|
||||
"//mediapipe/framework:calculator_jspb_proto",
|
||||
"//mediapipe/framework:calculator_options_jspb_proto",
|
||||
"//mediapipe/tasks/cc/components/containers/proto:embeddings_jspb_proto",
|
||||
"//mediapipe/tasks/cc/text/text_embedder/proto:text_embedder_graph_options_jspb_proto",
|
||||
"//mediapipe/tasks/web/components/containers:embedding_result",
|
||||
|
@ -30,3 +28,16 @@ mediapipe_ts_library(
|
|||
"//mediapipe/web/graph_runner:wasm_mediapipe_lib_ts",
|
||||
],
|
||||
)
|
||||
|
||||
mediapipe_ts_declaration(
|
||||
name = "text_embedder_types",
|
||||
srcs = [
|
||||
"text_embedder_options.d.ts",
|
||||
"text_embedder_result.d.ts",
|
||||
],
|
||||
deps = [
|
||||
"//mediapipe/tasks/web/components/containers:embedding_result",
|
||||
"//mediapipe/tasks/web/core",
|
||||
"//mediapipe/tasks/web/core:embedder_options",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -29,6 +29,8 @@ import {createMediaPipeLib, FileLocator} from '../../../../web/graph_runner/wasm
|
|||
import {TextEmbedderOptions} from './text_embedder_options';
|
||||
import {TextEmbedderResult} from './text_embedder_result';
|
||||
|
||||
export * from './text_embedder_options';
|
||||
export * from './text_embedder_result';
|
||||
|
||||
// The OSS JS API does not support the builder pattern.
|
||||
// tslint:disable:jspb-use-builder-pattern
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# This task performs embedding extraction on images.
|
||||
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library")
|
||||
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
|
||||
|
||||
package(default_visibility = ["//mediapipe/tasks:internal"])
|
||||
|
||||
|
@ -10,12 +10,9 @@ licenses(["notice"])
|
|||
|
||||
mediapipe_ts_library(
|
||||
name = "image_embedder",
|
||||
srcs = [
|
||||
"image_embedder.ts",
|
||||
"image_embedder_options.ts",
|
||||
"image_embedder_result.ts",
|
||||
],
|
||||
srcs = ["image_embedder.ts"],
|
||||
deps = [
|
||||
":image_embedder_types",
|
||||
"//mediapipe/framework:calculator_jspb_proto",
|
||||
"//mediapipe/framework:calculator_options_jspb_proto",
|
||||
"//mediapipe/tasks/cc/components/containers/proto:embeddings_jspb_proto",
|
||||
|
@ -31,3 +28,17 @@ mediapipe_ts_library(
|
|||
"//mediapipe/web/graph_runner:wasm_mediapipe_lib_ts",
|
||||
],
|
||||
)
|
||||
|
||||
mediapipe_ts_declaration(
|
||||
name = "image_embedder_types",
|
||||
srcs = [
|
||||
"image_embedder_options.d.ts",
|
||||
"image_embedder_result.d.ts",
|
||||
],
|
||||
deps = [
|
||||
"//mediapipe/tasks/web/components/containers:embedding_result",
|
||||
"//mediapipe/tasks/web/core",
|
||||
"//mediapipe/tasks/web/core:embedder_options",
|
||||
"//mediapipe/tasks/web/vision/core:running_mode",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -38,6 +38,8 @@ const EMBEDDINGS_STREAM = 'embeddings_out';
|
|||
const TEXT_EMBEDDER_CALCULATOR =
|
||||
'mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph';
|
||||
|
||||
export * from './image_embedder_options';
|
||||
export * from './image_embedder_result';
|
||||
export {ImageSource}; // Used in the public API
|
||||
|
||||
/** Performs embedding extraction on images. */
|
||||
|
|
|
@ -14,19 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Image Classifier
|
||||
export * from '../../../tasks/web/vision/image_classifier/image_classifier';
|
||||
|
||||
// Image Embedder
|
||||
export * from '../../../tasks/web/vision/image_embedder/image_embedder_options';
|
||||
export * from '../../../tasks/web/vision/image_embedder/image_embedder_result';
|
||||
export * from '../../../tasks/web/vision/image_embedder/image_embedder';
|
||||
|
||||
// Gesture Recognizer
|
||||
export * from '../../../tasks/web/vision/gesture_recognizer/gesture_recognizer';
|
||||
|
||||
// Hand Landmarker
|
||||
export * from '../../../tasks/web/vision/hand_landmarker/hand_landmarker';
|
||||
|
||||
// Object Detector
|
||||
export * from '../../../tasks/web/vision/object_detector/object_detector';
|
||||
|
|
Loading…
Reference in New Issue
Block a user