mediapipe
mediapipe copied to clipboard
What is the correct way to modify a subgraph or calculator?
System information (Please provide as much relevant information as possible)
- macOS 12.4 M1
- Bazel version: 5.0.0
- Pose tracking
- Building for android
Describe the expected behavior:
I wanted to remove the bounding box red rectangle in the PoseRendererGpu, so I commented out the line 290 of https://github.com/google/mediapipe/blob/master/mediapipe/graphs/pose_tracking/subgraphs/pose_renderer_gpu.pbtxt and also removed the RectToRenderDataCalculator calculator and ran the below command to rebuild the binary graph
bazel build -c opt --strip=ALWAYS --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --fat_apk_cpu=arm64-v8a,armeabi-v7a mediapipe/graphs/pose_tracking:pose_tracking_gpu_binary_graph
But this does not have any effect on the output. Any changes that I make to the main graph (https://github.com/google/mediapipe/blob/master/mediapipe/graphs/pose_tracking/pose_tracking_gpu.pbtxt) are reflected but changes to the subgraph do not seem to change the output of the image. I even tried to just change the colors of the landmark and there was no effect on the output. I have also tried to build the subgraph separately as well using
bazel build -c opt --strip=ALWAYS --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --fat_apk_cpu=arm64-v8a,armeabi-v7a mediapipe/graphs/pose_tracking/subgraphs:pose_renderer_gpu
But there was no output change even though the builds were successful and the .binarypb file was updated in the assets of the android project every time.
What am I doing wrong?
I also checked #2788, it has no solutions to the problem.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.
Closing as stale. Please reopen if you'd like to work on this further.
@AthreshK You can achieve that by commenting out
if (cc->Inputs().HasTag(kRectsTag) &&
!cc->Inputs().Tag(kRectsTag).IsEmpty()) {
const auto& rects = cc->Inputs().Tag(kRectsTag).Get<std::vector<Rect>>();
for (auto& rect : rects) {
auto* rectangle = NewRect(options_, render_data.get());
SetRect(/*normalized=*/false, rect.x_center() - rect.width() / 2.f,
rect.y_center() - rect.height() / 2.f, rect.width(),
rect.height(), rect.rotation(), rectangle);
}
}
https://github.com/google/mediapipe/blob/dbd6d72696d195d3e5358f7a9a081fc2fc9d1a72/mediapipe/calculators/util/rect_to_render_data_calculator.cc#LL187C3-L196C4
Hello @AthreshK, We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediapPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.
You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions. Thank you
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.