Datasets:
File size: 1,625 Bytes
dc096c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #!/usr/bin/env bash
#
# Install medvision_ds so build_dataset.py can run.
#
# ./setup-env.sh /path/to/data-dir
# MedVision_DATA_DIR=/path/to/data-dir ./setup-env.sh
#
# medvision_ds is installed through medvision_bm, which is the documented public route.
# Nothing here is specific to any machine: no absolute paths, no interpreter pinning, no
# credentials. Run it from any checkout.
#
# WHICH medvision_ds YOU INSTALL DECIDES WHAT GETS STAMPED. build_dataset.py names the
# annotation version explicitly when reproducing, so the installed version does not
# affect the filename in that mode -- but it does decide the CODE that computes the
# values. To reproduce a published annotation faithfully you want the released package,
# which is what this script gives you. To build with local modifications, install the
# working tree instead:
#
# pip install -e "<repo>/src"
#
set -euo pipefail
DATA_DIR="${1:-${MedVision_DATA_DIR:-}}"
if [ -z "${DATA_DIR}" ]; then
echo "usage: $(basename "$0") <data-dir> (or export MedVision_DATA_DIR)" >&2
exit 1
fi
if python -c "import medvision_ds" 2>/dev/null; then
echo "medvision_ds already installed: $(python -c 'import medvision_ds; print(medvision_ds.__version__)')"
echo "Nothing to do. Uninstall it first if you want a different version."
exit 0
fi
pip install medvision_bm
python -m medvision_bm.benchmark.install_medvision_ds --data_dir "${DATA_DIR}"
echo
echo "medvision_ds $(python -c 'import medvision_ds; print(medvision_ds.__version__)') installed."
echo "Next: python build_dataset.py --data_dir \"${DATA_DIR}\" --dataset <NAME> --dry_run"
|