Skip to content

Instantly share code, notes, and snippets.

@ZhangMenghe
Last active January 14, 2020 23:11
Show Gist options
  • Select an option

  • Save ZhangMenghe/08690335ac72159abaf27afcb202c07a to your computer and use it in GitHub Desktop.

Select an option

Save ZhangMenghe/08690335ac72159abaf27afcb202c07a to your computer and use it in GitHub Desktop.
Build MediaPipe

Install MediaPipe

  • Follow the stepsHERE
  • Can build the Brazel project for both desktop and Android:
    • ubuntu $ bazel build -c opt \ --define MEDIAPIPE_DISABLE_GPU=1 \ --define no_aws_support=true \ mediapipe/examples/desktop/object_detection:object_detection_tensorflow and then $ GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/object_detection/object_detection_tensorflow \ --calculator_graph_config_file=mediapipe/graphs/object_detection/object_detection_desktop_tensorflow_graph.pbtxt \ --input_side_packets=input_video_path=<input video path>,output_video_path=<output video path>

    • android bazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/objectdetectiongpu:objectdetectiongpu

    • My own example bazel-bin/mediapipe/examples/desktop/orb_slam/orb_slam

  • MainActivity is the only Java interface that is different for each program. Use camera setting to start camera here(front/end)
  • Use Brazel BUILD file to config as CMakeLists, so dependencies are clear here.
  • Import -> Config -> Sync -> Run. Refer to the document

Other Notes

  1. Java environment problem, update local JDK or refer to this post
  2. ffmpeg error
  3. Opencv should be 4.0+
@ZhangMenghe
Copy link
Author

Graph

In the folder graphs, *.pbtxt defines a bunch of graphs that can be used. Visualize them HERE.

  1. A graph can have a bunch of subgraphs
  2. The difference between graphs with _gpu or _cpu could be minimal. In most cases, just use_gpu flag that can be sent to calculators.

@ZhangMenghe
Copy link
Author

Calculators

In the folder calculators. Only *.cc is needed because REGISTER_CALCULATOR(LuminanceCalculator); Then LuminanceCalculator can be used in *.pbtxt as a node of a graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment