Skip to content

chore: pre-release cleanup - #8

Merged
Neclow merged 5 commits into
sbhattlab:mainfrom
prince-ravi-leow:pre-release-cleanup
Sep 24, 2026
Merged

Neclow merged 5 commits into
sbhattlab:mainfrom
prince-ravi-leow:pre-release-cleanup

Conversation

@prince-ravi-leow

Copy link
Copy Markdown
Collaborator
  • Tracker: restore grounding gap fill, the frame_loader option, ID-match ratio and discontinuity flags, best-overlap matching and progress bars.
  • Tracker evaluation:
    • add A1 variant (BoT-SORT with re-ID)
    • aggregates are per-video mean ± std
    • removes stale scripts
  • Crash fixes:
    • restore code that was causing sam3.py to crash
    • needs_mask import error in extract_embeddings_vjepa2.py and check_crop_modes.py
    • compute_chunk_boundaries.py documented --video-dir but had no such option
    • build-manifest raised ValueError on its own default paths
    • clustering_grid crashed due to missing tabulate dependency
  • Config: fixed train.py checkpoints output paths
  • Tooling:
    • adds a test_imports_full pixi task, because CI skips every module that imports torch
    • adds V-JEPA --resume flag
    • remove unused imports
  • Docs: fills in missing docstrings, fixes stale paths, environment names and setup commands, and adds a Grounding section to docs/2_tracking.md.

prince-ravi-leow and others added 5 commits September 23, 2026 11:46
Snapshot of the working tree before syncing main with upstream PR sbhattlab#5.
Mixes two sets of uncommitted edits:

- Restore changes lost when forking from PlayClass 26f99ca: SAM3 tracker
  features (grounding gap fill, frame_loader, ID-match ratio and
  discontinuity, best-overlap matching, tqdm progress, no timestamped
  batch dir), 7-way tracker evaluation with per-video mean/std
  aggregation, classification checkpoint dir, compute_chunk_boundaries
  --video-path/--video-dir, V-JEPA --resume, and missing docstrings.
- Parallel docs/pixi-task cleanup: pixi task names in docs and
  docstrings, mask crop modes dropped, poster/ablation scripts removed,
  numpy 2 shims in tracker_eval.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eanup

Conflict resolution rule: where upstream already fixed the same text,
keep upstream's version and correct only facts that are still wrong.

- src/_config.py: upstream's typed K_RANGE/RANDOM_SEED; branch's module
  docstring and DEFAULT_CHECKPOINT_DIR (data/results/eval_classification).
- src/tracker_eval: delete create_ablation_table.py and
  render_poster_figures.py (stale: pooled aggregation, no A1 variant).
  evaluate.py keeps the per-video mean/std aggregation and A1; drop the
  defaultdict import upstream added for the old pooled code.
  paths.py: keep upstream's SCAN_RUNS_ROOT/RAW_VIDEO_ROOT, drop the
  branch's duplicate definitions; docstring no longer places tracker run
  parquets under tracker_benchmark/.
  manifest.py: scan layout is day_{N}/{stem}/, not timestamped runs.
  frame_selection.py: keep upstream's path, restore the three-source
  summary after the truncated "this script:".
- src/tracking/scan.py: upstream docstring with BoT-SORT (not ByteTrack);
  install hint needs `-e tracker` (ultralytics is tracker-only).
- pipeline/extract_embeddings_vjepa2.py, docs/6_embeddings.md: keep
  `bash scripts/setup_vjepa2.1.sh`, drop the model argument it ignores;
  embedding env is `default` (no `embeddings` env exists).
- README.md, docs/4_postprocessing.md, docs/5_dataset.md,
  src/dataset/README.md, pipeline/clustering_grid.py: upstream.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- pixi.toml: add test_imports_full (tracker env) so modules that CI skips
  for lack of torch get import-checked before a release; document it in
  the README Tests section.
- pixi.toml/pixi.lock: add tabulate to the default env. pandas
  DataFrame.to_markdown (clustering_grid) and TrackEval need it; it was
  missing from every env.
- src/tracking/sam3.py, pipeline/run_tracker.py: put the chunked-SAM3
  description back on sam3.py; run_tracker.py keeps its launcher summary
  plus usage.
- README.md: postprocessing runs in the default env, not tracker.
- config/sam3_best.yaml: reuse_run_dir example points at a per-video run
  dir ({video_stem}), not a timestamped batch name.
- pipeline/build_dataset.py: usage uses the build_dataset pixi task.
- Drop unused imports (eval_classification.py, extract_embeddings_videoprism.py,
  tests/test_labels.py, os in features.py); features.py imports torch
  under TYPE_CHECKING for its annotation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 13:17
@Neclow

Neclow commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

lgtm

@Neclow
Neclow merged commit e3e4b1c into sbhattlab:main Sep 24, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Resolve the critical and moderate sam3.py issues and the two documentation nits.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Pre-release cleanup restoring tracking/evaluation functionality, fixing crashes and paths, and updating tooling and documentation.

Changes:

  • Restores grounding, frame-loader, overlap matching, progress, and metadata features.
  • Adds A1 re-ID evaluation and per-video aggregation.
  • Updates dependencies, scripts, configuration, and documentation.

Review findings: src/tracking/sam3.py has one critical and one moderate issue; README.md and docs/6_embeddings.md have nit-level issues.

File Description
tests/​test_labels.py Removes unused import.
tests/​check_crop_modes.py Removes unused imports.
src/​tracking/​viz.py Adds documentation and missing-video handling.
src/​tracking/​utils.py Adds utility docstrings.
src/​tracking/​scan.py Updates BoT-SORT documentation and guidance.
src/​tracking/​sam3.py Restores tracking options, grounding, progress, and output changes.
src/​tracking/​grounding.py Adds overlap matching and match-ratio reporting.
src/​tracker_eval/​render_poster_figures.py Removes obsolete renderer.
src/​tracker_eval/​predictions.py Adds A1 prediction conversion.
src/​tracker_eval/​paths.py Updates tracker artifact paths.
src/​tracker_eval/​manifest.py Updates manifest discovery and paths.
src/​tracker_eval/​frame_selection.py Clarifies deferred imports.
src/​tracker_eval/​evaluate.py Adds A1 evaluation and per-video statistics.
src/​tracker_eval/​create_ablation_table.py Removes obsolete table script.
src/​dataset/​utils.py Adds module documentation.
src/​dataset/​README.md Corrects DINOv3 output documentation.
src/​dataset/​labels.py Adds function documentation.
src/​dataset/​features.py Makes torch annotation imports lazy.
src/​dataset/​embeddings/​__init__.py Documents compatibility exports.
src/​classification/​stats.py Adds module documentation.
src/​classification/​models.py Adds model documentation.
src/​_config.py Corrects checkpoint output paths.
README.md Documents environments and full import testing.
pixi.toml Adds dependencies and an import-test task.
pixi.lock Updates locked dependencies.
pipeline/​train_sweep_k.sh Corrects usage documentation.
pipeline/​train_ablate_best.sh Corrects usage documentation.
pipeline/​run_tracker.py Adds launcher usage documentation.
pipeline/​extract_embeddings_vjepa2.py Adds resume support.
pipeline/​extract_embeddings_videoprism.py Cleans imports and paths.
pipeline/​eval_classification.py Removes unused imports.
pipeline/​compute_chunk_boundaries.py Adds video-path options.
pipeline/​build_dataset.py Updates commands and documentation.
docs/​6_embeddings.md Updates environments and crop-mode documentation.
docs/​2_tracking.md Documents grounding and frame-loader options.
config/​sam3_best.yaml Updates the reuse-run path example.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tracking/sam3.py
Comment on lines +1359 to +1361
batch_dir = Path(
cfg.get("output_dir", None) or Path(DEFAULT_TRACKING_DIR) / config_path.stem
)
Comment thread src/tracking/sam3.py
Comment on lines +1027 to +1033
if fill_gap and grounding_frame_offset > 0 and use_tracker:
for fidx in range(
global_chunk_start, global_chunk_start + grounding_frame_offset
):
if fidx in grounding_outputs:
grounding_prefix_outputs[fidx] = _remap_output_ids(
grounding_outputs[fidx], id_map
Comment thread docs/6_embeddings.md
Comment on lines +83 to +84
Runs in its own `videoprism` pixi env (JAX + TensorFlow, solved separately
from the PyTorch envs). TF is imported only to be blocked from grabbing the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants