1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Removed internal structs from DNN interface to fix Obj-C/Swift bindings.

This commit is contained in:
Alexander Smorkalov
2026-05-18 12:21:14 +03:00
parent 873a4635c6
commit a7e02e5742
2 changed files with 27 additions and 27 deletions
-27
View File
@@ -545,33 +545,6 @@ CV__DNN_INLINE_NS_BEGIN
virtual void setProg(const std::vector<Ptr<Layer> >& 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<PerfProfileEntry> 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,
+27
View File
@@ -48,6 +48,33 @@ typedef std::unordered_map<std::string, int64_t> 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<PerfProfileEntry> entries;
};
// NB: Implementation is divided between of multiple .cpp files
struct Net::Impl : public detail::NetImplBase
{