Files
BPI-CM9-Linux/aml-comp/multimedia/gst-aml-utils/detect-library/nn_test/nn_test.sh
T
2026-08-24 10:03:24 +08:00

34 lines
883 B
Bash
Executable File

#!/bin/bash
nn_input_path="/etc/nn_input/bin"
test_shell_dir="/etc/nn_test"
bin_file="$nn_input_path/space_shuttle_416x416.bin"
result_compare_script="$test_shell_dir/nn_result_campare.sh"
golden_result="$test_shell_dir/golden_result.txt"
generated_result="$nn_input_path/space_shuttle_416x416_result.txt"
if [ -f "$bin_file" ]; then
echo "Input file exists: $bin_file"
else
echo "Error: Input file does not exist: $bin_file"
exit 1
fi
/usr/bin/nnsample 2 "$bin_file"
if [ $? -ne 0 ]; then
echo "Error: /usr/bin/nnsample command failed"
exit 1
fi
if [ -f "$generated_result" ]; then
echo "Result file generated: $generated_result"
else
echo "Error: Result file does not exist: $generated_result"
exit 1
fi
"$result_compare_script" "$golden_result" "$generated_result"
if [ $? -ne 0 ]; then
echo "Error: Comparison script failed"
exit 1
fi