JasonCoderMaker commited on
Commit
b86499d
·
verified ·
1 Parent(s): 1147a35

Update GRDR release checkpoints

Browse files

Promote latest GRDR checkpoints to canonical best_model paths for msrvtt, actnet, didemo, and panda. X-Pool files are unchanged.

Files changed (32) hide show
  1. .gitattributes +4 -0
  2. GRDR/actnet/best_model/best_model.pt +1 -1
  3. GRDR/actnet/best_model/best_model.pt.centroids +1 -1
  4. GRDR/actnet/best_model/best_model.pt.code +2 -2
  5. GRDR/actnet/best_model/best_model.pt.embedding +1 -1
  6. GRDR/actnet/best_model/best_model.pt.model +1 -1
  7. GRDR/actnet/best_model/best_model.pt.start_token +0 -0
  8. GRDR/actnet/best_model/best_model.pt.videorqvae +1 -1
  9. GRDR/didemo/best_model/best_model.pt +2 -2
  10. GRDR/didemo/best_model/best_model.pt.centroids +2 -2
  11. GRDR/didemo/best_model/best_model.pt.code +2 -2
  12. GRDR/didemo/best_model/best_model.pt.embedding +2 -2
  13. GRDR/didemo/best_model/best_model.pt.model +1 -1
  14. GRDR/didemo/best_model/best_model.pt.start_token +0 -0
  15. GRDR/didemo/best_model/best_model.pt.videorqvae +2 -2
  16. GRDR/msrvtt/best_model/best_model.pt +1 -1
  17. GRDR/msrvtt/best_model/best_model.pt.centroids +1 -1
  18. GRDR/msrvtt/best_model/best_model.pt.code +2 -2
  19. GRDR/msrvtt/best_model/best_model.pt.embedding +1 -1
  20. GRDR/msrvtt/best_model/best_model.pt.model +1 -1
  21. GRDR/msrvtt/best_model/best_model.pt.start_token +0 -0
  22. GRDR/msrvtt/best_model/best_model.pt.videorqvae +1 -1
  23. GRDR/panda/best_model/best_model.pt +3 -0
  24. GRDR/panda/best_model/best_model.pt.centroids +3 -0
  25. GRDR/panda/best_model/best_model.pt.code +3 -0
  26. GRDR/panda/best_model/best_model.pt.embedding +3 -0
  27. GRDR/panda/best_model/best_model.pt.model +3 -0
  28. GRDR/panda/best_model/best_model.pt.start_token +0 -0
  29. GRDR/panda/best_model/best_model.pt.videorqvae +3 -0
  30. README.md +51 -91
  31. download_checkpoints.sh +63 -277
  32. download_features.py +72 -231
.gitattributes CHANGED
@@ -72,3 +72,7 @@ GRDR/msrvtt/best_model/best_model.pt.centroids filter=lfs diff=lfs merge=lfs -te
72
  GRDR/msrvtt/best_model/best_model.pt.code filter=lfs diff=lfs merge=lfs -text
73
  GRDR/msrvtt/best_model/best_model.pt.embedding filter=lfs diff=lfs merge=lfs -text
74
  GRDR/msrvtt/best_model/best_model.pt.videorqvae filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
72
  GRDR/msrvtt/best_model/best_model.pt.code filter=lfs diff=lfs merge=lfs -text
73
  GRDR/msrvtt/best_model/best_model.pt.embedding filter=lfs diff=lfs merge=lfs -text
74
  GRDR/msrvtt/best_model/best_model.pt.videorqvae filter=lfs diff=lfs merge=lfs -text
75
+ GRDR/panda/best_model/best_model.pt.centroids filter=lfs diff=lfs merge=lfs -text
76
+ GRDR/panda/best_model/best_model.pt.code filter=lfs diff=lfs merge=lfs -text
77
+ GRDR/panda/best_model/best_model.pt.embedding filter=lfs diff=lfs merge=lfs -text
78
+ GRDR/panda/best_model/best_model.pt.videorqvae filter=lfs diff=lfs merge=lfs -text
GRDR/actnet/best_model/best_model.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7815a29ff7b3df0d7870a8feb122cfd85048b7c29ac8869546ad0ba73ad8fee7
3
  size 251294550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8064211d28b19185e8d450d9be96a6481b12b63fda2f0e9e77488bd364e55ee1
3
  size 251294550
GRDR/actnet/best_model/best_model.pt.centroids CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:78b758b80f6a30ff7617b979ed0f9c92e76d3f12d7a63803ed54d6e2eea6adae
3
  size 788414
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8101db493591eedaf055d5de12c1ab83cdc02182947a8f13ba64e341d0bafae9
3
  size 788414
GRDR/actnet/best_model/best_model.pt.code CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0ea3538673735ca5a19e1c129870422bfa1d723eaeb800af9509855f8b684a85
3
- size 17176455
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3914bb3978abb2d3f976525e0385258413f38d94eac832979453b89b38aecefc
3
+ size 1246276
GRDR/actnet/best_model/best_model.pt.embedding CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a60c6cff9f8fbc80b7e95b3ca67a7e3da31ca6c33e73d18079c51d3f03e5a027
3
  size 788350
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f99ddd8f6aef3a0f811e1ffb3926434e2b1d7820e52ffe65495fac1fd6d31053
3
  size 788350
GRDR/actnet/best_model/best_model.pt.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6593aa8698e0db893674de1dbde2fd1bfeaaf5443ef2f411bc61ef3e06c35b99
3
  size 242088214
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6adf736fc854b242ec06f880f12ca5b8c04b352cbf9ff1241b56f663e0b050a
3
  size 242088214
GRDR/actnet/best_model/best_model.pt.start_token CHANGED
Binary files a/GRDR/actnet/best_model/best_model.pt.start_token and b/GRDR/actnet/best_model/best_model.pt.start_token differ
 
GRDR/actnet/best_model/best_model.pt.videorqvae CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8f97ff998e37ca6ff2da614d55ab53abf8f10308c54119a22312c915c5e0a0a2
3
  size 9199783
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d9f9c942125c311221bf38913dc5a00772030b694caa035f415ad1c69c219e5
3
  size 9199783
GRDR/didemo/best_model/best_model.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:100632f58f2c1acead2e3a7119331182455a0f8772754dba6d3a76221c4a4021
3
- size 251097942
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42d86895b39df148712a444d8e2a2708dc6868e2b7d90f6a10afd076b042da84
3
+ size 251294550
GRDR/didemo/best_model/best_model.pt.centroids CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:125a4f8d55509ef1b791baca9ad1d1e620ceb3150d3c307ae3eab7056770aa29
3
- size 591806
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:642ff4b200e2121dc9a01f7a5db487ecbff3952f7cf38ea7e1c49cf5626e4e81
3
+ size 788414
GRDR/didemo/best_model/best_model.pt.code CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a6c6635286836b92c5f53953aab55edd0021137b1d7a7c802f528cf29ef5931f
3
- size 24152749
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b39c57e869570ca2326c004e6b42ab3618162a327851aebfac71c71611e7742
3
+ size 1796059
GRDR/didemo/best_model/best_model.pt.embedding CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4024ac8dcfcdf07c396436b4df958a41f4a511617b26fabf99c14a36e0d03045
3
- size 591742
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b53f6ce630a1c459a27cbf5d991ead937613215e9c6d24d790477944cd995c3
3
+ size 788350
GRDR/didemo/best_model/best_model.pt.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:90cccddc1d2f9c00811aa34065dec01697ba472899c36a70d3c8876a1adf0507
3
  size 242088214
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6007cf448db2cf38e83a9d1d3eaa73e75df8986f2a005fa564116af0019b0ee4
3
  size 242088214
GRDR/didemo/best_model/best_model.pt.start_token CHANGED
Binary files a/GRDR/didemo/best_model/best_model.pt.start_token and b/GRDR/didemo/best_model/best_model.pt.start_token differ
 
GRDR/didemo/best_model/best_model.pt.videorqvae CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e964bda1571410d2507d8a6ed2f5d6a2497f65bc3265b7024d2e7c928c95d6ea
3
- size 9003175
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f351f8f446a407af2304c8b08867154bc3767cf325b2eeb7e6a7b63b27717e6
3
+ size 9199783
GRDR/msrvtt/best_model/best_model.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:08fbb9ba65bc656a29d62b675d775ca8e605a27831fc7ebda01036afc1f34d6c
3
  size 251294550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be42f8c65dc3e868a03a22b995b872ec613ab0865f4ae1baaf3374f6ec1da8bf
3
  size 251294550
GRDR/msrvtt/best_model/best_model.pt.centroids CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9fc1275c2ba171ce1de60358d69599d3a18a499a0a0f941531da2cffc624c8c0
3
  size 788414
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d915f1fc308fc024fa6983e49e8a8e2d0258ef0b3a91aa9fd82187b64590b369
3
  size 788414
GRDR/msrvtt/best_model/best_model.pt.code CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b60a20d59b876bd7cc154de55df95921982e8700c35550e9213a6cd3db375823
3
- size 13502130
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f11eec3011bfecd740e05359fc7bee6b3e50ced345ea9b48b802e52568cdd99
3
+ size 5368953
GRDR/msrvtt/best_model/best_model.pt.embedding CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9efbfdcafb4e9594022a957a38c12c32e25384f110c254eada0424b11b3a29e0
3
  size 788350
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7cfdfa6029e6e3eabd38c5f1ff807f1cbcca0560cc0206bc2281971faae86b6
3
  size 788350
GRDR/msrvtt/best_model/best_model.pt.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:eff11e9246cc33dbcc14627c2ade633ffce88b922938951b83425228bd2f39ac
3
  size 242088214
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46cf8b702ebf808249a2f9ec6b40e6aa684e8d622f394e64a7faeaa8fa4e8a51
3
  size 242088214
GRDR/msrvtt/best_model/best_model.pt.start_token CHANGED
Binary files a/GRDR/msrvtt/best_model/best_model.pt.start_token and b/GRDR/msrvtt/best_model/best_model.pt.start_token differ
 
GRDR/msrvtt/best_model/best_model.pt.videorqvae CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d95d54b2ae5789cb715c787a9548f4f6d9492065f64d7eb5c464c97ed3a99f15
3
  size 9199783
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95eb0ad22e74ef00e21e23c1734f4e11ea66015a7f911539544bccbab88f3311
3
  size 9199783
GRDR/panda/best_model/best_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60312639d96c325bf9b01d03bd2db3a0767d05bcd239b291db25849ceaf6f828
3
+ size 275674345
GRDR/panda/best_model/best_model.pt.centroids ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c3aba66ca0bc253132083caff489b1e106e8a1ac37c430c197e712cd30242f3
3
+ size 25168279
GRDR/panda/best_model/best_model.pt.code ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3cac0c18d7703512e42afd6214ca8698f6c6f34f2f9a7853e288bae94d4cda6
3
+ size 561266683
GRDR/panda/best_model/best_model.pt.embedding ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8c5d535f5ad4889668cdc834d51be15d16488eae209e325c34d0d91e9918a45
3
+ size 25168151
GRDR/panda/best_model/best_model.pt.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22578e363d467f5be3b001beda172319d7cf99d16cf6b9dc64a8a1808d6ad072
3
+ size 242088623
GRDR/panda/best_model/best_model.pt.start_token ADDED
Binary file (3.73 kB). View file
 
GRDR/panda/best_model/best_model.pt.videorqvae ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8622641b64db5ed8abfa21385bd86d7f8e96469479617bf6a878d5641316d69c
3
+ size 33579584
README.md CHANGED
@@ -14,118 +14,78 @@ size_categories:
14
  - 10K<n<100K
15
  ---
16
 
17
- # GRDR-TVR: Generative Recall, Dense Reranking for Text-to-Video Retrieval
18
 
19
- This dataset contains the pre-extracted video features and trained model checkpoints for the GRDR (Generative Recall, Dense Reranking) framework for efficient Text-to-Video Retrieval (TVR).
20
 
21
- ## 📄 Paper
22
 
23
- **Generative Recall, Dense Reranking: Learning Multi-View Semantic IDs for Efficient Text-to-Video Retrieval**
24
 
 
25
 
26
- [Paper PDF](https://arxiv.org/abs/XXXX.XXXXX) | [Code Repository](https://github.com/JasonCoderMaker/GRDR)
 
 
 
27
 
28
- ## 📊 Dataset Overview
29
 
30
- This dataset includes three main components:
31
 
32
- ### 1. InternVideo2 Features (~3.4GB)
33
- Pre-extracted video features using InternVideo2 encoder for four benchmark datasets:
34
- - **MSR-VTT**: 10,000 videos (932MB)
35
- - **ActivityNet**: 20,000 videos (1.1GB)
36
- - **DiDeMo**: 10,464 videos (916MB)
37
- - **LSMDC**: 1,000 movies, 118,081 clips (424MB)
38
 
39
- **Feature Details:**
40
- - Dimension: 512-d embeddings
41
- - Format: Pickle files (`.pkl`) with `{video_id: embedding}` mappings
42
- - Extraction: InternVideo2 (InternVL-2B) with temporal pooling
 
 
 
 
 
43
 
44
- ### 2. GRDR Model Checkpoints (~2GB)
45
- Trained GRDR models (T5-small based) for all four datasets:
46
- - **MSR-VTT**: 494MB
47
- - **ActivityNet**: 498MB
48
- - **DiDeMo**: 504MB
49
- - **LSMDC**: 478MB
50
 
51
- **Checkpoint Components:**
52
- - `best_model.pt` - Complete model checkpoint
53
- - `best_model.pt.model` - T5 encoder-decoder weights
54
- - `best_model.pt.videorqvae` - Video RQ-VAE quantizer
55
- - `best_model.pt.code` - Pre-computed semantic IDs
56
- - `best_model.pt.centroids` - Codebook centroids
57
- - `best_model.pt.embedding` - Learned embeddings
58
- - `best_model.pt.start_token` - Start token embeddings
59
 
60
- **Model Architecture:**
61
- - Base: T5-small (60M parameters)
62
- - Codebook size: 128/96/200 (dataset-dependent)
63
- - Max code length: 3
64
- - Training: 3-phase progressive training
65
 
66
- ### 3. Xpool Reranker Checkpoints (~7.2GB)
67
- Pre-trained reranker models for dense reranking stage:
68
- - **MSR-VTT**: msrvtt9k_model_best.pth (1.8GB)
69
- - **ActivityNet**: actnet_model_best.pth (1.8GB)
70
- - **DiDeMo**: didemo_model_best.pth (1.8GB)
71
- - **LSMDC**: lsmdc_model_best.pth (1.8GB)
72
 
73
- ### 4. Xpool Video Features (~3.2GB)
74
- Pre-extracted CLIP video features for Xpool reranker:
75
- - **MSR-VTT**: 235MB
76
- - **ActivityNet**: 351MB
77
- - **DiDeMo**: 221MB
78
- - **LSMDC**: 2.4GB
79
 
80
- **Reranker Details:**
81
- - Architecture: CLIP-based (ViT-B/32)
82
- - Purpose: Fine-grained reranking of recalled candidates
83
- - Format: PyTorch checkpoint files (`.pth`)
 
 
84
 
85
- ## 📂 Repository Structure
86
 
87
- ```
88
- GRDR-TVR/
89
- ├── README.md # This file
90
- ├── download_features.py # Python download utility
91
- ├── download_checkpoints.sh # Bash download script
92
-
93
- ├── InternVideo2/ # Video Features (3.4GB)
94
- │ ├── actnet/
95
- │ │ └── actnet_internvideo2.pkl
96
- │ ├── didemo/
97
- │ │ └── didemo_internvideo2.pkl
98
- │ ├── lsmdc/
99
- │ │ └── lsmdc_internvideo2.pkl
100
- │ └── msrvtt/
101
- │ └── msrvtt_internvideo2.pkl
102
-
103
- ├── GRDR/ # GRDR Checkpoints (2GB)
104
- │ ├── actnet/best_model/
105
- │ ├── didemo/best_model/
106
- │ ├── lsmdc/best_model/
107
- │ └── msrvtt/best_model/
108
-
109
- └── Xpool/ # Reranker Checkpoints (7.2GB)
110
- ├── actnet_model_best.pth
111
- ├── didemo_model_best.pth
112
- ├── lsmdc_model_best.pth
113
- └── msrvtt9k_model_best.pth
114
- ```
115
 
116
- ## 📝 License
117
 
118
- This dataset is released under the MIT License. See [LICENSE](LICENSE) for details.
 
 
 
 
119
 
120
- The video datasets (MSR-VTT, ActivityNet, DiDeMo, LSMDC) are subject to their original licenses. This repository only provides pre-extracted features, not the original videos.
121
 
122
- ## 🙏 Acknowledgments
 
 
 
123
 
124
- - **InternVideo2**: We thank the authors of InternVideo2 for their excellent video encoder
125
- - **Xpool**: The reranker architecture is based on X-POOL
126
- - **Datasets**: MSR-VTT, ActivityNet Captions, DiDeMo, and LSMDC benchmark creators
127
 
 
128
 
129
- **Dataset Version**: 1.0
130
- **Last Updated**: January 2026
131
- **Maintained by**: [@JasonCoderMaker](https://huggingface.co/JasonCoderMaker)
 
14
  - 10K<n<100K
15
  ---
16
 
17
+ # GRDR-TVR release assets
18
 
19
+ This dataset repository hosts release assets for GRDR: a learned semantic-key index for large-scale text-to-video retrieval. The main code repository is [JasonCoderMaker/GRDR](https://github.com/JasonCoderMaker/GRDR).
20
 
21
+ ## Hosted files
22
 
23
+ ### InternVideo2 features
24
 
25
+ Pre-extracted InternVideo2 features are available for:
26
 
27
+ - `msrvtt`
28
+ - `actnet`
29
+ - `didemo`
30
+ - `lsmdc` legacy assets
31
 
32
+ Panda GRDR checkpoints are hosted here, but Panda feature and annotation preparation follows the code repository instructions.
33
 
34
+ ### GRDR checkpoints
35
 
36
+ The release-facing checkpoint path is canonical for each dataset:
 
 
 
 
 
37
 
38
+ ```text
39
+ GRDR/<dataset>/best_model/best_model.pt
40
+ GRDR/<dataset>/best_model/best_model.pt.code
41
+ GRDR/<dataset>/best_model/best_model.pt.centroids
42
+ GRDR/<dataset>/best_model/best_model.pt.embedding
43
+ GRDR/<dataset>/best_model/best_model.pt.model
44
+ GRDR/<dataset>/best_model/best_model.pt.start_token
45
+ GRDR/<dataset>/best_model/best_model.pt.videorqvae
46
+ ```
47
 
48
+ Current release datasets:
 
 
 
 
 
49
 
50
+ - `msrvtt`
51
+ - `actnet`
52
+ - `didemo`
53
+ - `panda`
 
 
 
 
54
 
55
+ Legacy `lsmdc` checkpoint files remain available under `GRDR/lsmdc/best_model/`, but they are not part of the current GRDR release manifest.
 
 
 
 
56
 
57
+ ### X-Pool checkpoints
 
 
 
 
 
58
 
59
+ X-Pool checkpoint filenames are kept in their original flat layout:
 
 
 
 
 
60
 
61
+ ```text
62
+ Xpool/msrvtt9k_model_best.pth
63
+ Xpool/actnet_model_best.pth
64
+ Xpool/didemo_model_best.pth
65
+ Xpool/lsmdc_model_best.pth
66
+ ```
67
 
68
+ No X-Pool checkpoint file was renamed for this release update.
69
 
70
+ ## Download examples
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
+ Use the `download_features.py` script from the GRDR code repository for the current release workflow:
73
 
74
+ ```bash
75
+ python download_features.py --grdr --datasets msrvtt panda
76
+ python download_features.py --features --datasets msrvtt actnet didemo
77
+ python download_features.py --xpool --datasets msrvtt actnet didemo
78
+ ```
79
 
80
+ You can also download directly from the Hub:
81
 
82
+ ```bash
83
+ hf download JasonCoderMaker/GRDR-TVR --type dataset --include 'GRDR/msrvtt/best_model/*' --local-dir ./output/checkpoints
84
+ hf download JasonCoderMaker/GRDR-TVR --type dataset --include 'Xpool/msrvtt9k_model_best.pth' --local-dir ./reranker/xpool/ckpt
85
+ ```
86
 
87
+ The GRDR repository expects checkpoints under `output/checkpoints/GRDR/<dataset>/best_model/`.
 
 
88
 
89
+ ## License
90
 
91
+ The release assets are distributed under the MIT License where applicable. Source video datasets keep their original licenses. This repository provides features and model checkpoints, not the original videos.
 
 
download_checkpoints.sh CHANGED
@@ -1,284 +1,70 @@
1
- #!/bin/bash
2
- ###############################################################################
3
- # Download GRDR-TVR Dataset from Hugging Face Hub
4
- #
5
- # This script provides a simple way to download the GRDR-TVR dataset
6
- # components using the Hugging Face CLI.
7
- #
8
- # Usage:
9
- # ./download_checkpoints.sh [OPTIONS]
10
- #
11
- # Examples:
12
- # # Download everything
13
- # ./download_checkpoints.sh --all
14
- #
15
- # # Download only GRDR checkpoints
16
- # ./download_checkpoints.sh --grdr
17
- #
18
- # # Download features for specific dataset
19
- # ./download_checkpoints.sh --features msrvtt
20
- ###############################################################################
21
 
22
  REPO_ID="JasonCoderMaker/GRDR-TVR"
23
- OUTPUT_DIR="./GRDR-TVR"
24
-
25
- # Colors for output
26
- RED='\033[0;31m'
27
- GREEN='\033[0;32m'
28
- YELLOW='\033[1;33m'
29
- BLUE='\033[0;34m'
30
- NC='\033[0m' # No Color
31
-
32
- # Print colored message
33
- print_msg() {
34
- local color=$1
35
- shift
36
- echo -e "${color}$@${NC}"
37
- }
38
-
39
- # Check if huggingface-cli is installed
40
- check_hf_cli() {
41
- if ! command -v huggingface-cli &> /dev/null; then
42
- print_msg $RED "Error: huggingface-cli not found!"
43
- print_msg $YELLOW "Please install: pip install huggingface_hub"
44
- exit 1
45
- fi
46
- }
47
-
48
- # Download all components
49
- download_all() {
50
- print_msg $BLUE "=================================================="
51
- print_msg $BLUE "Downloading complete GRDR-TVR dataset..."
52
- print_msg $BLUE "=================================================="
53
-
54
- huggingface-cli download $REPO_ID \
55
- --repo-type dataset \
56
- --local-dir $OUTPUT_DIR \
57
- --local-dir-use-symlinks False
58
-
59
- print_msg $GREEN "✓ Complete dataset downloaded to $OUTPUT_DIR"
60
- }
61
-
62
- # Download InternVideo2 features
63
- download_features() {
64
- local dataset=$1
65
- print_msg $BLUE "=================================================="
66
- print_msg $BLUE "Downloading InternVideo2 features..."
67
- print_msg $BLUE "=================================================="
68
-
69
- if [ -z "$dataset" ]; then
70
- # Download all features
71
- huggingface-cli download $REPO_ID \
72
- --repo-type dataset \
73
- --include "InternVideo2/*" \
74
- --local-dir $OUTPUT_DIR \
75
- --local-dir-use-symlinks False
76
- else
77
- # Download specific dataset features
78
- huggingface-cli download $REPO_ID \
79
- --repo-type dataset \
80
- --include "InternVideo2/${dataset}/*" \
81
- --local-dir $OUTPUT_DIR \
82
- --local-dir-use-symlinks False
83
- fi
84
-
85
- print_msg $GREEN "✓ Features downloaded to $OUTPUT_DIR/InternVideo2"
86
- }
87
-
88
- # Download GRDR checkpoints
89
- download_grdr() {
90
- local dataset=$1
91
- print_msg $BLUE "=================================================="
92
- print_msg $BLUE "Downloading GRDR checkpoints..."
93
- print_msg $BLUE "=================================================="
94
-
95
- if [ -z "$dataset" ]; then
96
- # Download all GRDR checkpoints
97
- huggingface-cli download $REPO_ID \
98
- --repo-type dataset \
99
- --include "GRDR/*" \
100
- --local-dir $OUTPUT_DIR \
101
- --local-dir-use-symlinks False
102
- else
103
- # Download specific dataset checkpoint
104
- huggingface-cli download $REPO_ID \
105
- --repo-type dataset \
106
- --include "GRDR/${dataset}/*" \
107
- --local-dir $OUTPUT_DIR \
108
- --local-dir-use-symlinks False
109
- fi
110
-
111
- print_msg $GREEN "✓ GRDR checkpoints downloaded to $OUTPUT_DIR/GRDR"
112
- }
113
-
114
- # Download Xpool checkpoints
115
- download_xpool() {
116
- local dataset=$1
117
- print_msg $BLUE "=================================================="
118
- print_msg $BLUE "Downloading Xpool reranker checkpoints..."
119
- print_msg $BLUE "=================================================="
120
-
121
- if [ -z "$dataset" ]; then
122
- # Download all Xpool checkpoints
123
- huggingface-cli download $REPO_ID \
124
- --repo-type dataset \
125
- --include "Xpool/*" \
126
- --local-dir $OUTPUT_DIR \
127
- --local-dir-use-symlinks False
128
- else
129
- # Download specific dataset checkpoint
130
- local filename=""
131
- case $dataset in
132
- msrvtt)
133
- filename="msrvtt9k_model_best.pth"
134
- ;;
135
- actnet)
136
- filename="actnet_model_best.pth"
137
- ;;
138
- didemo)
139
- filename="didemo_model_best.pth"
140
- ;;
141
- lsmdc)
142
- filename="lsmdc_model_best.pth"
143
- ;;
144
- *)
145
- print_msg $RED "Error: Unknown dataset '$dataset'"
146
- exit 1
147
- ;;
148
- esac
149
-
150
- huggingface-cli download $REPO_ID \
151
- --repo-type dataset \
152
- --include "Xpool/${filename}" \
153
- --local-dir $OUTPUT_DIR \
154
- --local-dir-use-symlinks False
155
- fi
156
-
157
- print_msg $GREEN "✓ Xpool checkpoints downloaded to $OUTPUT_DIR/Xpool"
158
- }
159
-
160
- # Show usage
161
- show_usage() {
162
- cat << EOF
163
- Usage: $0 [OPTIONS] [DATASET]
164
-
165
- Download GRDR-TVR dataset components from Hugging Face Hub.
166
-
167
- OPTIONS:
168
- --all Download all components (default if no option specified)
169
- --features Download InternVideo2 features only
170
- --grdr Download GRDR checkpoints only
171
- --xpool Download Xpool reranker checkpoints only
172
- -o, --output Specify output directory (default: ./GRDR-TVR)
173
- -h, --help Show this help message
174
-
175
- DATASET (optional):
176
- msrvtt MSR-VTT dataset
177
- actnet ActivityNet dataset
178
- didemo DiDeMo dataset
179
- lsmdc LSMDC dataset
180
-
181
- If not specified, downloads all datasets.
182
-
183
- EXAMPLES:
184
- # Download everything
185
- $0 --all
186
-
187
- # Download only GRDR checkpoints
188
- $0 --grdr
189
-
190
- # Download InternVideo2 features for MSR-VTT
191
- $0 --features msrvtt
192
-
193
- # Download Xpool reranker for ActivityNet
194
- $0 --xpool actnet
195
-
196
- # Download to custom directory
197
- $0 --all -o ./my_data
198
-
199
  EOF
200
  }
201
 
202
- # Main script
203
- main() {
204
- check_hf_cli
205
-
206
- # Parse arguments
207
- local mode="all"
208
- local dataset=""
209
-
210
- while [[ $# -gt 0 ]]; do
211
- case $1 in
212
- --all)
213
- mode="all"
214
- shift
215
- ;;
216
- --features)
217
- mode="features"
218
- shift
219
- ;;
220
- --grdr)
221
- mode="grdr"
222
- shift
223
- ;;
224
- --xpool)
225
- mode="xpool"
226
- shift
227
- ;;
228
- -o|--output)
229
- OUTPUT_DIR="$2"
230
- shift 2
231
- ;;
232
- -h|--help)
233
- show_usage
234
- exit 0
235
- ;;
236
- msrvtt|actnet|didemo|lsmdc)
237
- dataset="$1"
238
- shift
239
- ;;
240
- *)
241
- print_msg $RED "Error: Unknown option '$1'"
242
- show_usage
243
- exit 1
244
- ;;
245
- esac
246
- done
247
-
248
- print_msg $BLUE "=================================================="
249
- print_msg $BLUE "GRDR-TVR Dataset Downloader"
250
- print_msg $BLUE "=================================================="
251
- print_msg $YELLOW "Repository: $REPO_ID"
252
- print_msg $YELLOW "Output: $OUTPUT_DIR"
253
- if [ -n "$dataset" ]; then
254
- print_msg $YELLOW "Dataset: $dataset"
255
- fi
256
- print_msg $BLUE "==================================================\n"
257
-
258
- # Execute download based on mode
259
- case $mode in
260
- all)
261
- download_all
262
- ;;
263
- features)
264
- download_features "$dataset"
265
- ;;
266
- grdr)
267
- download_grdr "$dataset"
268
- ;;
269
- xpool)
270
- download_xpool "$dataset"
271
- ;;
272
- esac
273
-
274
- print_msg $GREEN "\n=================================================="
275
- print_msg $GREEN "✓ Download Complete!"
276
- print_msg $GREEN "=================================================="
277
- print_msg $YELLOW "\nNext steps:"
278
- print_msg $YELLOW "1. Verify downloads in $OUTPUT_DIR"
279
- print_msg $YELLOW "2. See README.md for usage instructions"
280
- print_msg $YELLOW "3. Visit https://huggingface.co/datasets/$REPO_ID\n"
281
  }
282
 
283
- # Run main function
284
- main "$@"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  REPO_ID="JasonCoderMaker/GRDR-TVR"
5
+ OUTPUT_DIR="${OUTPUT_DIR:-./GRDR-TVR}"
6
+ DATASET="${2:-}"
7
+
8
+ usage() {
9
+ cat <<'EOF'
10
+ Usage: ./download_checkpoints.sh [--all|--features|--grdr|--xpool] [dataset]
11
+
12
+ Datasets: msrvtt, actnet, didemo, panda, lsmdc
13
+ Examples:
14
+ ./download_checkpoints.sh --grdr msrvtt
15
+ ./download_checkpoints.sh --grdr panda
16
+ ./download_checkpoints.sh --xpool msrvtt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  EOF
18
  }
19
 
20
+ hf_download() {
21
+ hf download "$REPO_ID" --type dataset --include "$1" --local-dir "$OUTPUT_DIR"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
+ cmd="${1:---all}"
25
+ case "$cmd" in
26
+ --all)
27
+ if [[ -n "$DATASET" ]]; then
28
+ hf_download "GRDR/${DATASET}/best_model/*"
29
+ hf_download "InternVideo2/${DATASET}/**" || true
30
+ case "$DATASET" in
31
+ msrvtt) hf_download "Xpool/msrvtt9k_model_best.pth" ;;
32
+ actnet) hf_download "Xpool/actnet_model_best.pth" ;;
33
+ didemo) hf_download "Xpool/didemo_model_best.pth" ;;
34
+ lsmdc) hf_download "Xpool/lsmdc_model_best.pth" ;;
35
+ panda) echo "No Panda X-Pool checkpoint is hosted in this repo" ;;
36
+ esac
37
+ else
38
+ hf_download "GRDR/*/best_model/*"
39
+ hf_download "InternVideo2/**"
40
+ hf_download "Xpool/*"
41
+ fi
42
+ ;;
43
+ --features)
44
+ [[ -n "$DATASET" ]] && hf_download "InternVideo2/${DATASET}/**" || hf_download "InternVideo2/**"
45
+ ;;
46
+ --grdr)
47
+ [[ -n "$DATASET" ]] && hf_download "GRDR/${DATASET}/best_model/*" || hf_download "GRDR/*/best_model/*"
48
+ ;;
49
+ --xpool)
50
+ if [[ -z "$DATASET" ]]; then
51
+ hf_download "Xpool/*"
52
+ else
53
+ case "$DATASET" in
54
+ msrvtt) hf_download "Xpool/msrvtt9k_model_best.pth" ;;
55
+ actnet) hf_download "Xpool/actnet_model_best.pth" ;;
56
+ didemo) hf_download "Xpool/didemo_model_best.pth" ;;
57
+ lsmdc) hf_download "Xpool/lsmdc_model_best.pth" ;;
58
+ panda) echo "No Panda X-Pool checkpoint is hosted in this repo" ;;
59
+ *) echo "Unknown dataset: $DATASET" >&2; exit 1 ;;
60
+ esac
61
+ fi
62
+ ;;
63
+ -h|--help)
64
+ usage
65
+ ;;
66
+ *)
67
+ usage >&2
68
+ exit 1
69
+ ;;
70
+ esac
download_features.py CHANGED
@@ -1,258 +1,99 @@
1
  #!/usr/bin/env python3
2
- """
3
- Download GRDR-TVR dataset components from Hugging Face Hub.
4
-
5
- This script provides a convenient way to download specific components
6
- of the GRDR-TVR dataset including InternVideo2 features, GRDR checkpoints,
7
- and Xpool reranker models.
8
-
9
- Examples:
10
- # Download everything
11
- python download_features.py --all
12
-
13
- # Download only features for MSR-VTT and ActivityNet
14
- python download_features.py --features --datasets msrvtt actnet
15
-
16
- # Download GRDR checkpoints for all datasets
17
- python download_features.py --grdr
18
-
19
- # Download Xpool reranker for specific dataset
20
- python download_features.py --xpool --datasets msrvtt
21
- """
22
 
23
  import argparse
24
- import os
 
25
  from pathlib import Path
26
- from huggingface_hub import snapshot_download, hf_hub_download
27
- from tqdm import tqdm
28
-
29
 
30
  REPO_ID = "JasonCoderMaker/GRDR-TVR"
31
- DATASETS = ["msrvtt", "actnet", "didemo", "lsmdc"]
32
-
33
-
34
- def download_internvideo2_features(datasets, output_dir="./dataset/features"):
35
- """Download InternVideo2 pre-extracted features."""
36
- print(f"\n{'='*70}")
37
- print("📥 Downloading InternVideo2 Features")
38
- print(f"{'='*70}\n")
39
-
40
- features_dir = Path(output_dir) / "InternVideo2"
41
- features_dir.mkdir(parents=True, exist_ok=True)
42
-
43
- for dataset in datasets:
44
- print(f"\n📦 Downloading {dataset} features...")
45
- try:
46
- snapshot_download(
47
- repo_id=REPO_ID,
48
- repo_type="dataset",
49
- allow_patterns=f"InternVideo2/{dataset}/*",
50
- local_dir=output_dir,
51
- local_dir_use_symlinks=False,
52
- )
53
- print(f"{dataset} features downloaded to {features_dir / dataset}")
54
- except Exception as e:
55
- print(f"✗ Error downloading {dataset} features: {e}")
56
-
57
-
58
- def download_grdr_checkpoints(datasets, output_dir="./output"):
59
- """Download GRDR model checkpoints."""
60
- print(f"\n{'='*70}")
61
- print("📥 Downloading GRDR Checkpoints")
62
- print(f"{'='*70}\n")
63
-
64
- grdr_dir = Path(output_dir) / "GRDR"
65
- grdr_dir.mkdir(parents=True, exist_ok=True)
66
-
67
- for dataset in datasets:
68
- print(f"\n📦 Downloading {dataset} GRDR checkpoint...")
69
- try:
70
- snapshot_download(
71
- repo_id=REPO_ID,
72
- repo_type="dataset",
73
- allow_patterns=f"GRDR/{dataset}/**",
74
- local_dir=output_dir,
75
- local_dir_use_symlinks=False,
76
- )
77
- print(f"✓ {dataset} GRDR checkpoint downloaded to {grdr_dir / dataset}")
78
- except Exception as e:
79
- print(f"✗ Error downloading {dataset} GRDR checkpoint: {e}")
80
-
81
 
82
- def download_xpool_checkpoints(datasets, output_dir="./reranker/xpool/ckpt"):
83
- """Download Xpool reranker checkpoints."""
84
- print(f"\n{'='*70}")
85
- print("📥 Downloading Xpool Reranker Checkpoints")
86
- print(f"{'='*70}\n")
87
-
88
  xpool_dir = Path(output_dir)
89
  xpool_dir.mkdir(parents=True, exist_ok=True)
90
-
91
- xpool_files = {
92
- "actnet": "actnet_model_best.pth",
93
- "didemo": "didemo_model_best.pth",
94
- "lsmdc": "lsmdc_model_best.pth",
95
- "msrvtt": "msrvtt9k_model_best.pth",
96
- }
97
-
98
  for dataset in datasets:
99
- if dataset not in xpool_files:
100
- print(f"⊘ Skipping {dataset} (no Xpool checkpoint)")
 
101
  continue
102
-
103
- filename = xpool_files[dataset]
104
- print(f"\n📦 Downloading {dataset} Xpool checkpoint...")
105
-
106
- try:
107
- file_path = hf_hub_download(
108
  repo_id=REPO_ID,
109
  repo_type="dataset",
110
  filename=f"Xpool/{filename}",
111
- local_dir=xpool_dir.parent.parent,
112
  local_dir_use_symlinks=False,
113
  )
114
- print(f"✓ {dataset} Xpool checkpoint downloaded to {xpool_dir / filename}")
115
- except Exception as e:
116
- print(f"✗ Error downloading {dataset} Xpool checkpoint: {e}")
117
-
118
-
119
- def download_scripts(output_dir="./scripts"):
120
- """Download utility scripts."""
121
- print(f"\n{'='*70}")
122
- print("📥 Downloading Utility Scripts")
123
- print(f"{'='*70}\n")
124
-
125
- scripts_dir = Path(output_dir)
126
- scripts_dir.mkdir(parents=True, exist_ok=True)
127
-
128
- script_files = [
129
- "download_features.py",
130
- "download_checkpoints.sh",
131
- ]
132
-
133
- for script in script_files:
134
- try:
135
- file_path = hf_hub_download(
136
- repo_id=REPO_ID,
137
- repo_type="dataset",
138
- filename=script,
139
- local_dir=".",
140
- local_dir_use_symlinks=False,
141
- )
142
- print(f"✓ {script} downloaded")
143
- except Exception as e:
144
- print(f"⊘ {script} not available: {e}")
145
 
146
 
147
  def main():
148
- parser = argparse.ArgumentParser(
149
- description="Download GRDR-TVR dataset components from Hugging Face Hub",
150
- formatter_class=argparse.RawDescriptionHelpFormatter,
151
- epilog="""
152
- Examples:
153
- # Download everything for all datasets
154
- python download_features.py --all
155
-
156
- # Download only InternVideo2 features for MSR-VTT
157
- python download_features.py --features --datasets msrvtt
158
 
159
- # Download GRDR checkpoints for MSR-VTT and ActivityNet
160
- python download_features.py --grdr --datasets msrvtt actnet
161
 
162
- # Download all components for DiDeMo
163
- python download_features.py --all --datasets didemo
164
- """
165
- )
166
-
167
- # Component selection
168
- parser.add_argument(
169
- "--all",
170
- action="store_true",
171
- help="Download all components (features, GRDR, Xpool)",
172
- )
173
- parser.add_argument(
174
- "--features",
175
- action="store_true",
176
- help="Download InternVideo2 features",
177
- )
178
- parser.add_argument(
179
- "--grdr",
180
- action="store_true",
181
- help="Download GRDR model checkpoints",
182
- )
183
- parser.add_argument(
184
- "--xpool",
185
- action="store_true",
186
- help="Download Xpool reranker checkpoints",
187
- )
188
- parser.add_argument(
189
- "--scripts",
190
- action="store_true",
191
- help="Download utility scripts",
192
- )
193
-
194
- # Dataset selection
195
- parser.add_argument(
196
- "--datasets",
197
- nargs="+",
198
- choices=DATASETS,
199
- default=DATASETS,
200
- help="Datasets to download (default: all)",
201
- )
202
-
203
- # Output directories
204
- parser.add_argument(
205
- "--features-dir",
206
- type=str,
207
- default="./dataset/features",
208
- help="Output directory for features (default: ./dataset/features)",
209
- )
210
- parser.add_argument(
211
- "--grdr-dir",
212
- type=str,
213
- default="./output",
214
- help="Output directory for GRDR checkpoints (default: ./output)",
215
- )
216
- parser.add_argument(
217
- "--xpool-dir",
218
- type=str,
219
- default="./reranker/xpool/ckpt",
220
- help="Output directory for Xpool checkpoints (default: ./reranker/xpool/ckpt)",
221
- )
222
-
223
- args = parser.parse_args()
224
-
225
- # Validate: at least one component must be selected
226
- if not any([args.all, args.features, args.grdr, args.xpool, args.scripts]):
227
- parser.error("Please specify at least one component: --all, --features, --grdr, --xpool, or --scripts")
228
-
229
- print(f"\n{'='*70}")
230
- print(f"GRDR-TVR Dataset Downloader")
231
- print(f"{'='*70}")
232
- print(f"Repository: {REPO_ID}")
233
- print(f"Datasets: {', '.join(args.datasets)}")
234
- print(f"{'='*70}\n")
235
-
236
- # Download components
237
  if args.all or args.features:
238
- download_internvideo2_features(args.datasets, args.features_dir)
239
-
240
  if args.all or args.grdr:
241
- download_grdr_checkpoints(args.datasets, args.grdr_dir)
242
-
243
  if args.all or args.xpool:
244
- download_xpool_checkpoints(args.datasets, args.xpool_dir)
245
-
246
- if args.scripts:
247
- download_scripts()
248
-
249
- print(f"\n{'='*70}")
250
- print("✓ Download Complete!")
251
- print(f"{'='*70}\n")
252
- print("Next steps:")
253
- print("1. Verify downloads in the output directories")
254
- print("2. See README.md for usage instructions")
255
- print(f"3. Visit https://huggingface.co/datasets/{REPO_ID} for more details\n")
256
 
257
 
258
  if __name__ == "__main__":
 
1
  #!/usr/bin/env python3
2
+ """Download GRDR-TVR release assets from Hugging Face Hub."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  import argparse
5
+ import shutil
6
+ import tempfile
7
  from pathlib import Path
 
 
 
8
 
9
  REPO_ID = "JasonCoderMaker/GRDR-TVR"
10
+ DATASETS = ["msrvtt", "actnet", "didemo", "panda", "lsmdc"]
11
+ FEATURE_DATASETS = {"msrvtt", "actnet", "didemo", "lsmdc"}
12
+ GRDR_DATASETS = {"msrvtt", "actnet", "didemo", "panda", "lsmdc"}
13
+ XPOOL_FILES = {
14
+ "actnet": "actnet_model_best.pth",
15
+ "didemo": "didemo_model_best.pth",
16
+ "lsmdc": "lsmdc_model_best.pth",
17
+ "msrvtt": "msrvtt9k_model_best.pth",
18
+ }
19
+
20
+
21
+ def download_features(datasets, output_dir="./dataset/features"):
22
+ from huggingface_hub import snapshot_download
23
+
24
+ selected = [d for d in datasets if d in FEATURE_DATASETS]
25
+ skipped = sorted(set(datasets) - set(selected))
26
+ for dataset in skipped:
27
+ print(f"Skipping {dataset} InternVideo2 features: not hosted in this repo")
28
+ for dataset in selected:
29
+ snapshot_download(
30
+ repo_id=REPO_ID,
31
+ repo_type="dataset",
32
+ allow_patterns=f"InternVideo2/{dataset}/**",
33
+ local_dir=output_dir,
34
+ local_dir_use_symlinks=False,
35
+ )
36
+ print(f"Downloaded {dataset} InternVideo2 features")
37
+
38
+
39
+ def download_grdr(datasets, output_dir="./output/checkpoints"):
40
+ from huggingface_hub import snapshot_download
41
+
42
+ selected = [d for d in datasets if d in GRDR_DATASETS]
43
+ for dataset in selected:
44
+ snapshot_download(
45
+ repo_id=REPO_ID,
46
+ repo_type="dataset",
47
+ allow_patterns=f"GRDR/{dataset}/best_model/**",
48
+ local_dir=output_dir,
49
+ local_dir_use_symlinks=False,
50
+ )
51
+ print(f"Downloaded {dataset} GRDR checkpoint")
52
+
53
+
54
+ def download_xpool(datasets, output_dir="./reranker/xpool/ckpt"):
55
+ from huggingface_hub import hf_hub_download
 
 
 
 
56
 
 
 
 
 
 
 
57
  xpool_dir = Path(output_dir)
58
  xpool_dir.mkdir(parents=True, exist_ok=True)
 
 
 
 
 
 
 
 
59
  for dataset in datasets:
60
+ filename = XPOOL_FILES.get(dataset)
61
+ if filename is None:
62
+ print(f"Skipping {dataset} X-Pool checkpoint: not hosted in this repo")
63
  continue
64
+ with tempfile.TemporaryDirectory() as tmp:
65
+ src = hf_hub_download(
 
 
 
 
66
  repo_id=REPO_ID,
67
  repo_type="dataset",
68
  filename=f"Xpool/{filename}",
69
+ local_dir=tmp,
70
  local_dir_use_symlinks=False,
71
  )
72
+ shutil.copy2(src, xpool_dir / filename)
73
+ print(f"Downloaded {dataset} X-Pool checkpoint")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
 
76
  def main():
77
+ parser = argparse.ArgumentParser(description="Download GRDR-TVR release assets")
78
+ parser.add_argument("--all", action="store_true", help="Download hosted features, GRDR checkpoints, and X-Pool checkpoints")
79
+ parser.add_argument("--features", action="store_true", help="Download hosted InternVideo2 features")
80
+ parser.add_argument("--grdr", action="store_true", help="Download GRDR checkpoints")
81
+ parser.add_argument("--xpool", action="store_true", help="Download X-Pool checkpoints")
82
+ parser.add_argument("--datasets", nargs="+", choices=DATASETS, default=["msrvtt", "actnet", "didemo", "panda"], help="Datasets to download")
83
+ parser.add_argument("--features-dir", default="./dataset/features")
84
+ parser.add_argument("--grdr-dir", default="./output/checkpoints")
85
+ parser.add_argument("--xpool-dir", default="./reranker/xpool/ckpt")
86
+ args = parser.parse_args()
87
 
88
+ if not any([args.all, args.features, args.grdr, args.xpool]):
89
+ parser.error("Select at least one component: --all, --features, --grdr, or --xpool")
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  if args.all or args.features:
92
+ download_features(args.datasets, args.features_dir)
 
93
  if args.all or args.grdr:
94
+ download_grdr(args.datasets, args.grdr_dir)
 
95
  if args.all or args.xpool:
96
+ download_xpool(args.datasets, args.xpool_dir)
 
 
 
 
 
 
 
 
 
 
 
97
 
98
 
99
  if __name__ == "__main__":