Skip to content

Commit

Permalink
✨ Simple tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
JuInria committed Feb 16, 2022
1 parent 19c8b93 commit da7af6a
Showing 1 changed file with 24 additions and 0 deletions.
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;
}

0 comments on commit da7af6a

Please sign in to comment.