Prevent property mangling for options types

PiperOrigin-RevId: 530707361
This commit is contained in:
Sebastian Schmidt 2023-05-09 14:02:42 -07:00 committed by Copybara-Service
parent 05c565898a
commit 6f3c80ae8a
14 changed files with 42 additions and 18 deletions

View File

@ -38,7 +38,7 @@ export declare interface Classifications {
} }
/** Classification results of a model. */ /** Classification results of a model. */
export interface ClassificationResult { export declare interface ClassificationResult {
/** The classification results for each head of the model. */ /** The classification results for each head of the model. */
classifications: Classifications[]; classifications: Classifications[];

View File

@ -37,7 +37,7 @@ export declare interface Detection {
} }
/** Detection results of a model. */ /** Detection results of a model. */
export interface DetectionResult { export declare interface DetectionResult {
/** A list of Detections. */ /** A list of Detections. */
detections: Detection[]; detections: Detection[];
} }

View File

@ -48,7 +48,7 @@ export declare interface Embedding {
} }
/** Embedding results for a given embedder model. */ /** Embedding results for a given embedder model. */
export interface EmbeddingResult { export declare interface EmbeddingResult {
/** /**
* The embedding results for each model head, i.e. one for each output tensor. * The embedding results for each model head, i.e. one for each output tensor.
*/ */

View File

@ -393,3 +393,5 @@ export class MPImage {
} }
} }
} }

View File

@ -313,3 +313,5 @@ export class MPMask {
} }
} }
} }

View File

@ -18,7 +18,7 @@ import {ClassifierOptions} from '../../../../tasks/web/core/classifier_options';
import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options'; import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options';
/** Options to configure the MediaPipe Face Detector Task */ /** Options to configure the MediaPipe Face Detector Task */
export interface FaceDetectorOptions extends VisionTaskOptions { export declare interface FaceDetectorOptions extends VisionTaskOptions {
/** /**
* The minimum confidence score for the face detection to be considered * The minimum confidence score for the face detection to be considered
* successful. Defaults to 0.5. * successful. Defaults to 0.5.

View File

@ -17,4 +17,4 @@
import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options'; import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options';
/** Options to configure the MediaPipe Face Stylizer Task */ /** Options to configure the MediaPipe Face Stylizer Task */
export interface FaceStylizerOptions extends VisionTaskOptions {} export declare interface FaceStylizerOptions extends VisionTaskOptions {}

View File

@ -1,6 +1,6 @@
# This contains the MediaPipe Image Segmenter Task. # This contains the MediaPipe Image Segmenter Task.
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library") load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
package(default_visibility = ["//mediapipe/tasks:internal"]) package(default_visibility = ["//mediapipe/tasks:internal"])
@ -11,10 +11,10 @@ mediapipe_ts_library(
name = "image_segmenter", name = "image_segmenter",
srcs = [ srcs = [
"image_segmenter.ts", "image_segmenter.ts",
"image_segmenter_options.ts",
"image_segmenter_result.ts", "image_segmenter_result.ts",
], ],
deps = [ deps = [
":image_segmenter_types",
"//mediapipe/framework:calculator_jspb_proto", "//mediapipe/framework:calculator_jspb_proto",
"//mediapipe/framework:calculator_options_jspb_proto", "//mediapipe/framework:calculator_options_jspb_proto",
"//mediapipe/tasks/cc/core/proto:base_options_jspb_proto", "//mediapipe/tasks/cc/core/proto:base_options_jspb_proto",
@ -25,13 +25,18 @@ mediapipe_ts_library(
"//mediapipe/tasks/web/core:classifier_options", "//mediapipe/tasks/web/core:classifier_options",
"//mediapipe/tasks/web/vision/core:image_processing_options", "//mediapipe/tasks/web/vision/core:image_processing_options",
"//mediapipe/tasks/web/vision/core:mask", "//mediapipe/tasks/web/vision/core:mask",
"//mediapipe/tasks/web/vision/core:vision_task_options",
"//mediapipe/tasks/web/vision/core:vision_task_runner", "//mediapipe/tasks/web/vision/core:vision_task_runner",
"//mediapipe/util:label_map_jspb_proto", "//mediapipe/util:label_map_jspb_proto",
"//mediapipe/web/graph_runner:graph_runner_ts", "//mediapipe/web/graph_runner:graph_runner_ts",
], ],
) )
mediapipe_ts_declaration(
name = "image_segmenter_types",
srcs = ["image_segmenter_options.d.ts"],
deps = ["//mediapipe/tasks/web/vision/core:vision_task_options"],
)
mediapipe_ts_library( mediapipe_ts_library(
name = "image_segmenter_test_lib", name = "image_segmenter_test_lib",
testonly = True, testonly = True,
@ -40,6 +45,7 @@ mediapipe_ts_library(
], ],
deps = [ deps = [
":image_segmenter", ":image_segmenter",
":image_segmenter_types",
"//mediapipe/framework:calculator_jspb_proto", "//mediapipe/framework:calculator_jspb_proto",
"//mediapipe/tasks/web/core", "//mediapipe/tasks/web/core",
"//mediapipe/tasks/web/core:task_runner_test_utils", "//mediapipe/tasks/web/core:task_runner_test_utils",

View File

@ -17,7 +17,7 @@
import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options'; import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options';
/** Options to configure the MediaPipe Image Segmenter Task */ /** Options to configure the MediaPipe Image Segmenter Task */
export interface ImageSegmenterOptions extends VisionTaskOptions { export declare interface ImageSegmenterOptions extends VisionTaskOptions {
/** /**
* The locale to use for display names specified through the TFLite Model * The locale to use for display names specified through the TFLite Model
* Metadata, if any. Defaults to English. * Metadata, if any. Defaults to English.

View File

@ -1,6 +1,6 @@
# This contains the MediaPipe Interactive Segmenter Task. # This contains the MediaPipe Interactive Segmenter Task.
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library") load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
package(default_visibility = ["//mediapipe/tasks:internal"]) package(default_visibility = ["//mediapipe/tasks:internal"])
@ -11,10 +11,10 @@ mediapipe_ts_library(
name = "interactive_segmenter", name = "interactive_segmenter",
srcs = [ srcs = [
"interactive_segmenter.ts", "interactive_segmenter.ts",
"interactive_segmenter_options.ts",
"interactive_segmenter_result.ts", "interactive_segmenter_result.ts",
], ],
deps = [ deps = [
":interactive_segmenter_types",
"//mediapipe/framework:calculator_jspb_proto", "//mediapipe/framework:calculator_jspb_proto",
"//mediapipe/framework:calculator_options_jspb_proto", "//mediapipe/framework:calculator_options_jspb_proto",
"//mediapipe/tasks/cc/core/proto:base_options_jspb_proto", "//mediapipe/tasks/cc/core/proto:base_options_jspb_proto",
@ -26,7 +26,6 @@ mediapipe_ts_library(
"//mediapipe/tasks/web/vision/core:image_processing_options", "//mediapipe/tasks/web/vision/core:image_processing_options",
"//mediapipe/tasks/web/vision/core:mask", "//mediapipe/tasks/web/vision/core:mask",
"//mediapipe/tasks/web/vision/core:types", "//mediapipe/tasks/web/vision/core:types",
"//mediapipe/tasks/web/vision/core:vision_task_options",
"//mediapipe/tasks/web/vision/core:vision_task_runner", "//mediapipe/tasks/web/vision/core:vision_task_runner",
"//mediapipe/util:color_jspb_proto", "//mediapipe/util:color_jspb_proto",
"//mediapipe/util:render_data_jspb_proto", "//mediapipe/util:render_data_jspb_proto",
@ -34,6 +33,15 @@ mediapipe_ts_library(
], ],
) )
mediapipe_ts_declaration(
name = "interactive_segmenter_types",
srcs = ["interactive_segmenter_options.d.ts"],
deps = [
"//mediapipe/tasks/web/core",
"//mediapipe/tasks/web/vision/core:vision_task_options",
],
)
mediapipe_ts_library( mediapipe_ts_library(
name = "interactive_segmenter_test_lib", name = "interactive_segmenter_test_lib",
testonly = True, testonly = True,

View File

@ -18,7 +18,7 @@
import {TaskRunnerOptions} from '../../../../tasks/web/core/task_runner_options'; import {TaskRunnerOptions} from '../../../../tasks/web/core/task_runner_options';
/** Options to configure the MediaPipe Interactive Segmenter Task */ /** Options to configure the MediaPipe Interactive Segmenter Task */
export interface InteractiveSegmenterOptions extends TaskRunnerOptions { export declare interface InteractiveSegmenterOptions extends TaskRunnerOptions {
/** Whether to output confidence masks. Defaults to true. */ /** Whether to output confidence masks. Defaults to true. */
outputConfidenceMasks?: boolean|undefined; outputConfidenceMasks?: boolean|undefined;

View File

@ -18,5 +18,5 @@ import {ClassifierOptions} from '../../../../tasks/web/core/classifier_options';
import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options'; import {VisionTaskOptions} from '../../../../tasks/web/vision/core/vision_task_options';
/** Options to configure the MediaPipe Object Detector Task */ /** Options to configure the MediaPipe Object Detector Task */
export interface ObjectDetectorOptions extends VisionTaskOptions, export declare interface ObjectDetectorOptions extends VisionTaskOptions,
ClassifierOptions {} ClassifierOptions {}

View File

@ -3,7 +3,7 @@
# This task takes video frames and outputs synchronized frames along with # This task takes video frames and outputs synchronized frames along with
# the detection results for one or more pose categories, using Pose Landmarker. # the detection results for one or more pose categories, using Pose Landmarker.
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library") load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
package(default_visibility = ["//mediapipe/tasks:internal"]) package(default_visibility = ["//mediapipe/tasks:internal"])
@ -14,11 +14,11 @@ mediapipe_ts_library(
name = "pose_landmarker", name = "pose_landmarker",
srcs = [ srcs = [
"pose_landmarker.ts", "pose_landmarker.ts",
"pose_landmarker_options.ts",
"pose_landmarker_result.ts", "pose_landmarker_result.ts",
], ],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
":pose_landmarker_types",
"//mediapipe/framework:calculator_jspb_proto", "//mediapipe/framework:calculator_jspb_proto",
"//mediapipe/framework:calculator_options_jspb_proto", "//mediapipe/framework:calculator_options_jspb_proto",
"//mediapipe/framework/formats:landmark_jspb_proto", "//mediapipe/framework/formats:landmark_jspb_proto",
@ -33,12 +33,17 @@ mediapipe_ts_library(
"//mediapipe/tasks/web/vision/core:image_processing_options", "//mediapipe/tasks/web/vision/core:image_processing_options",
"//mediapipe/tasks/web/vision/core:mask", "//mediapipe/tasks/web/vision/core:mask",
"//mediapipe/tasks/web/vision/core:types", "//mediapipe/tasks/web/vision/core:types",
"//mediapipe/tasks/web/vision/core:vision_task_options",
"//mediapipe/tasks/web/vision/core:vision_task_runner", "//mediapipe/tasks/web/vision/core:vision_task_runner",
"//mediapipe/web/graph_runner:graph_runner_ts", "//mediapipe/web/graph_runner:graph_runner_ts",
], ],
) )
mediapipe_ts_declaration(
name = "pose_landmarker_types",
srcs = ["pose_landmarker_options.d.ts"],
deps = ["//mediapipe/tasks/web/vision/core:vision_task_options"],
)
mediapipe_ts_library( mediapipe_ts_library(
name = "pose_landmarker_test_lib", name = "pose_landmarker_test_lib",
testonly = True, testonly = True,
@ -47,6 +52,7 @@ mediapipe_ts_library(
], ],
deps = [ deps = [
":pose_landmarker", ":pose_landmarker",
":pose_landmarker_types",
"//mediapipe/framework:calculator_jspb_proto", "//mediapipe/framework:calculator_jspb_proto",
"//mediapipe/tasks/web/components/processors:landmark_result", "//mediapipe/tasks/web/components/processors:landmark_result",
"//mediapipe/tasks/web/core", "//mediapipe/tasks/web/core",