opencv_zoo
opencv_zoo copied to clipboard
Add C++ demos (Updated on 2024-06-03)
We have provided at least one easy and clean Python demo for every model here in the zoo. As described in https://github.com/opencv/opencv_zoo/issues/132, Python demos sometimes can be too concise to be converted to other languages, such as C++. Hence, we decide to add C++ demos as well but they should be clean and simple enough to show how to run inference and get expected output with OpenCV.
We welcome contributions from community. Please take a look at the list below and leave comments for application or discussion before you start to dive in coding.
| Status | Task | Models |
|---|---|---|
| ✅ Done #138 | Face Detection | YuNet |
| ✅ Done #259 | Face Recognition | SFace |
| ✅ Done #177 | Object Detection | YOLOX |
| ✅ Done #232 | Object Detection | NanoDet |
| ✅ Done #175 | Text Detection | DB |
| ✅ Done #176 | Text Recognition | CRNN (CN) |
| ✅ Done #176 | Text Recognition | CRNN (EN) |
| ✅ Done #176 | Text Recognition | CRNN (CH) |
| ✅ Done #241 | Image Classification | PP-ResNet50 |
| ✅ Done #171 | Image Classification | MobileNet V1 |
| ✅ Done #171 | Image Classification | MobileNet V2 |
| ✅ Done #243 | Human Segmentation | PP-HumanSeg |
| ✅ Done #279 | QR Code Detection / Parsing | WeChatQRCode |
| ✅ Done #277 | Person Re-Identification | YoutuReID |
| ✅ Done #282 | Palm Detection | MP-PalmDet |
| ❗️ Need Contribution | Hand Pose Estimation | MP-HandPose |
| ✅ Done #179 | Person Detection | MP-PersonDet |
| ✅ Done #186 | Pose Estimation | MP-Pose |
| ✅ Done #233 | Facial Expression Recognition | FER |
| ✅ Done #240 | Object Tracking | VitTrack |
handpose_estimation_mediapipe. please Thank you so much.
If we revive DNN backend in G-API, it may make sense to write the C++ demos directly in G-API to combine Video, NN, Pre&Post processing all in the same pipeline effectively. Additional points to OpenCV as an application framework. What do you think?
cc: @vpisarev
It would be good to provide additional demos in G-API to construct a complete end-to-end pipeline. But first we need to have DNN backend in G-API, which is not implemented yet right?
cc @ShiqiYu
@fengyuentau I can manage MobileNet V1 Are you agree?
@LaurentBerger No problems. Pull requests are welcome.
About DaSiamRPN there is already an example Model source: opencv/samples/dnn/diasiamrpn_tracker.cpp
About DaSiamRPN there is already an example Model source: opencv/samples/dnn/diasiamrpn_tracker.cpp
Yes, but we are going to replace it. We have two GSoC projects ongoing for training a better but also lighter object trackers.
Yes, but we are going to replace it. We have two GSoC projects ongoing for training a better but also lighter object trackers.
May be it should be mark as in progress
handpose_estimation_mediapipe. please Thank you so much.
It's finished here https://github.com/LaurentBerger/opencv_zoo/tree/handpose and here https://github.com/LaurentBerger/opencv_zoo/tree/ @kekxv
Hello @fengyuentau , I'm relatively new to open-sourced contributions but I'd love to start contributing to OpenCV / OpenCV-Zoo. I have experience in C++ and Python, applied to ML/CV/Robotics. Are these demos a good starting point for me? Or are there simpler projects that you recommend I get started with? Is it safe to assume that the corresponding task from #119 needs to be completed before the demo?
@ryan1288 They can be done in parallel. You are welcome to do whatever you are interested in.
Can I take Facial Expression Recognition? Is there anyone who is already working on it? @fengyuentau
Can I take
Facial Expression Recognition? Is there anyone who is already working on it? @fengyuentau
Sure you can. Feel free to submit PR :)
@fengyuentau Put up my first draft PR in for this Issue! PR #232 - C++ Demo - Object Detection (NanoDet)
I'm excited to start working on these projects and more :smile:. Before I started working on that PR, I played with all the Python and C++ demos from opencv_zoo. I have several thoughts on possible small improvements:
- Object Detection YOLOX
demo.cpp- Spelling mistakes on line 285
- Option to save but has no saving functionality
- Object Detection NanoDet
demo.py- spelling mistake on line 151
- Object Tracking VitTrack
demo.pyassert cv.__version__ > "4.9.0"should beassert cv.__version__ >= "4.9.0"- No space between text and upper tracking box border
- Optical Flow Estimation Raft
demo.py-assert cv.__version__ > "4.9.0"should beassert cv.__version__ >= "4.9.0"
- Image Classification (MobileNet and PPResNet)
- Could use better documentation
READMEby adding example classifications & providing a link to the class list
- Could use better documentation
- A bunch of models (such as Object detection - YOLOX)
- The image
cv::Matfromcap.open(image_path)is different fromimread(image_path), which causes small differences inthe outputs between the Python and C++ demos. I encountered a similar problem when converting Python to C++ for NanoDet.
- The image
From C++ Demo for YOLOX
From Python Demo for YOLOX
- Text Detection PPOCR
- Errors in C++ demo when running
./build/opencv_zoo_text_detection_ppocr -i=../text.jpgwhenpython3 demo.py --input ../text.jpg -vworks
- Errors in C++ demo when running
- Text Recognition CRNN
- Errors in C++ demo when running
./build/opencv_zoo_text_recognition_crnn --input ../text.jpgwhenpython3 demo.py --input ../text.jpg -vworks
- Errors in C++ demo when running
I think there were more but these are the ones I remember. If these seem like reasonable problems to fix, I'll go work on them and put up some small PRs!
@ryan1288 Hi, thank you for trying out our demos and the detailed investigation! True indeed there are some problems as you found. It would be really helpful if you would like to create several PRs to resolve them.
@fengyuentau I'm planning to work on the TrackerVIT C++ demo as well. Should be able to produce a much cleaner solution now that I have a better grasp of it :+1:
Hey there, I'm going to work on Human Segmentation
Hello @DaniAffCH , feel free to submit pull requests!
Hello @fengyuentau I'm interested in the palm detection demo. Is it alright if I work on it?
Hello @fengyuentau I'm interested in the palm detection demo. Is it alright if I work on it?
Hi, sure you can work on it.
Hello @fengyuentau, can I work on the SFace demo?
@keanep Sure feel free to submit a pull request for the SFace C++ demo.