Skip to content

Commit

Permalink
feat: read .binarypb
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed May 2, 2021
1 parent 473c3a0 commit 3ca8642
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public abstract class ResourceManager {
var extension = Path.GetExtension(assetPath);

switch (extension) {
case ".binarypb":
case ".tflite": {
return $"{assetName}.bytes";
}
Expand Down
2 changes: 1 addition & 1 deletion mediapipe_api/import_model.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ _normalize_exts = rule(
implementation = _normalize_exts_impl,
attrs = {
"srcs": attr.label_list(allow_files = True),
"bytes_exts": attr.string_list(default = ["jpg", "png", "tflite", "uuu"]),
"bytes_exts": attr.string_list(default = ["binarypb", "jpg", "png", "tflite", "uuu"]),
"txt_exts": attr.string_list(default = ["pbtxt"]),
},
)
12 changes: 12 additions & 0 deletions third_party/mediapipe_model_path.diff
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
diff --git a/mediapipe/framework/encode_binary_proto.bzl b/mediapipe/framework/encode_binary_proto.bzl
index 3af435f..5a4a4a1 100644
--- a/mediapipe/framework/encode_binary_proto.bzl
+++ b/mediapipe/framework/encode_binary_proto.bzl
@@ -104,6 +104,7 @@ def _encode_binary_proto_impl(ctx):
"--encode=" + ctx.attr.message_type,
"--proto_path=" + ctx.genfiles_dir.path,
"--proto_path=" + ctx.bin_dir.path,
+ "--proto_path=" + ctx.file.input.owner.workspace_root,
"--proto_path=.",
] + path_list + file_list +
["<", textpb.path, ">", binarypb.path],
diff --git a/mediapipe/graphs/object_detection_3d/calculators/BUILD b/mediapipe/graphs/object_detection_3d/calculators/BUILD
index 8f80312..45b8c53 100644
--- a/mediapipe/graphs/object_detection_3d/calculators/BUILD
Expand Down

0 comments on commit 3ca8642

Please sign in to comment.