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

🎉 Begin CPP integration tutorial #11

Merged
merged 9 commits into from
Feb 16, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
✨ Simple tutorial
  • Loading branch information
JuInria committed Feb 16, 2022
commit 85cac27ccdbf4866f353ba72a7b4911381d6b14e
24 changes: 24 additions & 0 deletions tutorials/cpp_integration/tutorial_cpp_integration.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// OpenCV
#include <opencv2/opencv.hpp>

// Internal
#include <data/Hole.hpp>
#include <detector/DnnHoleLocalizer.hpp>

int
main( int argc, char **argv )
{
const auto model_path = std::string( "/root/deep-learning-ws/yolox/example/hole_detector/models/tiny_yolox" );
const auto hole_localizer = std::make_unique< detector::DnnHoleLocalizer >( model_path );

auto cv_color = cv::imread( "/root/deep-learning-ws/yolox/example/hole_detector/data/Images/frame0000.jpg" );

const auto detections = hole_localizer->detect( cv_color );
std::for_each( begin( detections ), end( detections ),
[&cv_color]( const auto &detection ) { detection.display( cv_color ); } );

cv::imshow( "Hole detection", cv_color );
cv::waitKey();

return EXIT_SUCCESS;
}