blob: fe4985b92650e56daa4f09e1f5e96b8760697ddd [file] [log] [blame]
#!/bin/bash
readonly TEST_DATA="/usr/share/edgetpudemo"
readonly VIDEO_FILE="${TEST_DATA}/video.mp4"
readonly TPU_MODEL_FILE="${TEST_DATA}/mobilenet_ssd_v1_coco_quant_postprocess_edgetpu.tflite@Running MobileNet SSD v1 on Edge TPU"
readonly CPU_MODEL_FILE="${TEST_DATA}/mobilenet_ssd_v1_coco_quant_postprocess.tflite@Running MobileNet SSD v1 on CPU"
readonly LABELS_FILE="${TEST_DATA}/coco_labels.txt"
if [[ "$1" == "--device" ]]; then
echo "Press 'q' to quit."
echo "Press 'n' to switch between models."
edgetpu_detect \
--source "${VIDEO_FILE}" \
--model "${TPU_MODEL_FILE},${CPU_MODEL_FILE}" \
--labels "${LABELS_FILE}" \
--filter car \
--max_area 0.1 \
--color white \
--loop \
--displaymode fullscreen
elif [[ "$1" == "--stream" ]]; then
echo "Press 'q' to quit."
echo "Press 'n' to switch between models."
SERVER_INDEX_HTML="${TEST_DATA}/index.html" edgetpu_detect_server \
--source "${VIDEO_FILE}" \
--model "${TPU_MODEL_FILE},${CPU_MODEL_FILE}" \
--labels "${LABELS_FILE}" \
--filter car \
--max_area 0.1 \
--color white \
--loop
else
echo "Run on-device inference:"
echo " $0 --device"
echo "Run streaming server:"
echo " $0 --stream"
fi