chore: additional resize by resolution debugging

main
Sean McBride 4 years ago
parent a904164f88
commit 5f2804939c

@ -156,9 +156,9 @@ jobs:
run: | run: |
./test.sh image_resize ./test.sh image_resize
if: success() || failure() if: success() || failure()
- name: License Plate Detection by Resolution - name: Image Resize by Resolution
run: | run: |
./test.sh lpd_by_resolution ./test.sh image_resize_by_resolution
if: success() || failure() if: success() || failure()
- name: License Plate Detection by Plate Count - name: License Plate Detection by Plate Count
run: | run: |

@ -12,7 +12,7 @@ log="$experiment_directory/log.csv"
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
SLEDGE_SANDBOX_PERF_LOG=$log PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" & SLEDGE_SANDBOX_PERF_LOG=$log PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" &
sleep 2 sleep 3
else else
echo "Running under gdb" echo "Running under gdb"
fi fi
@ -24,31 +24,43 @@ for ((i = 0; i < total_count; i++)); do
echo "$i" echo "$i"
ext="$RANDOM" ext="$RANDOM"
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "result_${ext}_small.png" localhost:10000 # Small
pixel_differences="$(compare -identify -metric AE "result_${ext}_small.png" expected_result_small.png null: 2>&1 > /dev/null)" if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "result_${ext}_small.png" localhost:10000; then
echo "Pixel Differences: $pixel_differences" pixel_differences="$(compare -identify -metric AE "result_${ext}_small.png" expected_result_small.png null: 2>&1 > /dev/null)"
if [[ "$pixel_differences" != "0" ]]; then echo "Pixel Differences: $pixel_differences"
echo "Small FAIL" if [[ "$pixel_differences" != "0" ]]; then
echo "$pixel_differences pixel differences detected" echo "Small FAIL"
exit 1 echo "$pixel_differences pixel differences detected"
exit 1
fi
else
echo "curl failed with $?"
fi fi
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "result_${ext}_medium.png" localhost:10001 # Medium
pixel_differences="$(compare -identify -metric AE "result_${ext}_medium.png" expected_result_medium.png null: 2>&1 > /dev/null)" if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "result_${ext}_medium.png" localhost:10001; then
echo "Pixel Differences: $pixel_differences" pixel_differences="$(compare -identify -metric AE "result_${ext}_medium.png" expected_result_medium.png null: 2>&1 > /dev/null)"
if [[ "$pixel_differences" != "0" ]]; then echo "Pixel Differences: $pixel_differences"
echo "Small FAIL" if [[ "$pixel_differences" != "0" ]]; then
echo "$pixel_differences pixel differences detected" echo "Medium FAIL"
exit 1 echo "$pixel_differences pixel differences detected"
exit 1
fi
else
echo "curl failed with $?"
fi fi
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "result_${ext}_large.png" localhost:10002 # Large
pixel_differences="$(compare -identify -metric AE "result_${ext}_large.png" expected_result_large.png null: 2>&1 > /dev/null)" if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "result_${ext}_large.png" localhost:10002; then
echo "Pixel Differences: $pixel_differences" pixel_differences="$(compare -identify -metric AE "result_${ext}_large.png" expected_result_large.png null: 2>&1 > /dev/null)"
if [[ "$pixel_differences" != "0" ]]; then echo "Pixel Differences: $pixel_differences"
echo "Small FAIL" if [[ "$pixel_differences" != "0" ]]; then
echo "$pixel_differences pixel differences detected" echo "Large FAIL"
exit 1 echo "$pixel_differences pixel differences detected"
exit 1
fi
else
echo "curl failed with $?"
fi fi
success_count=$((success_count + 1)) success_count=$((success_count + 1))

@ -20,7 +20,7 @@ declare -ra tests=(
ekf_one_iteration ekf_one_iteration
image_classification image_classification
image_resize image_resize
lpd_by_resolution image_resize_by_resolution
lpd_by_plate_count lpd_by_plate_count
bimodal bimodal
concurrency concurrency
@ -139,13 +139,13 @@ image_resize() {
return 0 return 0
} }
lpd_by_resolution() { image_resize_by_resolution() {
if [[ ! -f "$base_dir/runtime/bin/lpd_wasm.so" ]]; then if [[ ! -f "$base_dir/runtime/bin/resize_wasm.so" ]]; then
make sod -C "$base_dir/runtime/tests" || exit 1 make sod -C "$base_dir/runtime/tests" || exit 1
fi fi
pushd "$base_dir/runtime/experiments/applications/imageresize/by_resolution" || exit 1 pushd "$base_dir/runtime/experiments/applications/imageresize/by_resolution" || exit 1
./install.sh || exit 1 ./install.sh || exit 1
./run.sh || failed_tests+=("lpd_by_resolution") ./run.sh || failed_tests+=("image_resize_resolution")
popd || exit 1 popd || exit 1
return 0 return 0
} }

Loading…
Cancel
Save