spw2000 commited on
Commit
3b0e340
·
verified ·
1 Parent(s): 0bf4193

Upload visual_prompt dataset archives

Browse files
README.md ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # visual_prompt upload package
2
+
3
+ This folder contains the upload helper for packaging the four instant-streaming
4
+ colloquial JSON files and the MP4 files referenced by their `videos` fields.
5
+
6
+ Target Hugging Face repo:
7
+
8
+ ```bash
9
+ spw2000/visual_prompt
10
+ ```
11
+
12
+ ## Files included
13
+
14
+ The upload script packages these four metadata files:
15
+
16
+ ```text
17
+ test_instant_streaming.colloquial.en.json
18
+ test_instant_streaming.colloquial.zh.json
19
+ train_instant_streaming.colloquial.en.json
20
+ train_instant_streaming.colloquial.zh.json
21
+ ```
22
+
23
+ It scans each JSON file, reads every `videos` list, deduplicates all referenced
24
+ video paths, rewrites packaged JSON video paths to be relative to the extracted
25
+ `metadata/` directory, and packages the corresponding video files.
26
+
27
+ ## Uploaded structure
28
+
29
+ Running `2_upload.py` creates `hf_archives/` locally and uploads that folder to
30
+ Hugging Face:
31
+
32
+ ```text
33
+ README.md
34
+ manifest.json
35
+ visual_prompt_metadata.tar.gz
36
+ visual_prompt_videos-00000-of-XXXXX.tar.gz
37
+ visual_prompt_videos-00001-of-XXXXX.tar.gz
38
+ ...
39
+ ```
40
+
41
+ `visual_prompt_metadata.tar.gz` contains:
42
+
43
+ ```text
44
+ README.md
45
+ manifest.json
46
+ metadata/test_instant_streaming.colloquial.en.json
47
+ metadata/test_instant_streaming.colloquial.zh.json
48
+ metadata/train_instant_streaming.colloquial.en.json
49
+ metadata/train_instant_streaming.colloquial.zh.json
50
+ ```
51
+
52
+ The JSON files inside this archive are rewritten copies. The source JSON files
53
+ in `hf_upload/` are not modified.
54
+
55
+ Each `visual_prompt_videos-*.tar.gz` contains videos using paths relative to the
56
+ `RGA3-release-local` project root. For example:
57
+
58
+ ```text
59
+ mp4/datasets/VideoInfer-Release/frames/MOSE/train/e607450d/00002.mp4
60
+ ```
61
+
62
+ ## Install dependency
63
+
64
+ ```bash
65
+ pip install huggingface_hub
66
+ ```
67
+
68
+ ## Upload
69
+
70
+ Recommended usage:
71
+
72
+ ```bash
73
+ cd /home/dyvm6xra/dyvm6xrauser04/peiwensun/project/RGA3-release-local/hf_upload
74
+ export HF_TOKEN="YOUR_HUGGINGFACE_TOKEN"
75
+ python 2_upload.py
76
+ ```
77
+
78
+ You can also pass the token directly:
79
+
80
+ ```bash
81
+ python 2_upload.py --token "YOUR_HUGGINGFACE_TOKEN"
82
+ ```
83
+
84
+ Before uploading, you can scan and print the package plan:
85
+
86
+ ```bash
87
+ python 2_upload.py --dry-run
88
+ ```
89
+
90
+ To only build local archives without uploading:
91
+
92
+ ```bash
93
+ python 2_upload.py --skip-upload
94
+ ```
95
+
96
+ Common options:
97
+
98
+ ```bash
99
+ python 2_upload.py \
100
+ --repo-id spw2000/visual_prompt \
101
+ --repo-type dataset \
102
+ --max-shard-size 20GB \
103
+ --scan-workers 32 \
104
+ --num-workers 8
105
+ ```
106
+
107
+ By default the script uses Hugging Face `upload_large_folder`, which is
108
+ resumable and supports parallel upload workers through `--num-workers`. This is
109
+ recommended for the generated archive folder. If you need a single normal commit
110
+ message upload instead, disable it:
111
+
112
+ ```bash
113
+ python 2_upload.py --no-upload-large-folder
114
+ ```
115
+
116
+ ## Download and extract
117
+
118
+ After downloading the uploaded files from Hugging Face, extract them into one
119
+ dataset directory:
120
+
121
+ ```bash
122
+ mkdir -p visual_prompt
123
+ tar -xzf visual_prompt_metadata.tar.gz -C visual_prompt
124
+ for shard in visual_prompt_videos-*.tar.gz; do
125
+ tar -xzf "$shard" -C visual_prompt
126
+ done
127
+ ```
128
+
129
+ The extracted structure will look like:
130
+
131
+ ```text
132
+ visual_prompt/
133
+ README.md
134
+ manifest.json
135
+ metadata/
136
+ test_instant_streaming.colloquial.en.json
137
+ test_instant_streaming.colloquial.zh.json
138
+ train_instant_streaming.colloquial.en.json
139
+ train_instant_streaming.colloquial.zh.json
140
+ mp4/
141
+ datasets/
142
+ VideoInfer-Release/
143
+ frames/
144
+ ...
145
+ ```
146
+
147
+ ## Resolving video paths
148
+
149
+ The packaged JSON files use paths relative to their own `metadata/` directory.
150
+ For example, a source video path under local `RGA3-release-local/mp4/...` is
151
+ written into the uploaded JSON as:
152
+
153
+ ```text
154
+ ../mp4/datasets/VideoInfer-Release/frames/MOSE/train/e607450d/00002.mp4
155
+ ```
156
+
157
+ If you read a JSON file from `visual_prompt/metadata/`, resolve each video path
158
+ against the JSON file's parent directory:
159
+
160
+ ```python
161
+ from pathlib import Path
162
+
163
+
164
+ json_path = Path("visual_prompt/metadata/train_instant_streaming.colloquial.en.json")
165
+ raw_video_path = "../mp4/datasets/VideoInfer-Release/frames/MOSE/train/e607450d/00002.mp4"
166
+ video_path = (json_path.parent / raw_video_path).resolve()
167
+ ```
168
+
169
+ `manifest.json` records archive names, SHA256 checksums, per-JSON `videos`
170
+ array counts, video-reference counts, video counts, missing-video count, and
171
+ compressed/uncompressed sizes. It also records that packaged JSON video paths
172
+ use the `../mp4/...` layout.
manifest.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "repo_id": "spw2000/visual_prompt",
3
+ "repo_type": "dataset",
4
+ "created_at_utc": "2026-06-23T15:31:44.634005+00:00",
5
+ "source_root": "/home/dyvm6xra/dyvm6xrauser04/peiwensun/project/RGA3-release-local",
6
+ "json_files": [
7
+ {
8
+ "file": "test_instant_streaming.colloquial.en.json",
9
+ "videos_arrays": 38731,
10
+ "video_references": 892469
11
+ },
12
+ {
13
+ "file": "test_instant_streaming.colloquial.zh.json",
14
+ "videos_arrays": 63460,
15
+ "video_references": 1460986
16
+ },
17
+ {
18
+ "file": "train_instant_streaming.colloquial.en.json",
19
+ "videos_arrays": 152648,
20
+ "video_references": 3980102
21
+ },
22
+ {
23
+ "file": "train_instant_streaming.colloquial.zh.json",
24
+ "videos_arrays": 152648,
25
+ "video_references": 3980102
26
+ }
27
+ ],
28
+ "video_count": 216277,
29
+ "missing_video_count": 0,
30
+ "missing_videos": [],
31
+ "uncompressed_video_bytes": 22950789866,
32
+ "max_shard_size": "20GB",
33
+ "packaged_json_video_paths": "../mp4/...",
34
+ "archives": [
35
+ {
36
+ "file": "visual_prompt_metadata.tar.gz",
37
+ "kind": "metadata",
38
+ "contains": [
39
+ "README.md",
40
+ "manifest.json",
41
+ "metadata/*.json"
42
+ ],
43
+ "compressed_bytes": 146281131,
44
+ "sha256": "086fdf0ba6024f6706c5a2991aa597b157b6b608a021d5c2a45c05632f63d5d4"
45
+ },
46
+ {
47
+ "file": "visual_prompt_videos-00000-of-00002.tar.gz",
48
+ "kind": "videos",
49
+ "video_count": 202275,
50
+ "uncompressed_bytes": 21474610791,
51
+ "compressed_bytes": 21421562744,
52
+ "sha256": "4b1fee7c6646e338d81f32e939e031400a9815d6a52b11b213b7c20ec1feb526"
53
+ },
54
+ {
55
+ "file": "visual_prompt_videos-00001-of-00002.tar.gz",
56
+ "kind": "videos",
57
+ "video_count": 14002,
58
+ "uncompressed_bytes": 1476179075,
59
+ "compressed_bytes": 1472873110,
60
+ "sha256": "36a41cee295eb43b6d6d424f1fc956f13a9c2afc3ab170f8d8242017323bc31e"
61
+ }
62
+ ]
63
+ }
visual_prompt_metadata.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:086fdf0ba6024f6706c5a2991aa597b157b6b608a021d5c2a45c05632f63d5d4
3
+ size 146281131
visual_prompt_videos-00000-of-00002.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b1fee7c6646e338d81f32e939e031400a9815d6a52b11b213b7c20ec1feb526
3
+ size 21421562744
visual_prompt_videos-00001-of-00002.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36a41cee295eb43b6d6d424f1fc956f13a9c2afc3ab170f8d8242017323bc31e
3
+ size 1472873110