File size: 2,364 Bytes
a8d795a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Score with the project's own OWL+SAM+DINO relevance eval.
#
# Each method writes under its own directory name, and the evaluator resolves
# runs as {profile}/{adapter}/{case}/{method}, so the method is derived from the
# profile tag rather than passed in: a mixed-method batch would otherwise need
# one invocation per method with the right name remembered by hand.
set -euo pipefail

root=/home/n2501108a/KV/experiments/rope_reindex_allmethods_20260824
repo=/home/n2501108a/KV/forcingkv_private_worktrees/Lingbot-World-2
frozen=/home/n2501108a/KV/experiments/lingbot_priority10_onlygen_allmethods_seed1_20260818
benchmark=$frozen/benchmark
metadata=$benchmark/metadata/benchmark_cases.jsonl
diff_python=/home/n2501108a/miniconda3/envs/diff/bin/python
export CONTEXT_MEMORY_MODEL_ROOT=/home/n2501108a/KV/forcingkv_private/models
export PATH="$(dirname "$diff_python"):$PATH"
gpu=${LINGBOT_EVAL_GPU:-0}

mkdir -p "$root/eval_dino" "$root/logs"

# The budget sweep writes to its own tree, so the runs directory is selectable
# rather than hardcoded; otherwise sweep profiles would be looked up under the
# main batch's runs/ and silently found missing.
runs_dir=${LINGBOT_RUNS_DIR:-runs}

if [[ $# -gt 0 ]]; then
  tags=("$@")
else
  mapfile -t tags < <(cd "$root/$runs_dir" && ls -d */ 2>/dev/null | tr -d '/')
fi
if [[ ${#tags[@]} -eq 0 ]]; then
  echo "no run directories under $root/runs" >&2
  exit 2
fi

for tag in "${tags[@]}"; do
  if [[ -f "$root/eval_dino/$tag/.complete" ]]; then
    echo "skip $tag (already scored)"
    continue
  fi
  # Profiles are named <method>_seed<N>.
  method=${tag%_seed*}
  spec=$root/eval_dino/$tag.profiles.yaml
  printf 'profiles:\n  - {profile: %s, method: %s, label: %s}\n' \
    "$tag" "$method" "$tag" >"$spec"
  echo "scoring $tag (method=$method)"
  (cd "$repo"; CUDA_VISIBLE_DEVICES="$gpu" ./cmctl evaluate --model lingbot \
    --benchmark-root "$benchmark" --metadata "$metadata" \
    --annotations "$metadata" \
    --runs-roots "$root/$runs_dir/$tag" --eval-root "$root/eval_dino/$tag" \
    --profile-spec "$spec" --methods "$method" --video-name continuation.mp4 \
    --device cuda:0 --mask-mode sam --scoring-path owl_sam_dino \
    --frame-stride 1 --no-overlays --no-comparison-videos) \
    >"$root/logs/eval_$tag.log" 2>&1 && touch "$root/eval_dino/$tag/.complete"
done
echo "done"