Person detector from MediaPipe Pose (#179)
Browse files* Person detector from MediaPipe Pose
* review 2
* cols cols is not cols rows
* Update CMakeLists.txt
---------
Co-authored-by: Yuantao Feng <yuantao.feng@opencv.org.cn>
- CMakeLists.txt +29 -0
- README.md +19 -0
- demo.cpp +0 -0
CMakeLists.txt
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cmake_minimum_required(VERSION 3.24.0)
|
| 2 |
+
set(project_name "opencv_zoo_person_detection_mediapipe")
|
| 3 |
+
|
| 4 |
+
PROJECT (${project_name})
|
| 5 |
+
|
| 6 |
+
set(OPENCV_VERSION "4.7.0")
|
| 7 |
+
set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation")
|
| 8 |
+
find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH})
|
| 9 |
+
# Find OpenCV, you may need to set OpenCV_DIR variable
|
| 10 |
+
# to the absolute path to the directory containing OpenCVConfig.cmake file
|
| 11 |
+
# via the command line or GUI
|
| 12 |
+
|
| 13 |
+
file(GLOB SourceFile
|
| 14 |
+
"demo.cpp")
|
| 15 |
+
# If the package has been found, several variables will
|
| 16 |
+
# be set, you can find the full list with descriptions
|
| 17 |
+
# in the OpenCVConfig.cmake file.
|
| 18 |
+
# Print some message showing some of them
|
| 19 |
+
message(STATUS "OpenCV library status:")
|
| 20 |
+
message(STATUS " config: ${OpenCV_DIR}")
|
| 21 |
+
message(STATUS " version: ${OpenCV_VERSION}")
|
| 22 |
+
message(STATUS " libraries: ${OpenCV_LIBS}")
|
| 23 |
+
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
|
| 24 |
+
|
| 25 |
+
# Declare the executable target built from your sources
|
| 26 |
+
add_executable(${project_name} ${SourceFile})
|
| 27 |
+
|
| 28 |
+
# Link your application with OpenCV libraries
|
| 29 |
+
target_link_libraries(${project_name} PRIVATE ${OpenCV_LIBS})
|
README.md
CHANGED
|
@@ -9,6 +9,8 @@ SSD Anchors are generated from [GenMediaPipePalmDectionSSDAnchors](https://githu
|
|
| 9 |
|
| 10 |
## Demo
|
| 11 |
|
|
|
|
|
|
|
| 12 |
Run the following commands to try the demo:
|
| 13 |
|
| 14 |
```bash
|
|
@@ -21,6 +23,23 @@ python demo.py -i /path/to/image -v
|
|
| 21 |
python demo.py --help
|
| 22 |
```
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
### Example outputs
|
| 25 |
|
| 26 |

|
|
|
|
| 9 |
|
| 10 |
## Demo
|
| 11 |
|
| 12 |
+
### Python
|
| 13 |
+
|
| 14 |
Run the following commands to try the demo:
|
| 15 |
|
| 16 |
```bash
|
|
|
|
| 23 |
python demo.py --help
|
| 24 |
```
|
| 25 |
|
| 26 |
+
### C++
|
| 27 |
+
|
| 28 |
+
Install latest OpenCV and CMake >= 3.24.0 to get started with:
|
| 29 |
+
|
| 30 |
+
```shell
|
| 31 |
+
# A typical and default installation path of OpenCV is /usr/local
|
| 32 |
+
cmake -B build -D OPENCV_INSTALLATION_PATH=/path/to/opencv/installation .
|
| 33 |
+
cmake --build build
|
| 34 |
+
|
| 35 |
+
# detect on camera input
|
| 36 |
+
./build/opencv_zoo_person_detection_mediapipe
|
| 37 |
+
# detect on an image
|
| 38 |
+
./build/opencv_zoo_person_detection_mediapipe -m=/path/to/model -i=/path/to/image -v
|
| 39 |
+
# get help messages
|
| 40 |
+
./build/opencv_zoo_person_detection_mediapipe -h
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
### Example outputs
|
| 44 |
|
| 45 |

|
demo.cpp
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|