---
title: "Discussion on \"Python API for the MediaPipe Object Detection Solution\" | Hashnode"
description: "Discussion on \"Python API for the MediaPipe Object Detection Solution\". Task 1 (GSoC 2021)"
url: "https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python API for the MediaPipe Object Detection Solution](https://blog.aniketray.me/python-api-for-the-mediapipe-object-detection-solution?utm_source=hashnode&utm_medium=feed)

Task 1 (GSoC 2021)

Aug 19, 2021 · 2 min read · blog.aniketray.me  
Updated Oct 11, 2021  
Read the article

## Written by

[Aniket Ray](https://hashnode.com/@aniket-ray)

@aniket-ray · India

  
[View profile](https://hashnode.com/@aniket-ray)

Software Developer

## Responses 4

Markdown supported · ⌘↵ to post

[Thomas](https://hashnode.com/@Thomass)

[Jan 24, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61eec7fcc99aed184e7275f9)

Hi finally managed to compile the hello world example. Now compiled object\_detection:object\_detection\_cpu. How do i run it?

I tried this:

```
C:\_Research\mediapipe-od-build\mediapipe\bazel-bin\mediapipe\examples\desktop\object_detection>object_detection_cpu.exe --calculator_graph_config_file=C:\_Research\mediapipe-od-build\mediapipe\mediapipe\modules\object_detection\object_detection_cpu.pbtxt
E20220124 16:58:32.190173  1836 demo_run_graph_main.cc:154] Failed to run the graph: ValidatedGraphConfig Initialization failed.
No registered object with name: DetectionLetterboxRemovalCalculator; Unable to find Calculator "DetectionLetterboxRemovalCalculator"
```

[Thomas](https://hashnode.com/@Thomass)

[Jan 24, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61eec7fcc99aed184e7275f9#reply-61eed671c99aed184e72782f)

I am using pycharm with the official mediapipe package and all solutions work just fine. is there a way to add your object detection part manually to the package?

I am not giving up yet:) but its pretty frustrating.

Also i can not find the binarypb file for object detection created anywhere. When building other examples like pose or hand there are also binarypb files created in bazel-out modules folder.

[Thomas](https://hashnode.com/@Thomass)

[Jan 21, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61eae93c540e877a6c00c4e6)

I got rid of the initial errors but now stuck at some more: Any Idea? I do not even see what seems to be the problem:(

```
ERROR: C:/users/user/_bazel_user/o7dgz4zy/external/com_google_absl/absl/debugging/BUILD.bazel:31:11: Compiling absl/debugging/stacktrace.cc failed: (Exit 2): cl.exe failed: error executing command C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 41 argument(s) skipped)
```

[Aniket Ray](https://hashnode.com/@aniket-ray)

[Jan 22, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61eae93c540e877a6c00c4e6#reply-61ebd8db5fbc177f9f3b4209)

It seems like a Windows problem with the C++ compiler and I don't have access to a Windows Machine currently. You may try opening an issue on [Mediapipe Issue Tracker](https://github.com/google/mediapipe/issues)

[Thomas](https://hashnode.com/@Thomass)

[Jan 24, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61eae93c540e877a6c00c4e6#reply-61eeb0e5e247b2151e61c760)

[Aniket Ray](https://hashnode.com/@aniketiq) yes. i have added like everything c++ related to vs build tools but seems thee is still something missing :( like: windows.h

[Thomas](https://hashnode.com/@Thomass)

[Jan 13, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61e059e3ffa55d74f0089db6)

Is there a more detailed description of how to get this to run? I cloned your repo and followed [Installing on Windows](https://google.github.io/mediapipe/getting_started/install.html#installing-on-windows)

On Step 9 the bazel build throws some errors: "GET returned 404 Not Found" So the files are not online anymore. I wonder if i am following the right path anyway.

Thanks in advance for any hints :)

```
c:\mediapipe-test\mediapipe>C:\Bazel\bazel.exe build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://python39//python.exe" mediapipe/examples/desktop/hello_world
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e"
DEBUG: Repository rules_foreign_cc instantiated at:
  C:/mediapipe-test/mediapipe/WORKSPACE:42:13: in <toplevel>
Repository rule http_archive defined at:
  C:/users/user/_bazel_user/r4ook2nm/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in <toplevel>
WARNING: Download from http://mirror.tensorflow.org/github.com/tensorflow/toolchains/archive/d781e89e2ee797ea7afd0c8391e761616fc5d50d.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from http://mirror.tensorflow.org/github.com/tensorflow/runtime/archive/0a8c6996bd6a58eb0e7e2fe049ac67bf663e1950.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: C:/users/user/_bazel_user/r4ook2nm/external/org_tensorflow/third_party/repo.bzl:109:14:
Warning: skipping import of repository 'pybind11' because it already exists.
ERROR: C:/mediapipe-test/mediapipe/WORKSPACE:266:23: fetching android_ndk_repository rule //external:androidndk: Either the path attribute of android_ndk_repository or the ANDROID_NDK_HOME environment variable must be set.
ERROR: Analysis of target '//mediapipe/examples/desktop/hello_world:hello_world' failed; build aborted: Either the path attribute of android_ndk_repository or the ANDROID_NDK_HOME environment variable must be set.
INFO: Elapsed time: 42.124s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (7 packages loaded, 11 targets configured)
    Fetching @local_execution_config_python; fetching
```

[Aniket Ray](https://hashnode.com/@aniket-ray)

[Jan 14, 2022](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61e059e3ffa55d74f0089db6#reply-61e0c8b2d546507ab0341a92)

Can you please try [#70](https://github.com/google/mediapipe/issues/70) and [#5013](https://github.com/bazelbuild/bazel/issues/5013) and let me know if this fixes your issue?

Also, make sure the ENV variables are correctly pointing to the locations.

[manthan choudhury](https://hashnode.com/@Soulleo007)

[Dec 6, 2021](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61ada3ceb6bca85a26d3f177)

i want object detection for my project but not working for me can u pls help .

mp\_object\_detection = mp.solutions.object\_detection

its showing error here.

[Aniket Ray](https://hashnode.com/@aniket-ray)

[Dec 6, 2021](https://hashnode.com/posts/python-api-for-the-mediapipe-object-detection-solution/611ebdd4a5d08237f40dd4fb/comment/61ada3ceb6bca85a26d3f177#reply-61ae484d9dc5a836391bb1ef)

Hi! Can you please post the log output for the error?
