Skip to content

Commit

Permalink
Feat: Add C++ demo for Palm Detection (#282)
Browse files Browse the repository at this point in the history
* add cpp demo for palm detection

* add all anchor points

* remove HandDetector class

* refactor code
  • Loading branch information
souhhmm authored Jan 10, 2025
1 parent a988f33 commit 80711ad
Show file tree
Hide file tree
Showing 3 changed files with 2,409 additions and 0 deletions.
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

0 comments on commit 80711ad

Please sign in to comment.