123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590 |
- #ifndef OPENCV_DNN_DNN_ALL_LAYERS_HPP
- #define OPENCV_DNN_DNN_ALL_LAYERS_HPP
- #include <opencv2/dnn.hpp>
- namespace cv {
- namespace dnn {
- CV__DNN_EXPERIMENTAL_NS_BEGIN
- class CV_EXPORTS BlankLayer : public Layer
- {
- public:
- static Ptr<BlankLayer> create(const LayerParams ¶ms);
- };
-
- class CV_EXPORTS LSTMLayer : public Layer
- {
- public:
-
- static Ptr<LSTMLayer> create(const LayerParams& params);
-
- CV_DEPRECATED virtual void setWeights(const Mat &Wh, const Mat &Wx, const Mat &b) = 0;
-
- virtual void setOutShape(const MatShape &outTailShape = MatShape()) = 0;
-
- CV_DEPRECATED virtual void setUseTimstampsDim(bool use = true) = 0;
-
- CV_DEPRECATED virtual void setProduceCellOutput(bool produce = false) = 0;
-
- int inputNameToIndex(String inputName);
- int outputNameToIndex(String outputName);
- };
-
- class CV_EXPORTS RNNLayer : public Layer
- {
- public:
-
- static Ptr<RNNLayer> create(const LayerParams& params);
-
- virtual void setWeights(const Mat &Wxh, const Mat &bh, const Mat &Whh, const Mat &Who, const Mat &bo) = 0;
-
- virtual void setProduceHiddenOutput(bool produce = false) = 0;
- };
- class CV_EXPORTS BaseConvolutionLayer : public Layer
- {
- public:
- Size kernel, stride, pad, dilation, adjustPad;
- String padMode;
- int numOutput;
- };
- class CV_EXPORTS ConvolutionLayer : public BaseConvolutionLayer
- {
- public:
- static Ptr<BaseConvolutionLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS DeconvolutionLayer : public BaseConvolutionLayer
- {
- public:
- static Ptr<BaseConvolutionLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS LRNLayer : public Layer
- {
- public:
- enum Type
- {
- CHANNEL_NRM,
- SPATIAL_NRM
- };
- int type;
- int size;
- float alpha, beta, bias;
- bool normBySize;
- static Ptr<LRNLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS PoolingLayer : public Layer
- {
- public:
- enum Type
- {
- MAX,
- AVE,
- STOCHASTIC
- };
- int type;
- Size kernel, stride, pad;
- bool globalPooling;
- bool computeMaxIdx;
- String padMode;
- bool ceilMode;
- static Ptr<PoolingLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS SoftmaxLayer : public Layer
- {
- public:
- bool logSoftMax;
- static Ptr<SoftmaxLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS InnerProductLayer : public Layer
- {
- public:
- int axis;
- static Ptr<InnerProductLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS MVNLayer : public Layer
- {
- public:
- float eps;
- bool normVariance, acrossChannels;
- static Ptr<MVNLayer> create(const LayerParams& params);
- };
-
- class CV_EXPORTS ReshapeLayer : public Layer
- {
- public:
- MatShape newShapeDesc;
- Range newShapeRange;
- static Ptr<ReshapeLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS FlattenLayer : public Layer
- {
- public:
- static Ptr<FlattenLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS ConcatLayer : public Layer
- {
- public:
- int axis;
-
- bool padding;
- static Ptr<ConcatLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS SplitLayer : public Layer
- {
- public:
- int outputsCount;
- static Ptr<SplitLayer> create(const LayerParams ¶ms);
- };
-
- class CV_EXPORTS SliceLayer : public Layer
- {
- public:
-
- std::vector<std::vector<Range> > sliceRanges;
- int axis;
- static Ptr<SliceLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS PermuteLayer : public Layer
- {
- public:
- static Ptr<PermuteLayer> create(const LayerParams& params);
- };
-
- class CV_EXPORTS PaddingLayer : public Layer
- {
- public:
- static Ptr<PaddingLayer> create(const LayerParams& params);
- };
-
- class CV_EXPORTS ActivationLayer : public Layer
- {
- public:
- virtual void forwardSlice(const float* src, float* dst, int len,
- size_t outPlaneSize, int cn0, int cn1) const = 0;
- };
- class CV_EXPORTS ReLULayer : public ActivationLayer
- {
- public:
- float negativeSlope;
- static Ptr<ReLULayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS ReLU6Layer : public ActivationLayer
- {
- public:
- static Ptr<ReLU6Layer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS ChannelsPReLULayer : public ActivationLayer
- {
- public:
- static Ptr<Layer> create(const LayerParams& params);
- };
- class CV_EXPORTS ELULayer : public ActivationLayer
- {
- public:
- static Ptr<ELULayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS TanHLayer : public ActivationLayer
- {
- public:
- static Ptr<TanHLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS SigmoidLayer : public ActivationLayer
- {
- public:
- static Ptr<SigmoidLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS BNLLLayer : public ActivationLayer
- {
- public:
- static Ptr<BNLLLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS AbsLayer : public ActivationLayer
- {
- public:
- static Ptr<AbsLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS PowerLayer : public ActivationLayer
- {
- public:
- float power, scale, shift;
- static Ptr<PowerLayer> create(const LayerParams ¶ms);
- };
-
- class CV_EXPORTS CropLayer : public Layer
- {
- public:
- int startAxis;
- std::vector<int> offset;
- static Ptr<CropLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS EltwiseLayer : public Layer
- {
- public:
- enum EltwiseOp
- {
- PROD = 0,
- SUM = 1,
- MAX = 2,
- };
- static Ptr<EltwiseLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS BatchNormLayer : public Layer
- {
- public:
- bool hasWeights, hasBias;
- float epsilon;
- virtual void getScaleShift(Mat& scale, Mat& shift) const = 0;
- static Ptr<BatchNormLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS MaxUnpoolLayer : public Layer
- {
- public:
- Size poolKernel;
- Size poolPad;
- Size poolStride;
- static Ptr<MaxUnpoolLayer> create(const LayerParams ¶ms);
- };
- class CV_EXPORTS ScaleLayer : public Layer
- {
- public:
- bool hasBias;
- static Ptr<ScaleLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS ShiftLayer : public Layer
- {
- public:
- static Ptr<ShiftLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS PriorBoxLayer : public Layer
- {
- public:
- static Ptr<PriorBoxLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS ReorgLayer : public Layer
- {
- public:
- static Ptr<ReorgLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS RegionLayer : public Layer
- {
- public:
- static Ptr<RegionLayer> create(const LayerParams& params);
- };
- class CV_EXPORTS DetectionOutputLayer : public Layer
- {
- public:
- static Ptr<DetectionOutputLayer> create(const LayerParams& params);
- };
-
- class NormalizeBBoxLayer : public Layer
- {
- public:
- float pnorm, epsilon;
- bool acrossSpatial;
- static Ptr<NormalizeBBoxLayer> create(const LayerParams& params);
- };
-
- class CV_EXPORTS ResizeNearestNeighborLayer : public Layer
- {
- public:
- static Ptr<ResizeNearestNeighborLayer> create(const LayerParams& params);
- };
- CV__DNN_EXPERIMENTAL_NS_END
- }
- }
- #endif
|