Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add C++ demo for Palm Detection #282

Merged
merged 5 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions models/palm_detection_mediapipe/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.24.0)
project(opencv_zoo_qrcode_wechatqrcode)

set(OPENCV_VERSION "4.10.0")
set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation")

# Find OpenCV
find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH})

add_executable(demo demo.cpp)
target_link_libraries(demo ${OpenCV_LIBS})
19 changes: 19 additions & 0 deletions models/palm_detection_mediapipe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ SSD Anchors are generated from [GenMediaPipePalmDectionSSDAnchors](https://githu

## Demo

### Python

Run the following commands to try the demo:

```bash
Expand All @@ -25,6 +27,23 @@ python demo.py -i /path/to/image -v
python demo.py --help
```

### C++

Install latest OpenCV (with opencv_contrib) and CMake >= 3.24.0 to get started with:

```shell
# A typical and default installation path of OpenCV is /usr/local
cmake -B build -D OPENCV_INSTALLATION_PATH=/path/to/opencv/installation .
cmake --build build

# detect on camera input
./build/demo
# detect on an image
./build/demo -i=/path/to/image -v
# get help messages
./build/demo -h
```

### Example outputs

![webcam demo](./example_outputs/mppalmdet_demo.gif)
Expand Down
Loading