File size: 762 Bytes
f93c1b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
# PathQA one-command launcher.
#   ./pathqa-app             -> start the app and open the browser
#   ./pathqa-app demo        -> patch QA demo
#   ./pathqa-app slide-demo  -> whole-slide QA demo
#   ./pathqa-app train ...   -> train on PatchCamelyon
# On first run it creates a local venv and installs requirements.
set -e
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"

PY="${PYTHON:-python3}"
if [ ! -d ".venv" ]; then
  echo "[PathQA] first run: creating .venv and installing requirements (torch etc.)…"
  "$PY" -m venv .venv
  ./.venv/bin/pip install --upgrade pip >/dev/null
  ./.venv/bin/pip install -r requirements.txt
fi

export PYTHONPATH="$DIR:$DIR/backend:$PYTHONPATH"
exec ./.venv/bin/python "$DIR/pathqa/cli.py" "${@:-serve}"