Project import generated by Copybara.
PiperOrigin-RevId: 253721185
This commit is contained in:
		
							parent
							
								
									e647b361e7
								
							
						
					
					
						commit
						981c23fc73
					
				| 
						 | 
					@ -55,7 +55,7 @@ Required libraries
 | 
				
			||||||
    Option 1. Use package manager tool to install the pre-compiled OpenCV
 | 
					    Option 1. Use package manager tool to install the pre-compiled OpenCV
 | 
				
			||||||
    libraries.
 | 
					    libraries.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Note that Debian 9 and Ubuntu 16.04 provide OpenCV 2.4.9. You may want to
 | 
					    Note: Debian 9 and Ubuntu 16.04 provide OpenCV 2.4.9. You may want to
 | 
				
			||||||
    take option 2 or 3 to install OpenCV 3 or above.
 | 
					    take option 2 or 3 to install OpenCV 3 or above.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ```bash
 | 
					    ```bash
 | 
				
			||||||
| 
						 | 
					@ -70,11 +70,11 @@ Required libraries
 | 
				
			||||||
    [documentation](https://docs.opencv.org/3.4.6/d7/d9f/tutorial_linux_install.html)
 | 
					    [documentation](https://docs.opencv.org/3.4.6/d7/d9f/tutorial_linux_install.html)
 | 
				
			||||||
    to manually build OpenCV from source code.
 | 
					    to manually build OpenCV from source code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    You may need to modify [`WORKSAPCE`] and [`opencv_linux.BUILD`] to point
 | 
					    Note: You may need to modify [`WORKSAPCE`] and [`opencv_linux.BUILD`] to point
 | 
				
			||||||
    MediaPipe to your own OpenCV libraries. For example, if OpenCV 4 is
 | 
					    MediaPipe to your own OpenCV libraries, e.g., if OpenCV 4 is
 | 
				
			||||||
    installed in "/usr/local/", you need to update the "linux_opencv"
 | 
					    installed in "/usr/local/", you need to update the "linux_opencv"
 | 
				
			||||||
    new_local_repository rule in [`WORKSAPCE`] and "opencv" cc_library rule in
 | 
					    new_local_repository rule in [`WORKSAPCE`] and "opencv" cc_library rule in
 | 
				
			||||||
    [`opencv_linux.BUILD`] to be:
 | 
					    [`opencv_linux.BUILD`] like the following:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ```bash
 | 
					    ```bash
 | 
				
			||||||
    new_local_repository(
 | 
					    new_local_repository(
 | 
				
			||||||
| 
						 | 
					@ -145,7 +145,7 @@ Required libraries
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Option 1. Use package manager tool to install the pre-compiled version.
 | 
					    Option 1. Use package manager tool to install the pre-compiled version.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Note that yum installs OpenCV 2.4.5, which may have an opencv/gstreamer
 | 
					    Note: yum installs OpenCV 2.4.5, which may have an opencv/gstreamer
 | 
				
			||||||
    [issue](https://github.com/opencv/opencv/issues/4592).
 | 
					    [issue](https://github.com/opencv/opencv/issues/4592).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ```bash
 | 
					    ```bash
 | 
				
			||||||
| 
						 | 
					@ -154,11 +154,11 @@ Required libraries
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Option 2. Build OpenCV from source code.
 | 
					    Option 2. Build OpenCV from source code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    You may need to modify [`WORKSAPCE`] and [`opencv_linux.BUILD`] to point
 | 
					    Note: You may need to modify [`WORKSAPCE`] and [`opencv_linux.BUILD`] to point
 | 
				
			||||||
    MediaPipe to your own OpenCV libraries. For example, if OpenCV 4 is
 | 
					    MediaPipe to your own OpenCV libraries, e.g., if OpenCV 4 is
 | 
				
			||||||
    installed in "/usr/local/", you need to update the "linux_opencv"
 | 
					    installed in "/usr/local/", you need to update the "linux_opencv"
 | 
				
			||||||
    new_local_repository rule in [`WORKSAPCE`] and "opencv" cc_library rule in
 | 
					    new_local_repository rule in [`WORKSAPCE`] and "opencv" cc_library rule in
 | 
				
			||||||
    [`opencv_linux.BUILD`] to be:
 | 
					    [`opencv_linux.BUILD`] like the following:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ```bash
 | 
					    ```bash
 | 
				
			||||||
    new_local_repository(
 | 
					    new_local_repository(
 | 
				
			||||||
| 
						 | 
					@ -234,12 +234,48 @@ Required libraries
 | 
				
			||||||
 | 
					
 | 
				
			||||||
3.  Install OpenCV
 | 
					3.  Install OpenCV
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Use package manager tool to install the pre-compiled OpenCV libraries.
 | 
					    Option 1. Use HomeBrew package manager tool to install the pre-compiled
 | 
				
			||||||
 | 
					    OpenCV libraries.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ```bash
 | 
					    ```bash
 | 
				
			||||||
    $ brew install opencv
 | 
					    $ brew install opencv
 | 
				
			||||||
    ```
 | 
					    ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Option 2. Use MacPorts package manager tool to install the OpenCV libraries.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ```bash
 | 
				
			||||||
 | 
					    $ port install opencv
 | 
				
			||||||
 | 
					    ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Note: when using MacPorts, please edit the [`WORKSAPCE`] and
 | 
				
			||||||
 | 
					    [`opencv_linux.BUILD`] files like the following:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ```bash
 | 
				
			||||||
 | 
					    new_local_repository(
 | 
				
			||||||
 | 
					      name = "macos_opencv",
 | 
				
			||||||
 | 
					      build_file = "@//third_party:opencv_macos.BUILD",
 | 
				
			||||||
 | 
					      path = "/opt",
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    cc_library(
 | 
				
			||||||
 | 
					      name = "opencv",
 | 
				
			||||||
 | 
					      srcs = glob(
 | 
				
			||||||
 | 
					        [
 | 
				
			||||||
 | 
					            "local/lib/libopencv_core.dylib",
 | 
				
			||||||
 | 
					            "local/lib/libopencv_highgui.dylib",
 | 
				
			||||||
 | 
					            "local/lib/libopencv_imgcodecs.dylib",
 | 
				
			||||||
 | 
					            "local/lib/libopencv_imgproc.dylib",
 | 
				
			||||||
 | 
					            "local/lib/libopencv_video.dylib",
 | 
				
			||||||
 | 
					            "local/lib/libopencv_videoio.dylib",
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					      hdrs = glob(["local/include/opencv2/**/*.h*"]),
 | 
				
			||||||
 | 
					      includes = ["local/include/"],
 | 
				
			||||||
 | 
					      linkstatic = 1,
 | 
				
			||||||
 | 
					      visibility = ["//visibility:public"],
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
4.  Run the hello world desktop example
 | 
					4.  Run the hello world desktop example
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ```bash
 | 
					    ```bash
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,6 +15,7 @@
 | 
				
			||||||
#include "mediapipe/framework/profiler/graph_profiler.h"
 | 
					#include "mediapipe/framework/profiler/graph_profiler.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "absl/synchronization/mutex.h"
 | 
					#include "absl/synchronization/mutex.h"
 | 
				
			||||||
 | 
					#include "absl/time/time.h"
 | 
				
			||||||
#include "mediapipe/framework/calculator_framework.h"
 | 
					#include "mediapipe/framework/calculator_framework.h"
 | 
				
			||||||
#include "mediapipe/framework/mediapipe_profiling.h"
 | 
					#include "mediapipe/framework/mediapipe_profiling.h"
 | 
				
			||||||
#include "mediapipe/framework/port/core_proto_inc.h"
 | 
					#include "mediapipe/framework/port/core_proto_inc.h"
 | 
				
			||||||
| 
						 | 
					@ -674,7 +675,7 @@ TEST_F(GraphProfilerTestPeer, SetOpenRuntimeWithStreamLatency) {
 | 
				
			||||||
  source_context.AddOutputs(
 | 
					  source_context.AddOutputs(
 | 
				
			||||||
      {{}, {MakePacket<std::string>("15").At(Timestamp(100))}});
 | 
					      {{}, {MakePacket<std::string>("15").At(Timestamp(100))}});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  simulation_clock->SleepUntil(base::FromUnixMicros(1000));
 | 
					  simulation_clock->SleepUntil(absl::FromUnixMicros(1000));
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    GraphProfiler::Scope profiler_scope(GraphTrace::OPEN, source_context.get(),
 | 
					    GraphProfiler::Scope profiler_scope(GraphTrace::OPEN, source_context.get(),
 | 
				
			||||||
                                        &profiler_);
 | 
					                                        &profiler_);
 | 
				
			||||||
| 
						 | 
					@ -775,7 +776,7 @@ TEST_F(GraphProfilerTestPeer, SetCloseRuntimeWithStreamLatency) {
 | 
				
			||||||
      {{MakePacket<std::string>("15").At(Timestamp::PostStream())}});
 | 
					      {{MakePacket<std::string>("15").At(Timestamp::PostStream())}});
 | 
				
			||||||
  CalculatorContextManager().PushInputTimestampToContext(
 | 
					  CalculatorContextManager().PushInputTimestampToContext(
 | 
				
			||||||
      source_context.get(), Timestamp::PostStream());
 | 
					      source_context.get(), Timestamp::PostStream());
 | 
				
			||||||
  simulation_clock->SleepUntil(base::FromUnixMicros(1000));
 | 
					  simulation_clock->SleepUntil(absl::FromUnixMicros(1000));
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    GraphProfiler::Scope profiler_scope(GraphTrace::CLOSE, source_context.get(),
 | 
					    GraphProfiler::Scope profiler_scope(GraphTrace::CLOSE, source_context.get(),
 | 
				
			||||||
                                        &profiler_);
 | 
					                                        &profiler_);
 | 
				
			||||||
| 
						 | 
					@ -973,7 +974,7 @@ TEST_F(GraphProfilerTestPeer, AddProcessSampleWithStreamLatency) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int64 when_source_started = 1000;
 | 
					  int64 when_source_started = 1000;
 | 
				
			||||||
  int64 when_source_finished = when_source_started + 150;
 | 
					  int64 when_source_finished = when_source_started + 150;
 | 
				
			||||||
  simulation_clock->SleepUntil(base::FromUnixMicros(when_source_started));
 | 
					  simulation_clock->SleepUntil(absl::FromUnixMicros(when_source_started));
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    GraphProfiler::Scope profiler_scope(GraphTrace::PROCESS,
 | 
					    GraphProfiler::Scope profiler_scope(GraphTrace::PROCESS,
 | 
				
			||||||
                                        source_context.get(), &profiler_);
 | 
					                                        source_context.get(), &profiler_);
 | 
				
			||||||
| 
						 | 
					@ -1006,7 +1007,7 @@ TEST_F(GraphProfilerTestPeer, AddProcessSampleWithStreamLatency) {
 | 
				
			||||||
  consumer_context.AddInputs(
 | 
					  consumer_context.AddInputs(
 | 
				
			||||||
      {Packet(), MakePacket<std::string>("15").At(Timestamp(100))});
 | 
					      {Packet(), MakePacket<std::string>("15").At(Timestamp(100))});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  simulation_clock->SleepUntil(base::FromUnixMicros(2000));
 | 
					  simulation_clock->SleepUntil(absl::FromUnixMicros(2000));
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    GraphProfiler::Scope profiler_scope(GraphTrace::PROCESS,
 | 
					    GraphProfiler::Scope profiler_scope(GraphTrace::PROCESS,
 | 
				
			||||||
                                        consumer_context.get(), &profiler_);
 | 
					                                        consumer_context.get(), &profiler_);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user