opencv_zoo icon indicating copy to clipboard operation
opencv_zoo copied to clipboard

Add C++ demos (Updated on 2024-06-03)

Open fengyuentau opened this issue 2 years ago • 22 comments

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

fengyuentau avatar Feb 22 '23 03:02 fengyuentau

handpose_estimation_mediapipe. please Thank you so much.

kekxv avatar Mar 16 '23 01:03 kekxv

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

dmatveev avatar Apr 28 '23 10:04 dmatveev

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 avatar Apr 28 '23 11:04 fengyuentau

@fengyuentau I can manage MobileNet V1 Are you agree?

LaurentBerger avatar Jun 09 '23 14:06 LaurentBerger

@LaurentBerger No problems. Pull requests are welcome.

fengyuentau avatar Jun 09 '23 18:06 fengyuentau

About DaSiamRPN there is already an example Model source: opencv/samples/dnn/diasiamrpn_tracker.cpp

LaurentBerger avatar Jun 12 '23 12:06 LaurentBerger

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.

fengyuentau avatar Jun 13 '23 04:06 fengyuentau

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

LaurentBerger avatar Jun 15 '23 12:06 LaurentBerger

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

LaurentBerger avatar Dec 13 '23 07:12 LaurentBerger

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 avatar Dec 24 '23 11:12 ryan1288

@ryan1288 They can be done in parallel. You are welcome to do whatever you are interested in.

fengyuentau avatar Dec 25 '23 08:12 fengyuentau

Can I take Facial Expression Recognition? Is there anyone who is already working on it? @fengyuentau

DaniAffCH avatar Feb 23 '24 21:02 DaniAffCH

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 avatar Feb 24 '24 02:02 fengyuentau

@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.py
      • assert cv.__version__ > "4.9.0" should be assert 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 be assert cv.__version__ >= "4.9.0"
  • Image Classification (MobileNet and PPResNet)
    • Could use better documentation README by adding example classifications & providing a link to the class list
  • A bunch of models (such as Object detection - YOLOX)
    • The image cv::Mat from cap.open(image_path) is different from imread(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.

From C++ Demo for YOLOX image From Python Demo for YOLOX image

  • Text Detection PPOCR
    • Errors in C++ demo when running ./build/opencv_zoo_text_detection_ppocr -i=../text.jpg when python3 demo.py --input ../text.jpg -v works image
  • Text Recognition CRNN
    • Errors in C++ demo when running ./build/opencv_zoo_text_recognition_crnn --input ../text.jpg when python3 demo.py --input ../text.jpg -v works image

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 avatar Feb 24 '24 10:02 ryan1288

@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 avatar Feb 26 '24 03:02 fengyuentau

@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:

ryan1288 avatar Mar 02 '24 12:03 ryan1288

Hey there, I'm going to work on Human Segmentation

DaniAffCH avatar Mar 06 '24 10:03 DaniAffCH

Hello @DaniAffCH , feel free to submit pull requests!

fengyuentau avatar Mar 06 '24 10:03 fengyuentau

Hello @fengyuentau I'm interested in the palm detection demo. Is it alright if I work on it?

ryan1288 avatar Apr 05 '24 04:04 ryan1288

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.

fengyuentau avatar Apr 07 '24 05:04 fengyuentau

Hello @fengyuentau, can I work on the SFace demo?

ghost avatar May 30 '24 20:05 ghost

@keanep Sure feel free to submit a pull request for the SFace C++ demo.

fengyuentau avatar May 31 '24 02:05 fengyuentau