Skip to content

(5.x) Merge 4.x #871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 63 commits into from
Apr 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
1e9dd0e
Merge pull request #773 from HannibalAPE:text_det_rec
HannibalAPE Dec 3, 2020
25429eb
Add CUDA StereoSGM test data
sotsuka-fixstars Nov 20, 2020
54b0ced
(ADD) Added BEBLID descriptors for testing
iago-suarez Dec 4, 2020
4e93692
Update download_models.py
muare Dec 2, 2020
39ac5d3
Merge pull request #824 from muare:master
alalek Dec 4, 2020
d1c6ac5
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Dec 4, 2020
3ca9ea9
Added data for TF resize_bilinear layer test
Dec 2, 2020
665e00b
Merge pull request #825 from LupusSanctus:am/dnn_bilinear_resize
alalek Dec 8, 2020
c168e5a
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Dec 9, 2020
0277d71
Merge pull request #827 from iago-suarez:master
alalek Dec 9, 2020
a20b3f8
Added data for TF nearest neighbour resize layer test
Dec 10, 2020
3d46b11
Merge pull request #830 from LupusSanctus:am/dnn_nearest_resize_3.4
alalek Dec 11, 2020
4e03cfd
Merge pull request #826 from fixstars:add_cudastereo_semi_global_matc…
alalek Dec 11, 2020
cea9672
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Dec 11, 2020
d78f936
.j2c (JPEG2000 raw codestream) test image
tailsu Dec 14, 2020
b1dda63
Merge pull request #833 from tailsu:sd/imdecode-jp2k-codestream
alalek Dec 23, 2020
931b592
Add performance data for cv::cuda::inRange
amiller27 Jan 2, 2021
c9b1ece
Added test data for Mish ONNX subgraph
l-bat Jan 15, 2021
8a7fc93
Merge pull request #835 from l-bat:lb/onnx_mish_subgraph
alalek Jan 16, 2021
176d1df
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Jan 16, 2021
f7df4bd
Merge pull request #834 from amiller27:inrange
alalek Jan 21, 2021
00ebf30
Added test data for pads calculating
l-bat Jan 22, 2021
61ea2e2
Merge pull request #837 from l-bat:lb/onnx_pads_calc
alalek Jan 25, 2021
a3e4431
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Jan 25, 2021
00d6a27
Added NormalizeL2 test data
l-bat Feb 1, 2021
fd7987c
Add files via upload
raaldrid Feb 1, 2021
960de6c
Merge pull request #842 from l-bat:lb/onnx_normalize
alalek Feb 3, 2021
49adb8d
Merge pull request #844 from SamFC10:tf-leakyrelu
jebastin-nadar Feb 4, 2021
847b72a
fixed straight barcode type in perf due to a change in default barcod…
rayonnant14 Feb 5, 2021
338ae84
Merge pull request #845 from rayonnant14:issue_19363
alalek Feb 5, 2021
e99108c
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Feb 5, 2021
209d9b5
Merge pull request #843 from raaldrid:raaldrid-exif_PNG_test_files
alalek Feb 10, 2021
9aa9278
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Feb 12, 2021
995c6d3
Merge pull request #841 from amirtu:OCV-165_finalize_goodFeaturesToTr…
amirtu Feb 15, 2021
b67584e
Added data for exp layer test
jebastin-nadar Feb 16, 2021
ac84493
Added tanh testdata
aryanshomray Feb 17, 2021
c9b7711
Merge pull request #847 from aryanshomray:tanh_darlnet_testdata
alalek Feb 17, 2021
9fdf339
input video files for video acceleration test
mikhail-nikolskiy Feb 17, 2021
14ba346
Merge pull request #853 from SamFC10:exp
alalek Feb 20, 2021
4544823
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Feb 21, 2021
4020ba6
Added data for exp layer test
jebastin-nadar Feb 16, 2021
9491aae
Merge pull request #858 from alalek:backport_19545
alalek Feb 28, 2021
097652f
Merge pull request #855 from mikhail-nikolskiy:videoio-hw
alalek Mar 1, 2021
ee5c8ba
Data for SAM Darknet
jebastin-nadar Mar 3, 2021
6f3fd2e
Aligned TF Reshape layer behaviour
Feb 28, 2021
cff30e3
Merge pull request #859 from raaldrid:EXR_rw_alpha_support_16115
raaldrid Mar 5, 2021
e7fb489
Merge pull request #861 from SamFC10:sam-darknet
alalek Mar 5, 2021
71f2370
Merge pull request #857 from LupusSanctus:am/tf_reshape
alalek Mar 6, 2021
d69fabc
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Mar 6, 2021
1f99fc6
Added TF sum behaviour alignment
Feb 7, 2021
8a5800a
Merge pull request #849 from LupusSanctus:am/eltwice_vec
alalek Mar 23, 2021
7f5d272
Corrected DNN elementwise multiplication
Mar 22, 2021
f79a6f0
Added reshape corrections
Mar 23, 2021
5e02386
Merge pull request #865 from LupusSanctus:am/mobilenetv3
alalek Mar 24, 2021
4599b44
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Mar 24, 2021
ae4099b
Merge pull request #854 from LupusSanctus:am/slice_steps
Mar 26, 2021
b07f9e0
G2O sphere added for pose graph testing
savuor Mar 26, 2021
a9c2bb8
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Mar 27, 2021
3b66fc4
Added reduce sum by channel support
Mar 28, 2021
b6430de
Merge pull request #868 from LupusSanctus:am/reduce_sum_ch
alalek Mar 30, 2021
2830444
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Apr 1, 2021
855c452
Merge pull request #869 from savuor:posegraph_no_ceres
alalek Apr 1, 2021
2e02a98
Merge branch 4.x
alalek Apr 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
10,847 changes: 10,847 additions & 0 deletions testdata/cv/rgbd/sphere_bignoise_vertex3.g2o

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions testdata/cv/stereomatching/algorithms/cuda_stereosgm_params.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<opencv_storage>
<params>
<!-- caseName, datasetName, numDisp, mode -->
case_barn2_1 barn2 "64" "1"
case_barn2_3 barn2 "64" "3"
case_bull_1 bull "64" "1"
case_bull_3 bull "64" "3"
case_cones_1 cones "64" "1"
case_cones_3 cones "64" "3"
case_poster_1 poster "64" "1"
case_poster_3 poster "64" "3"
case_sawtooth_1 sawtooth "64" "1"
case_sawtooth_3 sawtooth "64" "3"
case_teddy_1 teddy "64" "1"
case_teddy_3 teddy "64" "3"
case_tsukuba_1 tsukuba "64" "1"
case_tsukuba_3 tsukuba "64" "3"
case_venus_1 venus "64" "1"
case_venus_3 venus "64" "3"
</params>
</opencv_storage>
324 changes: 324 additions & 0 deletions testdata/cv/stereomatching/algorithms/cuda_stereosgm_res.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions testdata/dnn/darknet/generate_darknet_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ def genTestData(name, inpShape, outShape):
genTestData('route', [1, 4, 3, 6], [1, 2, 2, 3])
genTestData('route_multi', [1, 6, 3, 6], [1, 4, 2, 3])
genTestData('relu', [1, 2, 3, 4], [1, 2, 3, 4])
genTestData('sam', [1, 2, 3, 4], [1, 4, 3, 4])

22 changes: 22 additions & 0 deletions testdata/dnn/darknet/sam.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[net]
batch=1
channels=2
height=3
width=4

[convolutional]
filters=4
size=3
stride=1
pad=1
activation=leaky

[convolutional]
filters=4
size=1
stride=1
pad=1
activation=logistic

[sam]
from=-2
Binary file added testdata/dnn/darknet/sam.weights
Binary file not shown.
Binary file added testdata/dnn/darknet/sam_in.npy
Binary file not shown.
Binary file added testdata/dnn/darknet/sam_out.npy
Binary file not shown.
12 changes: 12 additions & 0 deletions testdata/dnn/darknet/tanh.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[net]
batch=1
channels=2
height=2
width=2

# Just an identity layer to enable relative reference of shortcut layer.
[maxpool]
size=1
stride=1
activation=tanh

Binary file added testdata/dnn/darknet/tanh_in.npy
Binary file not shown.
Binary file added testdata/dnn/darknet/tanh_out.npy
Binary file not shown.
12 changes: 11 additions & 1 deletion testdata/dnn/download_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get(self):
return True

basedir = os.path.dirname(self.filename)
if not os.path.exists(basedir):
if basedir and not os.path.exists(basedir):
print(' creating directory: ' + basedir)
os.makedirs(basedir, exist_ok=True)

Expand Down Expand Up @@ -864,6 +864,16 @@ def get_confirm_token(response): # in case of large files
downloader=GDrive('1j4UTqVE4EGaUFiK7a5I_CYX7twO9c5br'),
sha='49776d262993c387542f84d9cd16566840404f26',
filename='gsoc2016-goturn/goturn.caffemodel'),
Model(
name='crnn',
url='https://drive.google.com/uc?export=dowload&id=1ooaLR-rkTl8jdpGy1DoQs0-X0lQsB6Fj',
sha='270d92c9ccb670ada2459a25977e8deeaf8380d3',
filename='onnx/models/crnn.onnx'),
Model(
name='DB_TD500_resnet50',
url='https://drive.google.com/uc?export=dowload&id=19YWhArrNccaoSza0CfkXlA8im4-lAGsR',
sha='1b4dd21a6baa5e3523156776970895bd3db6960a',
filename='onnx/models/DB_TD500_resnet50.onnx'),
]

# Note: models will be downloaded to current working directory
Expand Down
Binary file added testdata/dnn/onnx/data/input_calc_pads.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/input_exp.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/input_mish.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/input_normalize_fusion.npy
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added testdata/dnn/onnx/data/output_calc_pads.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/output_exp.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/output_mish.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/output_normalize_fusion.npy
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
90 changes: 88 additions & 2 deletions testdata/dnn/onnx/generate_onnx_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,62 @@ def forward(self, x):

class Slice(nn.Module):

def __init__(self):
def __init__(self, custom_slice=None):
self.custom_slice=custom_slice
super(Slice, self).__init__()

def forward(self, x):
if self.custom_slice:
return x[self.custom_slice]

return x[..., 1:-1, 0:3]

input = Variable(torch.randn(1, 2, 4, 4))
model = Slice()
save_data_and_model("slice", input, model)
save_data_and_model("slice_opset_11", input, model, version=11)

input_2 = Variable(torch.randn(6, 6))
custom_slice_list = [
slice(1, 3, 1),
slice(0, 3, 2)
]
model_2 = Slice(custom_slice=custom_slice_list)
save_data_and_model("slice_opset_11_steps_2d", input_2, model_2, version=11)
postprocess_model("models/slice_opset_11_steps_2d.onnx", [['height', 'width']])

input_3 = Variable(torch.randn(3, 6, 6))
custom_slice_list_3 = [
slice(None, None, 2),
slice(None, None, 2),
slice(None, None, 2)
]
model_3 = Slice(custom_slice=custom_slice_list_3)
save_data_and_model("slice_opset_11_steps_3d", input_3, model_3, version=11)
postprocess_model("models/slice_opset_11_steps_3d.onnx", [[3, 'height', 'width']])

input_4 = Variable(torch.randn(1, 3, 6, 6))
custom_slice_list_4 = [
slice(0, 5, None),
slice(None, None, None),
slice(1, None, 2),
slice(None, None, None)
]
model_4 = Slice(custom_slice=custom_slice_list_4)
save_data_and_model("slice_opset_11_steps_4d", input_4, model_4, version=11)
postprocess_model("models/slice_opset_11_steps_4d.onnx", [["batch_size", 3, 'height', 'width']])

input_5 = Variable(torch.randn(1, 2, 3, 6, 6))
custom_slice_list_5 = [
slice(None, None, None),
slice(None, None, None),
slice(0, None, 3),
slice(None, None, None),
slice(None, None, 2)
]
model_5 = Slice(custom_slice=custom_slice_list_5)
save_data_and_model("slice_opset_11_steps_5d", input_5, model_5, version=11)

class Eltwise(nn.Module):

def __init__(self):
Expand Down Expand Up @@ -958,6 +1003,14 @@ def forward(self, x):
model = Power(2)
save_data_and_model("pow2", x, model)

class Exp(nn.Module):
def forward(self, x):
return x.exp()

x = Variable(torch.randn(2, 2))
model = Exp()
save_data_and_model("exp", x, model)

class ReduceMaxGlobal(nn.Module):
def forward(self, x):
out = torch.max(x)
Expand Down Expand Up @@ -1224,4 +1277,37 @@ def forward(self, x):

x = Variable(torch.randn(1, 2, 20, 20))
model = Conv1ResizePoold()
save_data_and_model("conv_resize_pool_1d", x, model)
save_data_and_model("conv_resize_pool_1d", x, model)

class Mish(nn.Module):
def forward(self, x):
return x * (torch.tanh(F.softplus(x)))

x = Variable(torch.randn([1, 2, 2, 2]))
model = Mish()
save_data_and_model("mish", x, model)

class PadCalculation(nn.Module):
def forward(self, x):
y = F.max_pool2d(x, kernel_size=2)
diff_h = x.shape[2] - y.shape[2]
diff_w = x.shape[3] - y.shape[3]
y = F.pad(y, [diff_w // 2, diff_w - diff_w // 2, diff_h // 2, diff_h - diff_h // 2])
return y

x = Variable(torch.randn([1, 1, 3, 4]))
model = PadCalculation()
save_data_and_model("calc_pads", x, model, version=11)

class NormalizeFusion(nn.Module):
def forward(self, x):
mul = x * x
sum = torch.sum(mul, dim=(1), keepdim=True)
maximum = torch.clamp(sum, min=1e-8)
sqrt = torch.sqrt(maximum)
reciprocal = torch.reciprocal(sqrt)
return x * reciprocal

x = Variable(torch.randn([2, 3]))
model = NormalizeFusion()
save_data_and_model("normalize_fusion", x, model)
Binary file added testdata/dnn/onnx/models/calc_pads.onnx
Binary file not shown.
11 changes: 11 additions & 0 deletions testdata/dnn/onnx/models/exp.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pytorch1.7:P

01Exp_0"Exptorch-jit-exportZ
0


b
1


B
21 changes: 21 additions & 0 deletions testdata/dnn/onnx/models/mish.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pytorch1.7:�

01
Softplus_0"Softplus

12Tanh_1"Tanh

0
23Mul_2"Multorch-jit-exportZ
0




b
3




B
Binary file added testdata/dnn/onnx/models/normalize_fusion.onnx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added testdata/dnn/tensorflow/eltwise_add_vec_in.npy
Binary file not shown.
Binary file added testdata/dnn/tensorflow/eltwise_add_vec_net.pb
Binary file not shown.
Binary file added testdata/dnn/tensorflow/eltwise_add_vec_out.npy
Binary file not shown.
Binary file added testdata/dnn/tensorflow/eltwise_mul_vec_in.npy
Binary file not shown.
Binary file added testdata/dnn/tensorflow/eltwise_mul_vec_net.pb
Binary file not shown.
Binary file added testdata/dnn/tensorflow/eltwise_mul_vec_out.npy
Binary file not shown.
Loading