This patch makes testscripts using numpy use python3 instead of python2.
Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
rm -f tc${1}.c
rm -f meson.build
- cat <<EOF | python ../../tools/development/nnstreamerCodeGenCustomFilter.py
+ cat <<EOF | python3 ../../tools/development/nnstreamerCodeGenCustomFilter.py
testcase${1}
tc${1}
${2}
PATH_TO_DATA="../test_models/data/5"
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_DATA} blocksize=-1 ! application/octet-stream ! tensor_converter input-dim=32:32:3:1 input-type=float32 ! tensor_filter framework=caffe2 model=\"${PATH_TO_INIT_MODEL},${PATH_TO_PRED_MODEL}\" inputname=data input=32:32:3:1 inputtype=float32 output=10:1 outputtype=float32 outputname=softmax ! filesink location=tensorfilter.out.log" 1 0 0 $PERFORMANCE
-python checkLabel.py tensorfilter.out.log 5
+python3 checkLabel.py tensorfilter.out.log 5
testResult $? 1 "Golden test comparison" 0 1
report
callCompareTest testcase05.direct.log testcase05.passthrough.log 5 "Compare 5" 0 0
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=640,height=480,framerate=0/1 ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_filter framework=\"custom\" model=\"${PATH_TO_MODEL_S}\" custom=\"320x240\" ! filesink location=\"testcase06.scaled.log\" sync=true t. ! queue ! filesink location=\"testcase06.direct.log\" sync=true" 6 0 0 $PERFORMANCE
-python checkScaledTensor.py testcase06.direct.log 640 480 testcase06.scaled.log 320 240 3
+python3 checkScaledTensor.py testcase06.direct.log 640 480 testcase06.scaled.log 320 240 3
testResult $? 6 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=640,height=480,framerate=0/1 ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_filter framework=\"custom\" model=\"${PATH_TO_MODEL_S}\" custom=\"1280X960\" ! filesink location=\"testcase07.scaled.log\" sync=true t. ! queue ! filesink location=\"testcase07.direct.log\" sync=true" 7 0 0 $PERFORMANCE
-python checkScaledTensor.py testcase07.direct.log 640 480 testcase07.scaled.log 1280 960 3
+python3 checkScaledTensor.py testcase07.direct.log 640 480 testcase07.scaled.log 1280 960 3
testResult $? 7 "Golden test comparison" 0 1
# Test average (8)
fi
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=640,height=480,framerate=0/1 ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_filter framework=\"custom\" model=\"${PATH_TO_MODEL_SI}\" custom=\"320x240\" ! filesink location=\"testcase11.scaled.log\" sync=true t. ! queue ! filesink location=\"testcase11.direct.log\" sync=true" 11 0 0 $PERFORMANCE
-python checkScaledTensor.py testcase11.direct.log 640 480 testcase11.scaled.log 320 240 3
+python3 checkScaledTensor.py testcase11.direct.log 640 480 testcase11.scaled.log 320 240 3
testResult $? 11 "Golden test comparison" 0 1
# OpenCV Test
callCompareTest testcase12.direct.log testcase12.passthrough.log 12 "Compare 12" 0 0
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=640,height=480,framerate=0/1 ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_filter framework=\"custom\" model=\"${PATH_TO_MODEL}\" custom=\"320x240\" ! filesink location=\"testcase13.scaled.log\" sync=true t. ! queue ! filesink location=\"testcase13.direct.log\" sync=true" 13 0 0 $PERFORMANCE
- python checkScaledTensor.py testcase13.direct.log 640 480 testcase13.scaled.log 320 240 3
+ python3 checkScaledTensor.py testcase13.direct.log 640 480 testcase13.scaled.log 320 240 3
testResult $? 13 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=640,height=480,framerate=0/1 ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_filter framework=\"custom\" model=\"${PATH_TO_MODEL}\" custom=\"1920x1080\" ! filesink location=\"testcase14.scaled.log\" sync=true t. ! queue ! filesink location=\"testcase14.direct.log\" sync=true" 14 0 0 $PERFORMANCE
- python checkScaledTensor.py testcase14.direct.log 640 480 testcase14.scaled.log 1920 1080 3
+ python3 checkScaledTensor.py testcase14.direct.log 640 480 testcase14.scaled.log 1920 1080 3
testResult $? 14 "Golden test comparison" 0 1
fi
if [ -e $PATH_TO_MODEL ]; then
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=640,height=480,framerate=0/1 ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=transpose option=1:2:0:3 ! tensor_transform mode=typecast option=float32 ! tensor_filter framework=\"custom\" model=\"${PATH_TO_MODEL}\" custom=\"320:240:3\" ! tensor_transform mode=typecast option=uint8 ! tensor_transform mode=transpose option=2:0:1:3 ! filesink location=\"testcase16.scaled.log\" sync=true t. ! queue ! filesink location=\"testcase16.direct.log\" sync=true" 16 0 0 $PERFORMANCE
- python checkScaledTensor.py testcase16.direct.log 640 480 testcase16.scaled.log 320 240 3
+ python3 checkScaledTensor.py testcase16.direct.log 640 480 testcase16.scaled.log 320 240 3
testResult $? 16 "Golden test comparison" 0 1
fi
fi
fi
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_IMAGE} ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=GRAY8,framerate=0/1 ! tensor_converter ! tensor_filter framework=pytorch model=${PATH_TO_MODEL} input=1:28:28:1 inputtype=uint8 output=10:1:1:1 outputtype=uint8 ! filesink location=tensorfilter.out.log" 1 0 0 $PERFORMANCE
-python checkLabel.py tensorfilter.out.log ${PATH_TO_IMAGE}
+python3 checkLabel.py tensorfilter.out.log ${PATH_TO_IMAGE}
testResult $? 1 "Golden test comparison" 0 1
# Fail test for invalid input properties
# Input and output combination test
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc pattern=13 num-buffers=1 ! videoconvert ! video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! tee name=t t. ! queue ! mux.sink_0 t. ! queue ! filesink location=combi.dummy.golden buffer-mode=unbuffered sync=false async=false filesrc location=${PATH_TO_IMAGE} ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=GRAY8,framerate=0/1 ! tensor_converter ! mux.sink_1 tensor_mux name=mux ! tensor_filter framework=pytorch model=${PATH_TO_MODEL} input=1:28:28:1 inputtype=uint8 output=10:1:1:1 outputtype=uint8 inputCombination=1 outputCombination=i0,o0 ! tensor_demux name=demux demux.src_0 ! filesink location=tensorfilter.combi.in.log buffer-mode=unbuffered sync=false async=false demux.src_1 ! filesink location=tensorfilter.combi.out.log buffer-mode=unbuffered sync=false async=false" 4 0 0 $PERFORMANCE
callCompareTest combi.dummy.golden tensorfilter.combi.in.log 4_0 "Output Combination Golden Test 4-0" 1 0
-python checkLabel.py tensorfilter.out.log ${PATH_TO_IMAGE}
+python3 checkLabel.py tensorfilter.out.log ${PATH_TO_IMAGE}
testResult $? 1 "Golden test comparison" 0 1
# Test the setting of accelerators
PATH_TO_DATA="../test_models/data/9.raw"
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_DATA} ! application/octet-stream ! tensor_converter input-dim=784:1 input-type=uint8 ! tensor_transform mode=arithmetic option=typecast:float32,add:-127.5,div:127.5 ! tensor_filter framework=tensorflow model=${PATH_TO_MODEL} input=784:1 inputtype=float32 inputname=input output=10:1 outputtype=float32 outputname=softmax ! filesink location=tensorfilter.out.1.log " 1 0 0 $PERFORMANCE
-python checkLabel.py tensorfilter.out.1.log 9
+python3 checkLabel.py tensorfilter.out.1.log 9
testResult $? 1 "Golden test comparison" 0 1
# Input and output comnination test
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc pattern=13 num-buffers=1 ! videoconvert ! video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! tee name=t t. ! queue ! filesink location=combi.dummy.golden buffer-mode=unbuffered sync=false async=false t. ! queue ! mux.sink_0 filesrc location=${PATH_TO_DATA} ! application/octet-stream ! tensor_converter input-dim=784:1 input-type=uint8 ! tensor_transform mode=arithmetic option=typecast:float32,add:-127.5,div:127.5 ! mux.sink_1 tensor_mux name=mux ! tensor_filter framework=tensorflow model=${PATH_TO_MODEL} input=784:1 inputtype=float32 inputname=input output=10:1 outputtype=float32 outputname=softmax inputCombination=1 outputCombination=i0,o0 ! tensor_demux name=demux demux.src_0 ! queue ! filesink location=tensorfilter.combi.in.log buffer-mode=unbuffered sync=false async=false demux.src_1 ! queue ! filesink location=tensorfilter.out.1.log buffer-mode=unbuffered sync=false async=false" 2 0 0 $PERFORMANCE
callCompareTest combi.dummy.golden tensorfilter.combi.in.log 2_0 "Output Combination Golden Test 2-0" 1 0
-python checkLabel.py tensorfilter.out.1.log 9
+python3 checkLabel.py tensorfilter.out.1.log 9
testResult $? 1 "Golden test comparison" 0 1
# Test with speech command model (.wav file, answer is 'yes', this model has a input type DT_STRING.)
PATH_TO_DATA="../test_models/data/yes.wav"
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_DATA} blocksize=-1 ! application/octet-stream ! tensor_converter input-dim=1:16022 input-type=int16 ! tensor_filter framework=tensorflow model=${PATH_TO_MODEL} input=1:16022 inputtype=int16 inputname=wav_data output=12:1 outputtype=float32 outputname=labels_softmax ! filesink location=tensorfilter.out.3.log " 3 0 0 $PERFORMANCE
-python checkLabel.py tensorfilter.out.3.log 2
+python3 checkLabel.py tensorfilter.out.3.log 2
testResult $? 2 "Golden test comparison" 0 1
report
PATH_TO_IMAGE="../test_models/data/orange.png"
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_IMAGE} ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,framerate=0/1 ! tensor_converter ! tensor_filter framework=tensorflow2-lite model=${PATH_TO_MODEL} ! filesink location=tensorfilter.out.log" 1 0 0 $PERFORMANCE
-python checkLabel.py tensorfilter.out.log ${PATH_TO_LABEL} orange
+python3 checkLabel.py tensorfilter.out.log ${PATH_TO_LABEL} orange
testResult $? 1 "Golden test comparison" 0 1
# Fail test for invalid input properties
PATH_TO_IMAGE="../test_models/data/orange.png"
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_IMAGE} ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,framerate=0/1 ! tensor_converter ! tensor_filter framework=tensorflow1-lite model=${PATH_TO_MODEL} ! filesink location=tensorfilter.out.log" 1 0 0 $PERFORMANCE
-python checkLabel.py tensorfilter.out.log ${PATH_TO_LABEL} orange
+python3 checkLabel.py tensorfilter.out.log ${PATH_TO_LABEL} orange
testResult $? 1 "Golden test comparison" 0 1
# Fail test for invalid input properties
# Input and output combination test
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc pattern=13 num-buffers=1 ! videoconvert ! video/x-raw,width=640,height=480,framerate=30/1 ! tensor_converter ! tee name=t t. ! queue ! mux.sink_0 t. ! queue ! filesink location=combi.dummy.golden buffer-mode=unbuffered sync=false async=false filesrc location=${PATH_TO_IMAGE} ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,framerate=0/1 ! tensor_converter ! mux.sink_1 tensor_mux name=mux ! tensor_filter framework=tensorflow1-lite model=${PATH_TO_MODEL} inputCombination=1 outputCombination=i0,o0 ! tensor_demux name=demux demux.src_0 ! filesink location=tensorfilter.combi.in.log buffer-mode=unbuffered sync=false async=false demux.src_1 ! filesink location=tensorfilter.combi.out.log buffer-mode=unbuffered sync=false async=false" 7 0 0 $PERFORMANCE
callCompareTest combi.dummy.golden tensorfilter.combi.in.log 7_0 "Output Combination Golden Test 7-0" 1 0
-python checkLabel.py tensorfilter.combi.out.log ${PATH_TO_LABEL} orange
+python3 checkLabel.py tensorfilter.combi.out.log ${PATH_TO_LABEL} orange
testResult $? 1 "Golden test comparison" 0 1
# Test the backend setting done with tensorflow1-lite
! tensor_transform mode=arithmetic option=typecast:float32,div:-255.0,add:1
! tensor_filter framework=tensorrt model=${PATH_TO_MODEL} input=28:28:1 inputtype=float32 inputname=in output=10 outputtype=float32 outputname=out
! filesink location=sj.out.log " 1 0 0 $PERFORMANCE
-python CheckMnist.py ./sj.out.log 1
+python3 CheckMnist.py ./sj.out.log 1
testResult $? 1 "Golden test comparison" 0 1
gstTest "-v --gst-plugin-path=${PATH_TO_PLUGIN} filesrc location=${PATH_TO_DATA_9} ! image/x-portable-graymap,width=28,height=28,framerate=0/1
! tensor_transform mode=arithmetic option=typecast:float32,div:-255.0,add:1
! tensor_filter framework=tensorrt model=${PATH_TO_MODEL} input=28:28:1 inputtype=float32 custom=input_rank:3 inputname=in output=10 outputtype=float32 outputname=out
! filesink location=sj.out.log " 2 0 0 $PERFORMANCE
-python CheckMnist.py ./sj.out.log 9
+python3 CheckMnist.py ./sj.out.log 9
testResult $? 2 "Golden test comparison" 0 1
else
echo "Test Case Generation Started"
python ../nnstreamer_converter/generateGoldenTestResult.py 9
- python ../nnstreamer_merge/generateTest.py
+ python3 ../nnstreamer_merge/generateTest.py
sopath=$1
fi
convertBMP2PNG
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
else
echo "Test Case Generation Started"
python ../nnstreamer_converter/generateGoldenTestResult.py 9
- python generateTest.py
+ python3 generateTest.py
sopath=$1
fi
convertBMP2PNG
else
echo "Test Case Generation Started"
python ../nnstreamer_converter/generateGoldenTestResult.py 9
- python ../nnstreamer_merge/generateTest.py
+ python3 ../nnstreamer_merge/generateTest.py
sopath=$1
fi
convertBMP2PNG
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
#
fi
# Generate video_4x4xBGRx.xraw & golden
-python generateTestCase.py
+python3 generateTestCase.py
gstTest "--gst-plugin-path=../../build \
tensor_mux name=mux sync_mode=nosync ! \
fi
# Generate video_4x4xBGRx.xraw
-python generateTestCase.py
+python3 generateTestCase.py
gstTest "--gst-plugin-path=../../build tensor_mux name=mux sync_mode=nosync ! tensor_filter framework=custom model=${RNN_DIR}/libdummyRNN.${SO_EXT} ! tee name=t ! queue ! tensor_reposink slot-index=0 silent=false filesrc location=\"video_4x4xBGRx.xraw\" ! application/octet-stream ! tensor_converter input-dim=4:4:4:1 input-type=uint8 ! mux.sink_0 tensor_reposrc slot-index=0 silent=false caps=\"other/tensor,dimension=(string)4:4:4:1,type=(string)uint8,framerate=(fraction)0/1\" ! mux.sink_1 t. ! queue ! multifilesink location=\"out_%1d.log\"" 1 0 0 $PERFORMANCE
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
# Test with small stream (1, 2)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float32 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=add:-10 ! filesink location=\"testcase01.arithmetic.log\" sync=true t. ! queue ! filesink location=\"testcase01.direct.log\" sync=true" 1 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase01.direct.log testcase01.arithmetic.log 4 4 f f add -10 0
+python3 checkResult.py arithmetic testcase01.direct.log testcase01.arithmetic.log 4 4 f f add -10 0
testResult $? 1 "Golden test comparison" 0 1
# Test with small stream (1, 2)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float32 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=mul:2.0 ! filesink location=\"testcase02.arithmetic.log\" sync=true t. ! queue ! filesink location=\"testcase02.direct.log\" sync=true" 2 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase02.direct.log testcase02.arithmetic.log 4 4 f f mul 2.0 0
+python3 checkResult.py arithmetic testcase02.direct.log testcase02.arithmetic.log 4 4 f f mul 2.0 0
testResult $? 2 "Golden test comparison" 0 1
# Test for mul with floating-point operand
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float32 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=mul:-5.5 ! filesink location=\"testcase03.arithmetic.1.log\" sync=true t. ! queue ! filesink location=\"testcase03.direct.1.log\" sync=true" 3 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase03.direct.1.log testcase03.arithmetic.1.log 4 4 f f mul -5.5 0
+python3 checkResult.py arithmetic testcase03.direct.1.log testcase03.arithmetic.1.log 4 4 f f mul -5.5 0
testResult $? 3 "Golden test comparison" 0 1
# Test 3-2 for typecast,mul with floating-point operand
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:float32,mul:-5.5 ! filesink location=\"testcase03.arithmetic.2.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=float32 ! filesink location=\"testcase03.direct.2.log\" sync=true" 3-2 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase03.direct.2.log testcase03.arithmetic.2.log 4 4 f f mul -5.5 0
+python3 checkResult.py arithmetic testcase03.direct.2.log testcase03.arithmetic.2.log 4 4 f f mul -5.5 0
testResult $? 3-2 "Golden test comparison" 0 1
# Test for add with floating-point operand
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float64 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=add:9.900000e-001 ! filesink location=\"testcase04.arithmetic.log\" sync=true t. ! queue ! filesink location=\"testcase04.direct.log\" sync=true" 4 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase04.direct.log testcase04.arithmetic.log 8 8 d d add 9.900000e-001 0
+python3 checkResult.py arithmetic testcase04.direct.log testcase04.arithmetic.log 8 8 d d add 9.900000e-001 0
testResult $? 4 "Golden test comparison" 0 1
# Test for add with two floating-point operand: the second operand will be ignored.
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float64 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=add:9.900000e-001:-80.256 ! filesink location=\"testcase04.arithmetic.ok.log\" sync=true t. ! queue ! filesink location=\"testcase04.direct.ok.log\" sync=true" 4-OK 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase04.direct.ok.log testcase04.arithmetic.ok.log 8 8 d d add 9.900000e-001 -80.256
+python3 checkResult.py arithmetic testcase04.direct.ok.log testcase04.arithmetic.ok.log 8 8 d d add 9.900000e-001 -80.256
testResult $? 4-OK "Golden test comparison" 0 1
# Test for add,mul with floating-point operands
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float64 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=add:-9.3,mul:-11.4823e-002 ! filesink location=\"testcase05.arithmetic.log\" sync=true t. ! queue ! filesink location=\"testcase05.direct.log\" sync=true" 5 0 0 $PERFORMANCE
testResult $? 5 "Golden test comparison" 0 1
-python checkResult.py arithmetic testcase05.direct.log testcase05.arithmetic.log 8 8 d d add-mul -9.3 -11.4823e-002
+python3 checkResult.py arithmetic testcase05.direct.log testcase05.arithmetic.log 8 8 d d add-mul -9.3 -11.4823e-002
# Test for mul,add with floating-point operands
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tensor_transform mode=typecast option=float64 ! tee name=t ! queue ! tensor_transform mode=arithmetic option=mul:-50.0987e+003,add:15.3 ! filesink location=\"testcase06.arithmetic.log\" sync=true t. ! queue ! filesink location=\"testcase06.direct.log\" sync=true" 6 0 0 $PERFORMANCE
testResult $? 6 "Golden test comparison" 0 1
-python checkResult.py arithmetic testcase06.direct.log testcase06.arithmetic.log 8 8 d d add-mul -50.0987e+003 15.3
+python3 checkResult.py arithmetic testcase06.direct.log testcase06.arithmetic.log 8 8 d d add-mul -50.0987e+003 15.3
# Test for mul with tensors typecasted to int8 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:int8,mul:-3 acceleration=false ! filesink location=\"testcase07.arithmetic.1.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=int8 acceleration=false ! filesink location=\"testcase07.direct.1.log\" sync=true" 7-1 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.1.log testcase07.arithmetic.1.log 1 1 b b mul -3 0
+python3 checkResult.py arithmetic testcase07.direct.1.log testcase07.arithmetic.1.log 1 1 b b mul -3 0
testResult $? 7-1 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to uint8 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:uint8,mul:1 acceleration=false ! filesink location=\"testcase07.arithmetic.2.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=uint8 acceleration=false ! filesink location=\"testcase07.direct.2.log\" sync=true" 7-2 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.2.log testcase07.arithmetic.2.log 1 1 B B mul 1 0
+python3 checkResult.py arithmetic testcase07.direct.2.log testcase07.arithmetic.2.log 1 1 B B mul 1 0
testResult $? 7-2 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to int16 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:int16,mul:-16 acceleration=false ! filesink location=\"testcase07.arithmetic.3.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=int16 acceleration=false ! filesink location=\"testcase07.direct.3.log\" sync=true" 7-3 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.3.log testcase07.arithmetic.3.log 2 2 h h mul -16 0
+python3 checkResult.py arithmetic testcase07.direct.3.log testcase07.arithmetic.3.log 2 2 h h mul -16 0
testResult $? 7-3 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to uint16 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:uint16,mul:16 acceleration=false ! filesink location=\"testcase07.arithmetic.4.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=uint16 acceleration=false ! filesink location=\"testcase07.direct.4.log\" sync=true" 7-4 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.4.log testcase07.arithmetic.4.log 2 2 H H mul 16 0
+python3 checkResult.py arithmetic testcase07.direct.4.log testcase07.arithmetic.4.log 2 2 H H mul 16 0
testResult $? 7-4 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to int32 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:int32,mul:-255 acceleration=false ! filesink location=\"testcase07.arithmetic.5.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=int32 acceleration=false ! filesink location=\"testcase07.direct.5.log\" sync=true" 7-5 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.5.log testcase07.arithmetic.5.log 4 4 i i mul -255 0
+python3 checkResult.py arithmetic testcase07.direct.5.log testcase07.arithmetic.5.log 4 4 i i mul -255 0
testResult $? 7-5 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to uint32 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:uint32,mul:255 acceleration=false ! filesink location=\"testcase07.arithmetic.6.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=uint32 acceleration=false ! filesink location=\"testcase07.direct.6.log\" sync=true" 7-6 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.6.log testcase07.arithmetic.6.log 4 4 I I mul 255 0
+python3 checkResult.py arithmetic testcase07.direct.6.log testcase07.arithmetic.6.log 4 4 I I mul 255 0
testResult $? 7-6 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to int64 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:int64,mul:-65535 acceleration=false ! filesink location=\"testcase07.arithmetic.7.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=int64 acceleration=false ! filesink location=\"testcase07.direct.7.log\" sync=true" 7-7 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.7.log testcase07.arithmetic.7.log 8 8 q q mul -65535 0
+python3 checkResult.py arithmetic testcase07.direct.7.log testcase07.arithmetic.7.log 8 8 q q mul -65535 0
testResult $? 7-7 "Golden test comparison" 0 1
# Test for mul with tensors typecasted to uint64 (acceleration=false)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=arithmetic option=typecast:uint64,mul:65535 acceleration=false ! filesink location=\"testcase07.arithmetic.8.log\" sync=true t. ! queue ! tensor_transform mode=typecast option=uint64 acceleration=false ! filesink location=\"testcase07.direct.8.log\" sync=true" 7-8 0 0 $PERFORMANCE
-python checkResult.py arithmetic testcase07.direct.8.log testcase07.arithmetic.8.log 8 8 Q Q mul 65535 0
+python3 checkResult.py arithmetic testcase07.direct.8.log testcase07.arithmetic.8.log 8 8 Q Q mul 65535 0
testResult $? 7-8 "Golden test comparison" 0 1
# Fail Test for the option string is wrong
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
sopath=$2
else
echo "Test Case Generation Started"
- python generateTest.py
+ python3 generateTest.py
sopath=$1
fi
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
# dim1 = 3 (RGB)
# rbs = 16 x 16 x 3
# es = 1
-python checkResult.py dimchg0:b testcase01.direct.log testcase01.dimchg02.log 3 768 1
+python3 checkResult.py dimchg0:b testcase01.direct.log testcase01.dimchg02.log 3 768 1
testResult $? 1 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=dimchg option=0:2 ! filesink location=\"testcase02.dimchg02.log\" sync=true t. ! queue ! filesink location=\"testcase02.direct.log\" sync=true" 2 0 0 $PERFORMANCE
# dim1 = 3 (RGB)
# rbs = 16 x 16 x 3
# es = 1
-python checkResult.py dimchg0:b testcase02.direct.log testcase02.dimchg02.log 4 1024 1
+python3 checkResult.py dimchg0:b testcase02.direct.log testcase02.dimchg02.log 4 1024 1
testResult $? 2 "Golden test comparison" 0 1
report
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
sopath=$2
else
echo "Test Case Generation Started"
- python generateTest.py
+ python3 generateTest.py
sopath=$1
fi
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"test_%02d.dat\" caps=\"application/octet-stream\" ! tensor_converter input-dim=50:100:1:1 input-type=float32 ! tensor_transform mode=stand option=default ! multifilesink location=\"./result_%02d.log\" sync=true" 1 0 0 $PERFORMANCE
-python checkResult.py standardization test_00.dat.golden result_00.log 4 4 f f default
+python3 checkResult.py standardization test_00.dat.golden result_00.log 4 4 f f default
testResult $? 1 "Golden test comparison" 0 1
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
sopath=$2
else
echo "Test Case Generation Started"
- python generateTest.py
+ python3 generateTest.py
sopath=$1
fi
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
# SPDX-License-Identifier: LGPL-2.1-only
# Test with small stream (1, 2)
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=RGB ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=uint32 ! filesink location=\"testcase01.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase01.direct.log\" sync=true" 1 0 0 $PERFORMANCE
# uint8 -> uint32
-python checkResult.py typecast testcase01.direct.log testcase01.typecast.log uint8 1 B uint32 4 I
+python3 checkResult.py typecast testcase01.direct.log testcase01.typecast.log uint8 1 B uint32 4 I
testResult $? 1 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=uint16 ! filesink location=\"testcase02.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase02.direct.log\" sync=true" 2 0 0 $PERFORMANCE
# uint8 -> uint32
-python checkResult.py typecast testcase02.direct.log testcase02.typecast.log uint8 1 B uint16 2 H
+python3 checkResult.py typecast testcase02.direct.log testcase02.typecast.log uint8 1 B uint16 2 H
testResult $? 2 "Golden test comparison" 0 1
# Fail Test: Unknown data type is given
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=int8 ! filesink location=\"testcase03.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase03.direct.log\" sync=true" 3 0 0 $PERFORMANCE
# uint8 -> int8
-python checkResult.py typecast testcase03.direct.log testcase03.typecast.log uint8 1 B int8 1 b
+python3 checkResult.py typecast testcase03.direct.log testcase03.typecast.log uint8 1 B int8 1 b
testResult $? 3 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=uint32 ! tensor_transform mode=typecast option=uint8 ! filesink location=\"testcase04.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase04.direct.log\" sync=true" 4 0 0 $PERFORMANCE
# uint8 -> uint32 -> uint8
-python checkResult.py typecast testcase04.direct.log testcase04.typecast.log uint8 1 B uint8 1 B
+python3 checkResult.py typecast testcase04.direct.log testcase04.typecast.log uint8 1 B uint8 1 B
testResult $? 4 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=float32 ! filesink location=\"testcase05.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase05.direct.log\" sync=true" 5 0 0 $PERFORMANCE
# uint8 -> float32
-python checkResult.py typecast testcase05.direct.log testcase05.typecast.log uint8 1 B float32 4 f
+python3 checkResult.py typecast testcase05.direct.log testcase05.typecast.log uint8 1 B float32 4 f
testResult $? 5 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=float64 ! filesink location=\"testcase06.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase06.direct.log\" sync=true" 6 0 0 $PERFORMANCE
# uint8 -> float64
-python checkResult.py typecast testcase06.direct.log testcase06.typecast.log uint8 1 B float64 8 d
+python3 checkResult.py typecast testcase06.direct.log testcase06.typecast.log uint8 1 B float64 8 d
testResult $? 6 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=int8 ! tensor_transform mode=typecast option=float32 ! tensor_transform mode=typecast option=float64 ! tensor_transform mode=typecast option=int64 ! tensor_transform mode=typecast option=uint8 ! filesink location=\"testcase07.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase07.direct.log\" sync=true" 7 0 0 $PERFORMANCE
# uint8 -> int8 -> float32 -> float64 -> int64 -> uint8
-python checkResult.py typecast testcase07.direct.log testcase07.typecast.log uint8 1 B uint8 1 B
+python3 checkResult.py typecast testcase07.direct.log testcase07.typecast.log uint8 1 B uint8 1 B
testResult $? 7 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=int8 ! tensor_transform mode=typecast option=float32 ! tensor_transform mode=typecast option=float64 ! tensor_transform mode=typecast option=uint8 ! filesink location=\"testcase08.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase08.direct.log\" sync=true" 8 0 0 $PERFORMANCE
# uint8 -> int8 -> float32 -> float64 -> uint8
-python checkResult.py typecast testcase08.direct.log testcase08.typecast.log uint8 1 B uint8 1 B
+python3 checkResult.py typecast testcase08.direct.log testcase08.typecast.log uint8 1 B uint8 1 B
testResult $? 8 "Golden test comparison" 0 1
gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} multifilesrc location=\"testsequence_%1d.png\" index=0 caps=\"image/png,framerate=\(fraction\)30/1\" ! pngdec ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter ! tee name=t ! queue ! tensor_transform mode=typecast option=int8 ! tensor_transform mode=typecast option=float32 ! tensor_transform mode=typecast option=uint16 ! tensor_transform mode=typecast option=uint8 ! filesink location=\"testcase09.typecast.log\" sync=true t. ! queue ! filesink location=\"testcase09.direct.log\" sync=true" 9 0 0 $PERFORMANCE
# uint8 -> int8 -> float32 -> uint16 -> uint8
-python checkResult.py typecast testcase09.direct.log testcase09.typecast.log uint8 1 B uint8 1 B
+python3 checkResult.py typecast testcase09.direct.log testcase09.typecast.log uint8 1 B uint8 1 B
testResult $? 9 "Golden test comparison" 0 1
report