1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
22 // * Redistribution's in binary form must reproduce the above copyright notice,
23 // this list of conditions and the following disclaimer in the documentation
24 // and/or other materials provided with the distribution.
26 // * The name of the copyright holders may not be used to endorse or promote products
27 // derived from this software without specific prior written permission.
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
42 #include "precomp.hpp"
43 #include <opencv2/dnn/layer.details.hpp>
45 #include <google/protobuf/stubs/common.h>
49 CV__DNN_EXPERIMENTAL_NS_BEGIN
51 static Mutex* __initialization_mutex = NULL;
52 Mutex& getInitializationMutex()
54 if (__initialization_mutex == NULL)
55 __initialization_mutex = new Mutex();
56 return *__initialization_mutex;
58 // force initialization (single-threaded environment)
59 Mutex* __initialization_mutex_initializer = &getInitializationMutex();
62 using namespace google::protobuf;
63 class ProtobufShutdown {
66 ProtobufShutdown() : initialized(true) {}
70 google::protobuf::ShutdownProtobufLibrary();
75 void initializeLayerFactory()
79 static ProtobufShutdown protobufShutdown; (void)protobufShutdown;
81 CV_DNN_REGISTER_LAYER_CLASS(Slice, SliceLayer);
82 CV_DNN_REGISTER_LAYER_CLASS(Split, SplitLayer);
83 CV_DNN_REGISTER_LAYER_CLASS(Concat, ConcatLayer);
84 CV_DNN_REGISTER_LAYER_CLASS(Reshape, ReshapeLayer);
85 CV_DNN_REGISTER_LAYER_CLASS(Flatten, FlattenLayer);
86 CV_DNN_REGISTER_LAYER_CLASS(ResizeNearestNeighbor, ResizeNearestNeighborLayer);
88 CV_DNN_REGISTER_LAYER_CLASS(Convolution, ConvolutionLayer);
89 CV_DNN_REGISTER_LAYER_CLASS(Deconvolution, DeconvolutionLayer);
90 CV_DNN_REGISTER_LAYER_CLASS(Pooling, PoolingLayer);
91 CV_DNN_REGISTER_LAYER_CLASS(ROIPooling, PoolingLayer);
92 CV_DNN_REGISTER_LAYER_CLASS(LRN, LRNLayer);
93 CV_DNN_REGISTER_LAYER_CLASS(InnerProduct, InnerProductLayer);
94 CV_DNN_REGISTER_LAYER_CLASS(Softmax, SoftmaxLayer);
95 CV_DNN_REGISTER_LAYER_CLASS(MVN, MVNLayer);
97 CV_DNN_REGISTER_LAYER_CLASS(ReLU, ReLULayer);
98 CV_DNN_REGISTER_LAYER_CLASS(ReLU6, ReLU6Layer);
99 CV_DNN_REGISTER_LAYER_CLASS(ChannelsPReLU, ChannelsPReLULayer);
100 CV_DNN_REGISTER_LAYER_CLASS(PReLU, ChannelsPReLULayer);
101 CV_DNN_REGISTER_LAYER_CLASS(Sigmoid, SigmoidLayer);
102 CV_DNN_REGISTER_LAYER_CLASS(TanH, TanHLayer);
103 CV_DNN_REGISTER_LAYER_CLASS(ELU, ELULayer);
104 CV_DNN_REGISTER_LAYER_CLASS(BNLL, BNLLLayer);
105 CV_DNN_REGISTER_LAYER_CLASS(AbsVal, AbsLayer);
106 CV_DNN_REGISTER_LAYER_CLASS(Power, PowerLayer);
107 CV_DNN_REGISTER_LAYER_CLASS(BatchNorm, BatchNormLayer);
108 CV_DNN_REGISTER_LAYER_CLASS(MaxUnpool, MaxUnpoolLayer);
109 CV_DNN_REGISTER_LAYER_CLASS(Dropout, BlankLayer);
110 CV_DNN_REGISTER_LAYER_CLASS(Identity, BlankLayer);
111 CV_DNN_REGISTER_LAYER_CLASS(Silence, BlankLayer);
113 CV_DNN_REGISTER_LAYER_CLASS(Crop, CropLayer);
114 CV_DNN_REGISTER_LAYER_CLASS(Eltwise, EltwiseLayer);
115 CV_DNN_REGISTER_LAYER_CLASS(Permute, PermuteLayer);
116 CV_DNN_REGISTER_LAYER_CLASS(PriorBox, PriorBoxLayer);
117 CV_DNN_REGISTER_LAYER_CLASS(PriorBoxClustered, PriorBoxLayer);
118 CV_DNN_REGISTER_LAYER_CLASS(Reorg, ReorgLayer);
119 CV_DNN_REGISTER_LAYER_CLASS(Region, RegionLayer);
120 CV_DNN_REGISTER_LAYER_CLASS(DetectionOutput, DetectionOutputLayer);
121 CV_DNN_REGISTER_LAYER_CLASS(NormalizeBBox, NormalizeBBoxLayer);
122 CV_DNN_REGISTER_LAYER_CLASS(Normalize, NormalizeBBoxLayer);
123 CV_DNN_REGISTER_LAYER_CLASS(Shift, ShiftLayer);
124 CV_DNN_REGISTER_LAYER_CLASS(Padding, PaddingLayer);
125 CV_DNN_REGISTER_LAYER_CLASS(Scale, ScaleLayer);
127 CV_DNN_REGISTER_LAYER_CLASS(LSTM, LSTMLayer);
130 CV__DNN_EXPERIMENTAL_NS_END