bpiyush commited on
Commit
3e53139
·
verified ·
1 Parent(s): a60397f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +124 -28
README.md CHANGED
@@ -16,14 +16,17 @@ tags:
16
  - text-to-video-search
17
  - multimodal-embedding
18
  ---
19
- # ![](assets/tara-logo.png) TARA: *T*ext *A*dapted *R*etrieval *A*lignment for Nuanced Video Retrieval
 
20
  <!-- # <img src="./assets/logo.png" width="24"> TARA: Time-Aware Retrieval Adaptation for Video Understanding -->
21
 
22
  This repository contains inference and evaluation code for the TARA model based on the paper:
23
- [Adapting MLLMs for Nuanced Video Retrieval](https://arxiv.org/abs/2512.13511)
24
 
25
  <p align="center">
26
- <a href="https://bpiyush.github.io/tara-website/" target="_blank">
 
 
27
  <img src="https://img.shields.io/badge/Project-Page-blue" alt="Project Page">
28
  </a>
29
  &nbsp;&nbsp;&nbsp;
@@ -35,6 +38,10 @@ This repository contains inference and evaluation code for the TARA model based
35
  <img src="https://img.shields.io/badge/arXiv-Paper-b31b1b?logo=arxiv&logoColor=white" alt="arXiv">
36
  </a>
37
  &nbsp;&nbsp;&nbsp;
 
 
 
 
38
  <a href="https://huggingface.co/datasets/bpiyush/chirality-in-action" target="_blank">
39
  <img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/dataset-on-hf-md-dark.svg" alt="Dataset on Hugging Face">
40
  </a>
@@ -56,6 +63,7 @@ This repository contains inference and evaluation code for the TARA model based
56
  - [Data Preparation](#data-preparation)
57
  - [Embedding Computation](#embedding-computation)
58
  - [General evaluation: MMEB-V2 (Meng et al.)](#general-evaluation-mmeb-v2-meng-et-al)
 
59
  - [Citation](#citation)
60
  - [License](#license)
61
 
@@ -100,25 +108,56 @@ This will download all model weights (may take a few minutes depending on your c
100
 
101
  ### 3. Install Dependencies
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
- * Create/activate the conda env (skip if you already have it):
105
- ```bash
106
- conda create -n tara python=3.10 -y
107
- conda activate tara
108
- ```
109
- * Install CUDA 12.1 PyTorch wheels (adjust the index URL if you need a different CUDA/CPU build):
110
- ```bash
111
- pip install --index-url https://download.pytorch.org/whl/cu121 \
112
- torch==2.5.1+cu121 torchvision==0.20.1+cu121 torchaudio==2.5.1+cu121
113
- ```
114
- * Install the remaining model dependencies:
115
- ```bash
116
- pip install -r requirements.txt
117
- ```
118
- * (Optional) Verify the install:
119
- ```bash
120
- python -c "import torch, transformers; print(torch.cuda.is_available(), transformers.__version__)"
121
- ```
 
 
 
122
 
123
 
124
  ## Quick Start
@@ -278,25 +317,82 @@ python evals/compute_metrics.py \
278
 
279
  We evaluate on the video classification and video retrieval tasks in MMEB-V2 to demonstrate the generalizability of TARA.
280
 
281
- TODO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
  ## Citation
284
 
285
  If you use this model, please cite:
286
  ```bibtex
287
- @article{tara2025,
288
  title={Adapting MLLMs for Nuanced Video Retrieval},
289
- author={Piyush Bagad and Andrew Zisserman},
290
- year={2025}
291
- journal={arXiv preprint arXiv:2512.13511}
292
  }
293
  ```
294
 
295
  ```bibtex
296
- @article{bagad2025chirality,
297
  title={Chirality in Action: Time-Aware Video Representation Learning by Latent Straightening},
298
  author={Bagad, Piyush and Zisserman, Andrew},
299
- journal={arXiv preprint arXiv:2509.08502},
300
  year={2025}
301
  }
302
  ```
 
16
  - text-to-video-search
17
  - multimodal-embedding
18
  ---
19
+
20
+ # ![](assets/tara-logo.png) TARA: *T*ext *A*dapted *R*etrieval *A*lignment for Nuanced Video Retrieval (ECCV 2026)
21
  <!-- # <img src="./assets/logo.png" width="24"> TARA: Time-Aware Retrieval Adaptation for Video Understanding -->
22
 
23
  This repository contains inference and evaluation code for the TARA model based on the paper:
24
+ [Adapting MLLMs for Nuanced Video Retrieval (ECCV 2026)](https://arxiv.org/abs/2512.13511)
25
 
26
  <p align="center">
27
+ <img src="https://img.shields.io/badge/ECCV-2026-blue" alt="ECCV 2026">
28
+ &nbsp;&nbsp;&nbsp;
29
+ <a href="https://www.robots.ox.ac.uk/~vgg/research/tara/" target="_blank">
30
  <img src="https://img.shields.io/badge/Project-Page-blue" alt="Project Page">
31
  </a>
32
  &nbsp;&nbsp;&nbsp;
 
38
  <img src="https://img.shields.io/badge/arXiv-Paper-b31b1b?logo=arxiv&logoColor=white" alt="arXiv">
39
  </a>
40
  &nbsp;&nbsp;&nbsp;
41
+ <a href="https://huggingface.co/bpiyush/TARA" target="_blank">
42
+ <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-yellow" alt="Hugging Face Model">
43
+ </a>
44
+ &nbsp;&nbsp;&nbsp;
45
  <a href="https://huggingface.co/datasets/bpiyush/chirality-in-action" target="_blank">
46
  <img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/dataset-on-hf-md-dark.svg" alt="Dataset on Hugging Face">
47
  </a>
 
63
  - [Data Preparation](#data-preparation)
64
  - [Embedding Computation](#embedding-computation)
65
  - [General evaluation: MMEB-V2 (Meng et al.)](#general-evaluation-mmeb-v2-meng-et-al)
66
+ - [Training](#training)
67
  - [Citation](#citation)
68
  - [License](#license)
69
 
 
108
 
109
  ### 3. Install Dependencies
110
 
111
+ > [!TIP]
112
+ > **Prefer `uv` over conda/pip?** You can set up the same environment with [uv](https://github.com/astral-sh/uv):
113
+ >
114
+ > **GPU requirement:** the prebuilt `flash-attn` wheel used below requires an **Ampere-generation GPU or newer** (compute capability ≥ 8.0) — e.g. RTX A4000/A5000/A6000, A100, RTX 30/40-series, H100. Older GPUs (Turing, Volta, T4, V100) are not supported by flash-attn 2.x. Tested and confirmed working on an **NVIDIA RTX A4000**.
115
+ > ```bash
116
+ > # 1. Install uv (if needed)
117
+ > curl -LsSf https://astral.sh/uv/install.sh | sh
118
+ >
119
+ > # 2. Sync the environment (reads pyproject.toml, installs torch/flash-attn/etc.)
120
+ > uv sync
121
+ >
122
+ > # 3. Quick check that CUDA + flash-attn are wired up correctly
123
+ > uv run python -c "
124
+ > import torch, flash_attn
125
+ > print('torch:', torch.__version__, '| CUDA available:', torch.cuda.is_available())
126
+ > print('flash-attn:', flash_attn.__version__)
127
+ > "
128
+ > ```
129
+ > Once synced, prefix any command from this README with `uv run` instead of activating a conda env, e.g.:
130
+ > ```bash
131
+ > uv run python demo_usage.py --model_path /path/to/download/tara
132
+ > ```
133
+
134
+ **Step 1 — Create and activate a conda environment:**
135
+ ```bash
136
+ conda create -n tara python=3.10 -y
137
+ conda activate tara
138
+ ```
139
 
140
+ **Step 2 Install CUDA-specific wheels** (adjust the index URL if you need a different CUDA build):
141
+ ```bash
142
+ pip install --index-url https://download.pytorch.org/whl/cu121 \
143
+ torch==2.5.1+cu121 torchvision==0.20.1+cu121 torchaudio==2.5.1+cu121
144
+ ```
145
+
146
+ **Step 3 — Install `flash-attn`** (must be built against the torch version installed above):
147
+ ```bash
148
+ pip install flash-attn==2.8.3 --no-build-isolation
149
+ ```
150
+
151
+ **Step 4 — Install TARA and all remaining dependencies:**
152
+ ```bash
153
+ pip install -e /path/to/tara
154
+ ```
155
+ where `/path/to/tara` is the root of this cloned repository. If you are already inside it, use `.` instead.
156
+
157
+ **(Optional) Verify the install:**
158
+ ```bash
159
+ python -c "import torch, transformers, modeling_tara; print(torch.cuda.is_available(), transformers.__version__)"
160
+ ```
161
 
162
 
163
  ## Quick Start
 
317
 
318
  We evaluate on the video classification and video retrieval tasks in MMEB-V2 to demonstrate the generalizability of TARA.
319
 
320
+ First, compute video embeddings for MMEB-V2:
321
+
322
+ ```bash
323
+ # Video classification tracks
324
+ python evals/compute_video_embeddings_mmeb.py \
325
+ --model_path /path/to/download/tara \
326
+ --model_name tara_7b \
327
+ --task cls
328
+
329
+ # Video retrieval tracks
330
+ python evals/compute_video_embeddings_mmeb.py \
331
+ --model_path /path/to/download/tara \
332
+ --model_name tara_7b \
333
+ --task ret
334
+ ```
335
+
336
+ Then compute text embeddings:
337
+
338
+ ```bash
339
+ # Classification text pools
340
+ python evals/compute_text_embeddings_mmeb.py \
341
+ --model_path /path/to/download/tara \
342
+ --model_name tara_7b \
343
+ --task cls
344
+
345
+ # Retrieval text pools
346
+ python evals/compute_text_embeddings_mmeb.py \
347
+ --model_path /path/to/download/tara \
348
+ --model_name tara_7b \
349
+ --task ret
350
+ ```
351
+
352
+ Finally, compute MMEB-V2 metrics:
353
+
354
+ ```bash
355
+ python evals/compute_metrics_mmebv2.py \
356
+ --model_path /path/to/download/tara \
357
+ --model_name tara_7b \
358
+ --task all
359
+ ```
360
+
361
+ By default, embeddings and metrics are saved to:
362
+
363
+ ```bash
364
+ /path/to/download/tara/embs/tara_7b_video_embeddings_mmebv2_video_cls.pt
365
+ /path/to/download/tara/embs/tara_7b_video_embeddings_mmebv2_video_ret.pt
366
+ /path/to/download/tara/embs/tara_7b_text_embeddings_mmebv2_text_cls.pt
367
+ /path/to/download/tara/embs/tara_7b_text_embeddings_mmebv2_text_ret.pt
368
+ /path/to/download/tara/embs/metrics_tara_7b_mmebv2.json
369
+ ```
370
+
371
+ If your MMEB-V2 data/config paths are different, override:
372
+ `--data_root`, `--video_cls_cfg`, `--video_ret_cfg`, `--video_ret_root`, `--save_dir`, and `--feat_dir`.
373
+
374
+
375
+ ## Training
376
+
377
+ See [TRAIN.md](TRAIN.md) for the full training pipeline (data format, fine-tuning, and weight merging).
378
 
379
  ## Citation
380
 
381
  If you use this model, please cite:
382
  ```bibtex
383
+ @article{bagad2026tara,
384
  title={Adapting MLLMs for Nuanced Video Retrieval},
385
+ author={Bagad, Piyush and Zisserman, Andrew},
386
+ journal={European Conference on Computer Vision (ECCV)},
387
+ year={2026}
388
  }
389
  ```
390
 
391
  ```bibtex
392
+ @inproceedings{bagad2025chirality,
393
  title={Chirality in Action: Time-Aware Video Representation Learning by Latent Straightening},
394
  author={Bagad, Piyush and Zisserman, Andrew},
395
+ booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
396
  year={2025}
397
  }
398
  ```