46
46
#include < opencv2/core.hpp>
47
47
48
48
#if !defined CV_DOXYGEN && !defined CV_DNN_DONT_ADD_EXPERIMENTAL_NS
49
- #define CV__DNN_EXPERIMENTAL_NS_USE using namespace experimental_dnn_v1 ;
50
49
#define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_v1 {
51
50
#define CV__DNN_EXPERIMENTAL_NS_END }
51
+ namespace cv { namespace dnn { namespace experimental_dnn_v1 { } using namespace experimental_dnn_v1 ; }}
52
52
#else
53
- #define CV__DNN_EXPERIMENTAL_NS_USE
54
53
#define CV__DNN_EXPERIMENTAL_NS_BEGIN
55
54
#define CV__DNN_EXPERIMENTAL_NS_END
56
55
#endif
59
58
60
59
namespace cv {
61
60
namespace dnn {
62
- CV__DNN_EXPERIMENTAL_NS_USE
63
61
CV__DNN_EXPERIMENTAL_NS_BEGIN
64
62
// ! @addtogroup dnn
65
63
// ! @{
@@ -160,7 +158,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
160
158
* Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs.
161
159
* Also before using the new layer into networks you must register your layer by using one of @ref dnnLayerFactory "LayerFactory" macros.
162
160
*/
163
- class CV_EXPORTS_W Layer
161
+ class CV_EXPORTS_W Layer : public Algorithm
164
162
{
165
163
public:
166
164
@@ -329,7 +327,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
329
327
/* * @brief Container for strings and integers. */
330
328
typedef DictValue LayerId;
331
329
332
- /* * @brief Returns pointer to layer with specified name which the network use. */
330
+ /* * @brief Returns pointer to layer with specified id or name which the network use. */
333
331
CV_WRAP Ptr<Layer> getLayer (LayerId layerId);
334
332
335
333
/* * @brief Returns pointers to input layers of specific layer. */
@@ -517,7 +515,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
517
515
/* * @brief Returns list of types for layer used in model.
518
516
* @param layersTypes output parameter for returning types.
519
517
*/
520
- CV_WRAP void getLayerTypes (std::vector<String>& layersTypes) const ;
518
+ CV_WRAP void getLayerTypes (CV_OUT std::vector<String>& layersTypes) const ;
521
519
522
520
/* * @brief Returns count of layers of specified type.
523
521
* @param layerType type.
@@ -532,18 +530,18 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
532
530
* @param blobs output parameter to store resulting bytes for intermediate blobs.
533
531
*/
534
532
CV_WRAP void getMemoryConsumption (const std::vector<MatShape>& netInputShapes,
535
- size_t & weights, size_t & blobs) const ;
533
+ CV_OUT size_t & weights, CV_OUT size_t & blobs) const ;
536
534
/* * @overload */
537
535
CV_WRAP void getMemoryConsumption (const MatShape& netInputShape,
538
- size_t & weights, size_t & blobs) const ;
536
+ CV_OUT size_t & weights, CV_OUT size_t & blobs) const ;
539
537
/* * @overload */
540
538
CV_WRAP void getMemoryConsumption (const int layerId,
541
539
const std::vector<MatShape>& netInputShapes,
542
- size_t & weights, size_t & blobs) const ;
540
+ CV_OUT size_t & weights, CV_OUT size_t & blobs) const ;
543
541
/* * @overload */
544
542
CV_WRAP void getMemoryConsumption (const int layerId,
545
543
const MatShape& netInputShape,
546
- size_t & weights, size_t & blobs) const ;
544
+ CV_OUT size_t & weights, CV_OUT size_t & blobs) const ;
547
545
548
546
/* * @brief Computes bytes number which are requered to store
549
547
* all weights and intermediate blobs for each layer.
@@ -553,20 +551,20 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
553
551
* @param blobs output parameter to store resulting bytes for intermediate blobs.
554
552
*/
555
553
CV_WRAP void getMemoryConsumption (const std::vector<MatShape>& netInputShapes,
556
- std::vector<int >& layerIds, std::vector<size_t >& weights,
557
- std::vector<size_t >& blobs) const ;
554
+ CV_OUT std::vector<int >& layerIds, CV_OUT std::vector<size_t >& weights,
555
+ CV_OUT std::vector<size_t >& blobs) const ;
558
556
/* * @overload */
559
557
CV_WRAP void getMemoryConsumption (const MatShape& netInputShape,
560
- std::vector<int >& layerIds, std::vector<size_t >& weights,
561
- std::vector<size_t >& blobs) const ;
558
+ CV_OUT std::vector<int >& layerIds, CV_OUT std::vector<size_t >& weights,
559
+ CV_OUT std::vector<size_t >& blobs) const ;
562
560
private:
563
561
564
562
struct Impl ;
565
563
Ptr<Impl> impl;
566
564
};
567
565
568
566
/* * @brief Small interface class for loading trained serialized models of different dnn-frameworks. */
569
- class CV_EXPORTS_W Importer
567
+ class CV_EXPORTS_W Importer : public Algorithm
570
568
{
571
569
public:
572
570
@@ -602,7 +600,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
602
600
* @param model path to the .pb file with binary protobuf description of the network architecture.
603
601
* @returns Pointer to the created importer, NULL in failure cases.
604
602
*/
605
- CV_EXPORTS Ptr<Importer> createTensorflowImporter (const String &model);
603
+ CV_EXPORTS_W Ptr<Importer> createTensorflowImporter (const String &model);
606
604
607
605
/* * @brief Creates the importer of <a href="http://torch.ch">Torch7</a> framework network.
608
606
* @param filename path to the file, dumped from Torch by using torch.save() function.
@@ -676,4 +674,4 @@ CV__DNN_EXPERIMENTAL_NS_END
676
674
#include < opencv2/dnn/layer.hpp>
677
675
#include < opencv2/dnn/dnn.inl.hpp>
678
676
679
- #endif /* __OPENCV_DNN_DNN_HPP__ */
677
+ #endif /* OPENCV_DNN_DNN_HPP */
0 commit comments