This PR is used to convert all caffe tests with 'single' layer to onnx format. Tests in test_int8_layer.cpp and test_caffe_importer.cpp will be removed in https://github.com/opencv/opencv/pull/25323
Most layers converted by caffe2onnx
Some of them are generated by pytorch and onnxruntime
Some of them are wrong after converting, so I use onnx-modifier to correct it.
EXTRA NOTE
Removelayer_lrn_spatial: norm_region is WITHIN_CHANNEL , but ONNX defines the default mode as ACROSS_CHANNELS, and if users want it, they may try BatchNormalization. (ref: LRN in ONNX)
Changelayer_deconvolution: onnx doesn't define deconvolution operator, use ConvTranspose to replace. (ref: ConvTranspose in ONNX)
RemoveInnerProduct: ONNX doesn't define this layer, user may convert it to GEMM or MatMul
Changelayer_mvn: onnx doesn't define MVN operator, use InstanceNormalization to replace.
Removelayer_batch_norm_local_stats: use_global_stats: false is useless in ONNX. (ref: BatchNormalization in ONNX)
Removelayer_eltwise: the model has a node with 2 inputs but from the same layer, which then causes an error. However, we have enough eltwise tests.
Removeaccum and accum_ref: they use 1x2x2x4 accum 1x3x8x12, we can't use ADD operator to replace it.
Removeflow_wrap: ONNX doesn't define this operator.
RemoveDataAugmentation: ONNX doesn't define this operator.
Removenearest_2inps and nearest: ONNX doesn't define Resample operator.
RemoveCorrelation: ONNX doesn't define this operator.
Removeconv_2_inps: ONNX doesn't support this defination, no need to test it in ONNX.
Merged with: https://github.com/opencv/opencv_extra/pull/1176 (testdata also should be review) part of https://github.com/opencv/opencv/issues/25314
This PR is used to convert all caffe tests with 'single' layer to onnx format. Tests in
test_int8_layer.cpp
andtest_caffe_importer.cpp
will be removed in https://github.com/opencv/opencv/pull/25323Most layers converted by caffe2onnx Some of them are generated by
pytorch
andonnxruntime
Some of them are wrong after converting, so I use onnx-modifier to correct it.EXTRA NOTE
Remove
layer_lrn_spatial
: norm_region isWITHIN_CHANNEL
, but ONNX defines the default mode asACROSS_CHANNELS
, and if users want it, they may tryBatchNormalization
. (ref: LRN in ONNX)Change
layer_deconvolution
: onnx doesn't definedeconvolution
operator, useConvTranspose
to replace. (ref: ConvTranspose in ONNX)Remove
InnerProduct
: ONNX doesn't define this layer, user may convert it to GEMM or MatMulChange
layer_mvn
: onnx doesn't defineMVN
operator, useInstanceNormalization
to replace.Remove
layer_batch_norm_local_stats
:use_global_stats: false
is useless in ONNX. (ref: BatchNormalization in ONNX)Remove
layer_eltwise
: the model has a node with 2 inputs but from the same layer, which then causes an error. However, we have enough eltwise tests.Remove
accum
andaccum_ref
: they use1x2x2x4
accum1x3x8x12
, we can't useADD
operator to replace it.Remove
flow_wrap
: ONNX doesn't define this operator.Remove
DataAugmentation
: ONNX doesn't define this operator.Remove
nearest_2inps
andnearest
: ONNX doesn't defineResample
operator.Remove
Correlation
: ONNX doesn't define this operator.Remove
conv_2_inps
: ONNX doesn't support this defination, no need to test it in ONNX.Remove
layer_interp
: ONNX doesn't defineInterp
operator.Disabled
net_roi_pooling
: can be replaced byRoiAlign
operator in ONNX, but OpenCV dnn doesn't support.Remove
reshape_splice_split
: Can't be converted to ONNX format. Because there are many re-use layers in caffe format.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request