#!/usr/bin/env bash # One-shot: pull prebuilt vidaio compression image from Hugging Face and start the lab. # # export HF_TOKEN=hf_xxx # required if the HF repo is private # bash setup.sh # # Env: # EVAL_HF_IMAGE_REPO default Realfencer/vidaio-compression-eval # EVAL_PORT default 8081 # EVAL_DIR install dir (default: ./vidaio-compression-lab) # SKIP_SUITES=1 skip downloading challenge suites # EVAL_HF_REPO suite pack repo (default Realfencer/test) set -euo pipefail REPO="${EVAL_HF_IMAGE_REPO:-Realfencer/vidaio-comp-eval-img}" SUITE_REPO="${EVAL_HF_REPO:-Realfencer/test}" PORT="${EVAL_PORT:-8081}" DIR="${EVAL_DIR:-$PWD/vidaio-compression-lab}" TAG="${EVAL_IMAGE_TAG:-latest}" ARCHIVE="vidaio-compression-eval-${TAG}.tar.gz" echo "==> Vidaio compression lab setup" echo " image repo : $REPO" echo " suite repo : $SUITE_REPO" echo " install dir: $DIR" echo " port : $PORT" if ! command -v docker >/dev/null 2>&1; then echo "ERROR: docker is required. Install Docker Engine, then re-run." >&2 exit 1 fi PY="${PYTHON:-python3}" if ! "$PY" -c "import huggingface_hub" 2>/dev/null; then echo "==> Installing huggingface_hub" "$PY" -m pip install -q "huggingface_hub>=0.23.0" fi mkdir -p "$DIR/data/suites" "$DIR/data/evals" cd "$DIR" echo "==> Downloading image bundle from Hugging Face" "$PY" - <&2 exit 1 fi echo "==> Loading docker image (this can take a few minutes)" gunzip -c "$ARCHIVE" | docker load if ! docker image inspect vidaio-compression-eval:latest >/dev/null 2>&1; then echo "ERROR: vidaio-compression-eval:latest not present after docker load" >&2 exit 1 fi if [[ "${SKIP_SUITES:-0}" != "1" ]]; then echo "==> Pulling challenge suites from $SUITE_REPO" "$PY" - < Starting compression-eval on :$PORT" EVAL_PORT="$PORT" docker compose up -d echo "" echo "Ready → http://127.0.0.1:${PORT}" echo "Pick a suite, set AV1 · CRF · VMAF≥85, Run eval." echo "Encoder + ML model are baked into the image."