bevdet-p150 / code /scripts /fetch_samples.sh
changh95's picture
tt-model push bevdet-p150 (container)
77e3c67 verified
Raw History Blame Contribute Delete
2.71 kB
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# Download the public validation data that bevdet-p150 may NOT redistribute into
# ${BEVDET_SAMPLES:-$HOME/.cache/tt_bevdet/samples}, sha256-checked. Nothing downloaded here is executed.
#
# - bevdet_vendor sample0: one nuScenes key-frame (6 JPEGs + the calibration yaml) from the autoware bevdet_vendor
# repository at a pinned commit. nuScenes is CC BY-NC-SA 4.0 (non-commercial, ShareAlike): local validation only,
# never redistributed. tests/test_e2e_device.py::test_sample0_boxes reads it from $BEVDET_SAMPLE0_DIR (set below),
# together with the CPU-reference boxes of the tt-models workspace.
# - nuScenes v1.0-mini (no account needed: https://www.nuscenes.org/data/v1.0-mini.tgz, about 4 GB, CC BY-NC-SA 4.0
# + the nuScenes Terms of Use) and PandaSet (CC BY 4.0 + the PandaSet Dataset Terms; HF mirror
# georghess/pandaset) are what the public-data gates and the demo media use; their converters and goldens live in
# the tt-models workspace (research/bevdet/public_data) and are not part of this repository.
set -euo pipefail
DEST="${BEVDET_SAMPLES:-$HOME/.cache/tt_bevdet/samples}"
S0="$DEST/bevdet_vendor_sample0"
mkdir -p "$S0/imgs"
fetch() { # fetch <url> <sha256> <destination>
local url="$1" sum="$2" out="$3"
if [ -f "$out" ] && echo "$sum $out" | sha256sum -c --status; then
echo "ok $out"; return
fi
curl -fsSL --retry 3 -o "$out.part" "$url"
echo "$sum $out.part" | sha256sum -c --status || { echo "sha256 mismatch: $out" >&2; rm -f "$out.part"; exit 1; }
mv "$out.part" "$out"; echo "fetched $out"
}
RAW=https://raw.githubusercontent.com/autowarefoundation/bevdet_vendor/dd65290a01a6b330b2e596a1d2dd95a22f400ea9/sample0
fetch $RAW/sample0000.yaml ad71218797eb6b5be155ab7bea042fde64cfc36414d78a3ece7d1087679179a9 "$S0/sample0000.yaml"
fetch $RAW/imgs/CAM_FRONT_LEFT.jpg bbb1afa3ab530d6d2342536ebbe67eee6ca89b7994a88b3cdb41a7ffb3398c9e "$S0/imgs/CAM_FRONT_LEFT.jpg"
fetch $RAW/imgs/CAM_FRONT.jpg a0578668fedf4d63eae757141be756d172813daad60f0cec42e0bebfd7962dfc "$S0/imgs/CAM_FRONT.jpg"
fetch $RAW/imgs/CAM_FRONT_RIGHT.jpg 68fd5c4ec9057a2effc8dcbc9abe171d8f5909955a7be6f0b49422889c4eec34 "$S0/imgs/CAM_FRONT_RIGHT.jpg"
fetch $RAW/imgs/CAM_BACK_LEFT.jpg bee0e40929f944d23a0fdafdbb226a63c37b3dc91f01b8a397efe570f163f282 "$S0/imgs/CAM_BACK_LEFT.jpg"
fetch $RAW/imgs/CAM_BACK.jpg 81aca85e7f1f6ab3c55f7f507d481b956b2ea66d2bc1d3cc1e4337f1fb29798c "$S0/imgs/CAM_BACK.jpg"
fetch $RAW/imgs/CAM_BACK_RIGHT.jpg 6331e0d3847390b7c1acc93b058f82f21e6f8aa40af941cac019bc328c027fa8 "$S0/imgs/CAM_BACK_RIGHT.jpg"
echo "samples in $DEST; for the tests: export BEVDET_SAMPLE0_DIR=$S0"