image=localhost/at_detect_container:latest

append_args --env=XDG_RUNTIME_DIR=/run/xdg_runtime
devices="/dev/galcore /dev/mxc_hantro /dev/mxc_hantro_vc8000e /dev/ion"
volumes="/opt/firmware:/opt/firmware:ro xdg_runtime:/run/xdg_runtime"
network=my_network
ip=192.168.100.10
autostart=no


cmd="python3 /root/demo_app/detect_object.py --labels /root/demo_app/coco_labels.txt --model /root/demo_app/detect.tflite --threshold 0.45 --address 192.168.10.20 --port 1111 --interval 5 --cameraid 3"

for video in /dev/v4l/by-id/*-index0; do
  if [ -e "$video" ]; then
  	# use a symlink in case the path contains colons (:)
  	cp -sf "$video" /dev/video_at
	devices="$devices /dev/video_at:/dev/video3"
	set_command sh -c "trap exit TERM; $cmd --camera & wait"
  else
	set_command sh -c "trap exit TERM; $cmd & wait"
  fi
done
