Do not depend on *.ts files in ts_declaration

PiperOrigin-RevId: 530435849
This commit is contained in:
Sebastian Schmidt 2023-05-08 16:18:00 -07:00 committed by Copybara-Service
parent ee8d0383d6
commit 65cb5f4e6b
9 changed files with 26 additions and 56 deletions

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_declaration", "mediapipe_ts_library") load("//mediapipe/framework/port:build_config.bzl", "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"])
@ -9,9 +9,12 @@ licenses(["notice"])
mediapipe_ts_library( mediapipe_ts_library(
name = "image_segmenter", name = "image_segmenter",
srcs = ["image_segmenter.ts"], srcs = [
"image_segmenter.ts",
"image_segmenter_options.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",
@ -19,27 +22,16 @@ mediapipe_ts_library(
"//mediapipe/tasks/cc/vision/image_segmenter/proto:image_segmenter_graph_options_jspb_proto", "//mediapipe/tasks/cc/vision/image_segmenter/proto:image_segmenter_graph_options_jspb_proto",
"//mediapipe/tasks/cc/vision/image_segmenter/proto:segmenter_options_jspb_proto", "//mediapipe/tasks/cc/vision/image_segmenter/proto:segmenter_options_jspb_proto",
"//mediapipe/tasks/web/core", "//mediapipe/tasks/web/core",
"//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: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",
"image_segmenter_result.d.ts",
],
deps = [
"//mediapipe/tasks/web/core",
"//mediapipe/tasks/web/core:classifier_options",
"//mediapipe/tasks/web/vision/core:mask",
"//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,
@ -48,7 +40,6 @@ 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

@ -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_declaration", "mediapipe_ts_library") load("//mediapipe/framework/port:build_config.bzl", "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"])
@ -9,9 +9,12 @@ licenses(["notice"])
mediapipe_ts_library( mediapipe_ts_library(
name = "interactive_segmenter", name = "interactive_segmenter",
srcs = ["interactive_segmenter.ts"], srcs = [
"interactive_segmenter.ts",
"interactive_segmenter_options.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",
@ -19,8 +22,11 @@ mediapipe_ts_library(
"//mediapipe/tasks/cc/vision/image_segmenter/proto:segmenter_options_jspb_proto", "//mediapipe/tasks/cc/vision/image_segmenter/proto:segmenter_options_jspb_proto",
"//mediapipe/tasks/web/components/containers:keypoint", "//mediapipe/tasks/web/components/containers:keypoint",
"//mediapipe/tasks/web/core", "//mediapipe/tasks/web/core",
"//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: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",
@ -28,20 +34,6 @@ mediapipe_ts_library(
], ],
) )
mediapipe_ts_declaration(
name = "interactive_segmenter_types",
srcs = [
"interactive_segmenter_options.d.ts",
"interactive_segmenter_result.d.ts",
],
deps = [
"//mediapipe/tasks/web/core",
"//mediapipe/tasks/web/core:classifier_options",
"//mediapipe/tasks/web/vision/core:mask",
"//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,
@ -50,7 +42,6 @@ mediapipe_ts_library(
], ],
deps = [ deps = [
":interactive_segmenter", ":interactive_segmenter",
":interactive_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

@ -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_declaration", "mediapipe_ts_library") load("//mediapipe/framework/port:build_config.bzl", "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"])
@ -12,10 +12,13 @@ licenses(["notice"])
mediapipe_ts_library( mediapipe_ts_library(
name = "pose_landmarker", name = "pose_landmarker",
srcs = ["pose_landmarker.ts"], srcs = [
"pose_landmarker.ts",
"pose_landmarker_options.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",
@ -28,28 +31,14 @@ mediapipe_ts_library(
"//mediapipe/tasks/web/components/processors:landmark_result", "//mediapipe/tasks/web/components/processors:landmark_result",
"//mediapipe/tasks/web/core", "//mediapipe/tasks/web/core",
"//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: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",
"pose_landmarker_result.d.ts",
],
visibility = ["//visibility:public"],
deps = [
"//mediapipe/tasks/web/components/containers:category",
"//mediapipe/tasks/web/components/containers:landmark",
"//mediapipe/tasks/web/core",
"//mediapipe/tasks/web/vision/core:mask",
"//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,
@ -58,7 +47,6 @@ 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",