Merge pull request #21437 from alalek:dnn_api_explicit_const_4.x
This commit is contained in:
@@ -60,13 +60,13 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
struct CV_EXPORTS_W DictValue
|
||||
{
|
||||
DictValue(const DictValue &r);
|
||||
DictValue(bool i) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i ? 1 : 0; } //!< Constructs integer scalar
|
||||
DictValue(int64 i = 0) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
|
||||
CV_WRAP DictValue(int i) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
|
||||
DictValue(unsigned p) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = p; } //!< Constructs integer scalar
|
||||
CV_WRAP DictValue(double p) : type(Param::REAL), pd(new AutoBuffer<double,1>) { (*pd)[0] = p; } //!< Constructs floating point scalar
|
||||
CV_WRAP DictValue(const String &s) : type(Param::STRING), ps(new AutoBuffer<String,1>) { (*ps)[0] = s; } //!< Constructs string scalar
|
||||
DictValue(const char *s) : type(Param::STRING), ps(new AutoBuffer<String,1>) { (*ps)[0] = s; } //!< @overload
|
||||
explicit DictValue(bool i) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i ? 1 : 0; } //!< Constructs integer scalar
|
||||
explicit DictValue(int64 i = 0) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
|
||||
CV_WRAP explicit DictValue(int i) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
|
||||
explicit DictValue(unsigned p) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = p; } //!< Constructs integer scalar
|
||||
CV_WRAP explicit DictValue(double p) : type(Param::REAL), pd(new AutoBuffer<double,1>) { (*pd)[0] = p; } //!< Constructs floating point scalar
|
||||
CV_WRAP explicit DictValue(const String &s) : type(Param::STRING), ps(new AutoBuffer<String,1>) { (*ps)[0] = s; } //!< Constructs string scalar
|
||||
explicit DictValue(const char *s) : type(Param::STRING), ps(new AutoBuffer<String,1>) { (*ps)[0] = s; } //!< @overload
|
||||
|
||||
template<typename TypeIter>
|
||||
static DictValue arrayInt(TypeIter begin, int size); //!< Constructs integer array
|
||||
|
||||
@@ -134,7 +134,7 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
class BackendNode
|
||||
{
|
||||
public:
|
||||
BackendNode(int backendId);
|
||||
explicit BackendNode(int backendId);
|
||||
|
||||
virtual ~BackendNode(); //!< Virtual destructor to make polymorphism.
|
||||
|
||||
@@ -277,18 +277,18 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
* Each layer input and output can be labeled to easily identify them using "%<layer_name%>[.output_name]" notation.
|
||||
* This method maps label of input blob to its index into input vector.
|
||||
*/
|
||||
virtual int inputNameToIndex(String inputName);
|
||||
virtual int inputNameToIndex(String inputName); // FIXIT const
|
||||
/** @brief Returns index of output blob in output array.
|
||||
* @see inputNameToIndex()
|
||||
*/
|
||||
CV_WRAP virtual int outputNameToIndex(const String& outputName);
|
||||
CV_WRAP virtual int outputNameToIndex(const String& outputName); // FIXIT const
|
||||
|
||||
/**
|
||||
* @brief Ask layer if it support specific backend for doing computations.
|
||||
* @param[in] backendId computation backend identifier.
|
||||
* @see Backend
|
||||
*/
|
||||
virtual bool supportBackend(int backendId);
|
||||
virtual bool supportBackend(int backendId); // FIXIT const
|
||||
|
||||
/**
|
||||
* @brief Returns Halide backend node.
|
||||
@@ -495,18 +495,29 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
/** @brief Converts string name of the layer to the integer identifier.
|
||||
* @returns id of the layer, or -1 if the layer wasn't found.
|
||||
*/
|
||||
CV_WRAP int getLayerId(const String &layer);
|
||||
CV_WRAP int getLayerId(const String &layer) const;
|
||||
|
||||
CV_WRAP std::vector<String> getLayerNames() const;
|
||||
|
||||
/** @brief Container for strings and integers. */
|
||||
/** @brief Container for strings and integers.
|
||||
*
|
||||
* @deprecated Use getLayerId() with int result.
|
||||
*/
|
||||
typedef DictValue LayerId;
|
||||
|
||||
/** @brief Returns pointer to layer with specified id or name which the network use. */
|
||||
CV_WRAP Ptr<Layer> getLayer(LayerId layerId);
|
||||
CV_WRAP Ptr<Layer> getLayer(int layerId) const;
|
||||
/** @overload
|
||||
* @deprecated Use int getLayerId(const String &layer)
|
||||
*/
|
||||
CV_WRAP inline Ptr<Layer> getLayer(const String& layerName) const { return getLayer(getLayerId(layerName)); }
|
||||
/** @overload
|
||||
* @deprecated to be removed
|
||||
*/
|
||||
CV_WRAP Ptr<Layer> getLayer(const LayerId& layerId) const;
|
||||
|
||||
/** @brief Returns pointers to input layers of specific layer. */
|
||||
std::vector<Ptr<Layer> > getLayerInputs(LayerId layerId); // FIXIT: CV_WRAP
|
||||
std::vector<Ptr<Layer> > getLayerInputs(int layerId) const; // FIXIT: CV_WRAP
|
||||
|
||||
/** @brief Connects output of the first layer to input of the second layer.
|
||||
* @param outPin descriptor of the first layer output.
|
||||
@@ -662,14 +673,16 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
* @note If shape of the new blob differs from the previous shape,
|
||||
* then the following forward pass may fail.
|
||||
*/
|
||||
CV_WRAP void setParam(LayerId layer, int numParam, const Mat &blob);
|
||||
CV_WRAP void setParam(int layer, int numParam, const Mat &blob);
|
||||
CV_WRAP inline void setParam(const String& layerName, int numParam, const Mat &blob) { return setParam(getLayerId(layerName), numParam, blob); }
|
||||
|
||||
/** @brief Returns parameter blob of the layer.
|
||||
* @param layer name or id of the layer.
|
||||
* @param numParam index of the layer parameter in the Layer::blobs array.
|
||||
* @see Layer::blobs
|
||||
*/
|
||||
CV_WRAP Mat getParam(LayerId layer, int numParam = 0);
|
||||
CV_WRAP Mat getParam(int layer, int numParam = 0) const;
|
||||
CV_WRAP inline Mat getParam(const String& layerName, int numParam = 0) const { return getParam(getLayerId(layerName), numParam); }
|
||||
|
||||
/** @brief Returns indexes of layers with unconnected outputs.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user