Skip to content

Commit 80711ad

Browse files
authored
Feat: Add C++ demo for Palm Detection (#282)
* add cpp demo for palm detection * add all anchor points * remove HandDetector class * refactor code
1 parent a988f33 commit 80711ad

File tree

3 files changed

+2409
-0
lines changed

3 files changed

+2409
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.24.0)
2+
project(opencv_zoo_qrcode_wechatqrcode)
3+
4+
set(OPENCV_VERSION "4.10.0")
5+
set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation")
6+
7+
# Find OpenCV
8+
find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH})
9+
10+
add_executable(demo demo.cpp)
11+
target_link_libraries(demo ${OpenCV_LIBS})

models/palm_detection_mediapipe/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ SSD Anchors are generated from [GenMediaPipePalmDectionSSDAnchors](https://githu
1313

1414
## Demo
1515

16+
### Python
17+
1618
Run the following commands to try the demo:
1719

1820
```bash
@@ -25,6 +27,23 @@ python demo.py -i /path/to/image -v
2527
python demo.py --help
2628
```
2729

30+
### C++
31+
32+
Install latest OpenCV (with opencv_contrib) and CMake >= 3.24.0 to get started with:
33+
34+
```shell
35+
# A typical and default installation path of OpenCV is /usr/local
36+
cmake -B build -D OPENCV_INSTALLATION_PATH=/path/to/opencv/installation .
37+
cmake --build build
38+
39+
# detect on camera input
40+
./build/demo
41+
# detect on an image
42+
./build/demo -i=/path/to/image -v
43+
# get help messages
44+
./build/demo -h
45+
```
46+
2847
### Example outputs
2948

3049
![webcam demo](./example_outputs/mppalmdet_demo.gif)

0 commit comments

Comments
 (0)