|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- /**
- * Copyright 2019 Huawei Technologies Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- namespace mindspore.predict;
-
- enum ResizeMethod: byte {
- UNKNOW = -1,
- BILINEAR = 0,
- NEAREST_NEIGHBOR = 1
- }
-
- enum DataFormatType : byte {
- UNKNOW = -1,
- NCHW = 0,
- NHWC = 1,
- HWC = 2, // for input image or resize
- CHW = 3, // for input image or resize
- }
-
- enum ActivationType : byte {
- NO_ACTIVATION = 0,
- RELU = 1,
- SIGMOID = 2,
- RELU6 = 3,
- ELU = 4,
- LEAKY_RELU = 5,
- ABS = 6,
- RELU1 = 7,
- SOFTSIGN = 8,
- SOFTPLUS = 9,
- TANH = 10,
- UNKNOW = 11
- }
-
- enum PoolMode : byte {
- MAX_POOLING = 0,
- MEAN_POOLING = 1,
- GLOBAL_POOING = 2
- }
-
- enum EltwiseMode : byte {
- PROD = 0,
- SUM = 1,
- MAXIMUM = 2
- }
-
- enum PadMode : byte {
- NOTSET=0,
- SAME=1,
- VALID=2,
- CAFFE_CEIL_NEW=4
- }
-
- enum PaddingMode : byte {
- CONSTANT = 0,
- REFLECT = 1,
- SYMMETRIC = 2,
- MODE_RESERVED = 3
- }
-
- table Pad {
- paddingmode: PaddingMode;
- paddings: [int];
- }
-
- table Maximum {
- format: DataFormatType = 0;
- }
-
- table Concat {
- axis: int;
- n: int;
- }
-
- table SoftMax {
- axis: [int];
- }
-
- table Activation {
- type: ActivationType = 0;
- }
-
- table Conv2D {
- format: DataFormatType = 0;
- group: int;
- channelIn: int;
- channelOut: int;
- kernelW: int;
- kernelH: int;
- strideW: int;
- strideH: int;
- padMode: PadMode;
- padUp: int;
- padDown: int;
- padLeft: int;
- padRight: int;
- dilateW: int;
- dilateH: int;
- hasBias: bool = false;
- activationType: ActivationType = 0;
- }
-
- table FusedBatchNorm {
- epsilon: float; // eg. epsilon=0.001
- }
-
- table CaffeBatchNorm {
- epsilon: float; // eg. epsilon=0.001
- }
-
- table Squeeze {
- axis: [int];
- }
-
- table BiasAdd {
- axis: [int];
- }
-
- table Pooling {
- format: DataFormatType = 0;
- poolingMode: PoolMode;
- windowW: int;
- windowH: int;
- strideW: int;
- strideH: int;
- padMode: PadMode;
- padUp: int;
- padDown: int;
- padLeft: int;
- padRight: int;
- caffeMode: bool = false;
- }
-
- table DepthwiseConv2D {
- format: DataFormatType = 0;
- channelIn: int;
- channelMultiplier: int;
- kernelW: int;
- kernelH: int;
- strideW: int;
- strideH: int;
- padMode: PadMode;
- padUp: int;
- padDown: int;
- padLeft: int;
- padRight: int;
- dilateW: int;
- dilateH: int;
- hasBias: bool = false;
- activationType: ActivationType = 0;
- }
-
- table DeDepthwiseConv2D {
- format: DataFormatType = 0;
- channelIn: int;
- channelMultiplier: int;
- kernelW: int;
- kernelH: int;
- strideW: int;
- strideH: int;
- padMode: PadMode;
- padUp: int;
- padDown: int;
- padLeft: int;
- padRight: int;
- dilateW: int;
- dilateH: int;
- hasBias: bool = false;
- activationType: ActivationType = 0;
- }
-
-
- table Resize {
- format: DataFormatType = 0;
- method: ResizeMethod;
- newHeight: long;
- newWidth: long;
- alignCorners: bool = false;
- preserveAspectRatio: bool = false;
- }
-
- table DetectionPostProcess {
- format: DataFormatType = 0;
- inputSize: int;
- hScale: float;
- wScale: float;
- xScale: float;
- yScale: float;
- NmsIouThreshold: float;
- NmsScoreThreshold: float;
- MaxDetections: long;
- DetectionsPreClass: long;
- MaxClassesPreDetection: long;
- NumClasses: long;
- UseRegularNms: bool;
- }
-
- table FullConnection {
- format: DataFormatType = 0;
- hasBias: bool;
- axis: int;
- }
-
- // Mean(input_tensor, axis, keep_dims)
- table Mean {
- axis: [int];
- keepDims: bool = false;
- }
-
- table DeConv2D {
- format: DataFormatType = 0;
- group: int;
- channelIn: int;
- channelOut: int;
- kernelW: int;
- kernelH: int;
- strideW: int;
- strideH: int;
- padMode: PadMode;
- padUp: int;
- padDown: int;
- padLeft: int;
- padRight: int;
- dilateW: int;
- dilateH: int;
- hasBias: bool = false;
- activationType: ActivationType = 0;
- }
-
- table Scale {
- format: DataFormatType = 0;
- }
-
- table Eltwise {
- format: DataFormatType = 0;
- mode: EltwiseMode;
- }
-
- table Add {
- format: DataFormatType = 0;
- }
-
- table Slice {
- format: DataFormatType = 0;
- begin: [int];
- end: [int];
- stride: [int];
- }
-
- table Mul {
- }
-
- table Exp {
- }
-
- table Reshape {
- format: DataFormatType = 0;
- shape: [long];
- }
-
- table Power {
- power: float;
- scale: float;
- shift: float;
- }
-
- table ArgMax {
- axis: int;
- outMaxValue: bool;
- topK: int;
- keepDims: bool;
- axisType: int;
- }
-
- table NetOutput {
- format: DataFormatType = 0;
- }
-
- table MatMul {
- transposeA : bool = false;
- transposeB : bool = false;
- }
-
- table CaffePReLU {
- channelShared : bool = false;
- }
-
- table StridedSlice {
- beginMask: int;
- endMask: int;
- ellipsisMask: int;
- newAxisMask: int;
- shrinkAxisMask: int;
- begin: [int];
- end: [int];
- stride: [int];
- isScale: [int];
- }
-
- table Stack {
- axis: int;
- n: int;
- isScale: [int];
- }
-
- table Range {
- start: int;
- limit: int;
- delta: int;
- }
-
- table ExpandDims {
- dim: int;
- }
-
- table Tile {
- multiples: [int];
- }
-
- table Cast {
- srcT: int;
- dstT: int;
- }
-
- table Split {
- numberSplit: int;
- sizeSplits: [int];
- splitDim: int;
- }
-
- table CaffeCrop {
- axis : long;
- offsets : [long];
- }
-
- table Permute {
- order: [long];
- }
|