Skip to content

Instantly share code, notes, and snippets.

@headupinclouds
Created April 28, 2019 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headupinclouds/4bb7928cdd6b77955f92524e47d2af40 to your computer and use it in GitHub Desktop.
Save headupinclouds/4bb7928cdd6b77955f92524e47d2af40 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
# Get a test image:
wget https://s-i.huffpost.com/gen/2125210/images/n-EYES-628x314.jpg
TOOLCHAIN=gcc-5-pic-hid-sections
CONFIG=Release
function build_acf
{
ES2=${1}
ES3=${2}
ACF_USE_EGL=ON
acf_args=(
--toolchain ${TOOLCHAIN}
--config-all ${CONFIG}
--verbose
--install
--clear
--test
--fwd
ACF_OPENGL_ES2=${ES2}
ACF_OPENGL_ES3=${ES3}
ACF_HAS_GPU=ON
ACF_BUILD_OGLES_GPGPU=ON
ACF_BUILD_TESTS=ON
ACF_USE_EGL=${ACF_USE_EGL}
)
polly.py ${acf_args[@]}
}
function run_acf
{
ES2=${1}
ES3=${2}
run_args=(
--input=n-EYES-628x314.jpg
--model=_install/${TOOLCHAIN}/share/acf_unsplash_60x40_eye_any_color_d4.cpb
--nms
--annotate
--calibration=-0.002
)
name=${TOOLCHAIN}_es2${ES2}_es3${ES3}_cpu
mkdir -p ${name}
args=(
--output=${name}
)
_install/${TOOLCHAIN}/bin/acf-detect ${run_args[@]} ${args[@]} | tee ${name}.txt
name=${TOOLCHAIN}_es2${ES2}_es3${ES3}_gpu
mkdir -p ${name}
args=(
--output=${name}
--gpu
)
_install/${TOOLCHAIN}/bin/acf-detect ${run_args[@]} ${args[@]} | tee ${name}.txt
}
function eye_test
{
build_acf ${1} ${2}
run_acf ${1} ${2}
}
eye_test ON OFF # OpenGL ES 2.0
eye_test OFF OFF # OpenGL (compatible subset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment