Skip to content

Commit

Permalink
Add helper to create Connection array
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 565706612
  • Loading branch information
schmidt-sebastian authored and copybara-github committed Sep 15, 2023
1 parent 4a8a811 commit 30590fe
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 948 deletions.
6 changes: 3 additions & 3 deletions mediapipe/tasks/web/vision/core/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This package contains options shared by all MediaPipe Vision Tasks for Web.

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")

package(default_visibility = ["//mediapipe/tasks:internal"])

Expand All @@ -21,9 +21,9 @@ mediapipe_ts_declaration(
],
)

mediapipe_ts_declaration(
mediapipe_ts_library(
name = "types",
srcs = ["types.d.ts"],
srcs = ["types.ts"],
deps = [
"//mediapipe/tasks/web/components/containers:keypoint",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ export declare interface Connection {
start: number;
end: number;
}

/** Converts a list of connection in array notation to a list of Connections. */
export function convertToConnections(...connections: Array<[number, number]>):
Connection[] {
return connections.map(([start, end]) => ({start, end}));
}
Loading

0 comments on commit 30590fe

Please sign in to comment.