diff --git a/modules/dnn/include/opencv2/dnn/dnn.hpp b/modules/dnn/include/opencv2/dnn/dnn.hpp index d055cadf42..15ec786d0d 100644 --- a/modules/dnn/include/opencv2/dnn/dnn.hpp +++ b/modules/dnn/include/opencv2/dnn/dnn.hpp @@ -545,33 +545,6 @@ CV__DNN_INLINE_NS_BEGIN virtual void setProg(const std::vector >& newprog) = 0; }; - /** @brief Single entry in a @ref PerfProfile. - * - * In DNN_PROFILE_DETAILED mode, @p label is "layer_name (type)" and @p count is 1. - * In DNN_PROFILE_SUMMARY mode, @p label is the layer type and @p count is the - * number of layers of that type that contributed to @p timeMs. - */ - struct CV_EXPORTS_W_SIMPLE PerfProfileEntry - { - CV_WRAP PerfProfileEntry() : timeMs(0.0), count(0) {} - CV_PROP_RW String label; - CV_PROP_RW double timeMs; - CV_PROP_RW int count; - }; - - /** @brief Self-describing snapshot of profiling data from one inference. - * - * Carries the @ref ProfilingMode it was captured in so it can be saved, kept across - * runs (e.g. best-of-N by total time), and printed later via @ref Net::printPerfProfile - * without needing access to the originating @ref Net. - */ - struct CV_EXPORTS_W_SIMPLE PerfProfile - { - CV_WRAP PerfProfile() : mode(DNN_PROFILE_NONE) {} - CV_PROP_RW ProfilingMode mode; - CV_PROP_RW std::vector entries; - }; - /** @brief This class allows to create and manipulate comprehensive artificial neural networks. * * Neural network is presented as directed acyclic graph (DAG), where vertices are Layer instances, diff --git a/modules/dnn/src/net_impl.hpp b/modules/dnn/src/net_impl.hpp index c5b3159191..b6cff99b29 100644 --- a/modules/dnn/src/net_impl.hpp +++ b/modules/dnn/src/net_impl.hpp @@ -48,6 +48,33 @@ typedef std::unordered_map NamesHash; struct OrtNamesCache; #endif +/** @brief Single entry in a @ref PerfProfile. + * + * In DNN_PROFILE_DETAILED mode, @p label is "layer_name (type)" and @p count is 1. + * In DNN_PROFILE_SUMMARY mode, @p label is the layer type and @p count is the + * number of layers of that type that contributed to @p timeMs. + */ +struct PerfProfileEntry +{ + PerfProfileEntry() : timeMs(0.0), count(0) {} + String label; + double timeMs; + int count; +}; + +/** @brief Self-describing snapshot of profiling data from one inference. + * + * Carries the @ref ProfilingMode it was captured in so it can be saved, kept across + * runs (e.g. best-of-N by total time), and printed later via @ref Net::printPerfProfile + * without needing access to the originating @ref Net. + */ +struct PerfProfile +{ + PerfProfile() : mode(DNN_PROFILE_NONE) {} + ProfilingMode mode; + std::vector entries; +}; + // NB: Implementation is divided between of multiple .cpp files struct Net::Impl : public detail::NetImplBase {