mtastan commited on
Commit
731bfba
·
verified ·
1 Parent(s): 75116a3

Publish source backbone and reproducibility code; document compact checkpoint loading

Browse files
code/README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PACT-VAD reproducibility code snapshot
2
+
3
+ This is a file-hash-bound snapshot, not a claim of bit-identical historical training.
4
+ It contains model/evaluator source, configurations, splits, statistical analysis and
5
+ CPU tests. Raw videos, feature arrays and third-party annotation datasets are excluded.
6
+ Checkpoint metrics remain the stored observations, not a new evaluation.
7
+
8
+ ## CPU checks
9
+
10
+ ```powershell
11
+ python -m venv .venv
12
+ .venv\Scripts\python -m pip install -r requirements-dev.txt
13
+ .venv\Scripts\python -m pytest -q
14
+ .venv\Scripts\python tools/analyze_pact_10seed.py
15
+ .venv\Scripts\python tools/fetch_paa_ground_truth.py
16
+ ```
17
+
18
+ The legacy checkpoint manifest is included for its contract test; absent legacy
19
+ weights are skipped. Tests requiring undistributed PreVAD annotations and the obsolete
20
+ five-seed manuscript are excluded from this snapshot. Canonical weights are described
21
+ by the Hub's root `checkpoint_manifest.json`.
22
+ GT downloader pins author-hosted arrays and verifies historical hashes; no upstream
23
+ redistribution license is implied. Feature extraction/training are optional expensive
24
+ operations and were not run when preparing this release.
25
+
26
+ ## Load canonical checkpoint files
27
+
28
+ Ninety P/PW/PTSA files omit the frozen source to save space. They require the exact
29
+ `source/prevad_temporal_e02.pth` distributed in the same model repository. Ordinary
30
+ strict loading of the compact state alone fails; this is not corruption.
31
+
32
+ ```python
33
+ import json, sys
34
+ from huggingface_hub import hf_hub_download
35
+ sys.path.insert(0, 'src')
36
+ from released_checkpoint import load_released_checkpoint
37
+ repo = 'mtastan/PACT-VAD'
38
+ revision = '<PINNED_RELEASE_COMMIT>'
39
+ manifest = json.load(open(hf_hub_download(repo, 'checkpoint_manifest.json', revision=revision)))
40
+ entry = next(r for r in manifest['checkpoints']
41
+ if r['dataset'] == 'ShanghaiTech' and r['condition'] == 'PW' and r['seed'] == 1)
42
+ target = hf_hub_download(repo, entry['path_in_repo'], revision=revision)
43
+ source = hf_hub_download(repo, 'source/prevad_temporal_e02.pth', revision=revision)
44
+ cfg = json.load(open('configs/prevad_adaptation_shanghaitech_10seed_v1.json'))['model']
45
+ model, metadata = load_released_checkpoint(target, cfg, entry['condition'],
46
+ entry['checkpoint_sha256'], source,
47
+ 'f3c3ecd73a046beab6bdf4fcff6c2850c0428afa3361236d20ed21ea91d9473a')
48
+ ```
49
+
50
+ The loader checks hashes before safe CPU deserialization, reconstructs only the
51
+ explicitly omitted source, and enforces exact model keys/shapes. It never reads test
52
+ labels. All 180 original checkpoint states passed strict loading and a four-snippet
53
+ synthetic CPU forward; that check does not recompute dataset AUC/AP.
54
+
55
+ `evaluate.py` and `evaluate_multitarget.py` retain the historical B/R/P run-directory
56
+ interfaces. They are not six-condition Hub download runners. Use the strict loader
57
+ for PW/PLR/PTSA, preserve the exact dataset manifests and evaluator contracts, and do
58
+ not infer metric reproducibility without the historical features.
code/manifest.json ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "files": [
3
+ {
4
+ "path": "LICENSE",
5
+ "size_bytes": 1091,
6
+ "sha256": "6a4c211e5d77ccbdded31921170bd8e0c1eea6f64e19caab19a7fab986be404c"
7
+ },
8
+ {
9
+ "path": "README.md",
10
+ "size_bytes": 2966,
11
+ "sha256": "b15665d8e69627135f5cdd6b5843670c8917b4fce6e0c9e4430c126a373385a5"
12
+ },
13
+ {
14
+ "path": "checkpoints/manifest.json",
15
+ "size_bytes": 8157,
16
+ "sha256": "7782117ae19ab1a81465a3265970a9e3b57eecd27e48f2c4f05a3d6b9a339646"
17
+ },
18
+ {
19
+ "path": "configs/b_extension_shanghaitech_seeds6_10_v1.json",
20
+ "size_bytes": 995,
21
+ "sha256": "3a5abe0f826ee7c742795728dc7ad1185f393454941ebdb6e37411356ce37364"
22
+ },
23
+ {
24
+ "path": "configs/b_extension_ucf_seeds6_10_v1.json",
25
+ "size_bytes": 1066,
26
+ "sha256": "e558ed7575f436b67d5d115dd4982c42ed36208cee1cbbc8f0c0a4738a36392f"
27
+ },
28
+ {
29
+ "path": "configs/b_extension_xd_violence_seeds6_10_v1.json",
30
+ "size_bytes": 994,
31
+ "sha256": "4db58c6ce936eddc4f803b0850d539d5f8ca18e5cf56ecca8983e130c96f7bed"
32
+ },
33
+ {
34
+ "path": "configs/prevad_adaptation_shanghaitech_10seed_v1.json",
35
+ "size_bytes": 1043,
36
+ "sha256": "430969d485aa139a8f465cf863bdc1575958b9813f569c39407c9470b9d56257"
37
+ },
38
+ {
39
+ "path": "configs/prevad_adaptation_ucf_10seed_v1.json",
40
+ "size_bytes": 980,
41
+ "sha256": "90ad9e6f37c8082712b7ec03b2d7a26bd0076e5f1e9c5589b6cd57664f0fa281"
42
+ },
43
+ {
44
+ "path": "configs/prevad_adaptation_xd_violence_10seed_v1.json",
45
+ "size_bytes": 1043,
46
+ "sha256": "0ddbf4fa190f5b6bbd8ed4f6a9fed03b2cacad01e5e2d238578589c967f48922"
47
+ },
48
+ {
49
+ "path": "configs/publication_vitl14.json",
50
+ "size_bytes": 1174,
51
+ "sha256": "d1ef9b86f2b70935a2db9b19ebb022da60dcbaf16705b05017ff9f843b0dfed0"
52
+ },
53
+ {
54
+ "path": "configs/r_extension_shanghaitech_seeds6_10_v1.json",
55
+ "size_bytes": 995,
56
+ "sha256": "9d1a933c625acce1dbd81cc70c9a56fd80850b322bf4fd92c84f05af41d4bd40"
57
+ },
58
+ {
59
+ "path": "configs/r_extension_ucf_seeds6_10_v1.json",
60
+ "size_bytes": 1066,
61
+ "sha256": "c972d8c1f596e2c7ad541775ebd41992b5a5a785747a62c87a76d4a62079d4a6"
62
+ },
63
+ {
64
+ "path": "configs/r_extension_xd_violence_seeds6_10_v1.json",
65
+ "size_bytes": 994,
66
+ "sha256": "3027a3d57f644d3290368a6401bbaff3e1ec3d739e9f97107fe98653cf9deb69"
67
+ },
68
+ {
69
+ "path": "configs/shanghaitech_vitl14.json",
70
+ "size_bytes": 1052,
71
+ "sha256": "b16f03ecc55e03ffe716ab3a933642de51c442874d1c9715130acdb1c5531d11"
72
+ },
73
+ {
74
+ "path": "configs/xd_violence_vitl14.json",
75
+ "size_bytes": 946,
76
+ "sha256": "574cf18860008b79dfa9575e3257ae4e072bea6ab23e42b291afaac8d3ff9b30"
77
+ },
78
+ {
79
+ "path": "data/splits/prevad_train_val_duplicate_exclusions.json",
80
+ "size_bytes": 2011,
81
+ "sha256": "ca33b736ecdbee168f434eb4c18d760337e41d50b624d61f4d883036d829491c"
82
+ },
83
+ {
84
+ "path": "data/splits/shanghaitech_v1/feature_lengths.json",
85
+ "size_bytes": 32947,
86
+ "sha256": "8c2f8013702b04eed385169453dacfd5b1c794fa8a2fcfc3fc14bbea7812b8b9"
87
+ },
88
+ {
89
+ "path": "data/splits/shanghaitech_v1/protocol.json",
90
+ "size_bytes": 998,
91
+ "sha256": "f62cc36f73cf007c24ac8256227a77ca5bf8967acc97d2e55fd8511a00ff36d2"
92
+ },
93
+ {
94
+ "path": "data/splits/shanghaitech_v1/test.json",
95
+ "size_bytes": 22180,
96
+ "sha256": "b6ee9b19a4eb53758462dfba5dfcfe5a724a02cf5c5bc8d979d7e2bdfab1b582"
97
+ },
98
+ {
99
+ "path": "data/splits/shanghaitech_v1/train.json",
100
+ "size_bytes": 21132,
101
+ "sha256": "c8b02c3237c5623f693cfd15eb3a1fdc366ea25e6070785f863e144eb71dfd71"
102
+ },
103
+ {
104
+ "path": "data/splits/shanghaitech_v1/val.json",
105
+ "size_bytes": 5370,
106
+ "sha256": "a4d64274a1a4ab2303e96f0063f3266026c59209e8467bc96a7e23a135a57801"
107
+ },
108
+ {
109
+ "path": "data/splits/ucf_crime_unbiased/test.json",
110
+ "size_bytes": 8965,
111
+ "sha256": "69b429a2e493296c0978b86c6a5d4c9e840c67688f953d2aaff6a6845d2b7a37"
112
+ },
113
+ {
114
+ "path": "data/splits/ucf_crime_unbiased/train.json",
115
+ "size_bytes": 37168,
116
+ "sha256": "1abae4be6cdcd22be78aad5893961286bfdaa5b1b3e95d323427d0b1c8eb216f"
117
+ },
118
+ {
119
+ "path": "data/splits/ucf_crime_unbiased/val.json",
120
+ "size_bytes": 9713,
121
+ "sha256": "2a6397b609ca65e49fa89201822fd9a732cb81e96fad1d416e5a5d66a9cae038"
122
+ },
123
+ {
124
+ "path": "data/splits/xd_violence_v1/feature_lengths.json",
125
+ "size_bytes": 520976,
126
+ "sha256": "1c5aa251e004f384f24601c89f8b21999c535c86dcddce7bcafacd9ea50e22de"
127
+ },
128
+ {
129
+ "path": "data/splits/xd_violence_v1/protocol.json",
130
+ "size_bytes": 1146,
131
+ "sha256": "d2744ce5939d6afd9737479339862b43fb422c2dfec2ce3276a52ac9d3f43656"
132
+ },
133
+ {
134
+ "path": "data/splits/xd_violence_v1/test.json",
135
+ "size_bytes": 146389,
136
+ "sha256": "cc4a3e96b64162aeb9462d0fde4e5a0279f7202a39fdcfe44fe83352cd1a54dd"
137
+ },
138
+ {
139
+ "path": "data/splits/xd_violence_v1/train.json",
140
+ "size_bytes": 570106,
141
+ "sha256": "ef3c628dd01c55ee7815a2552c7d76a8f2023ed73a1d69de93814ecbb0712964"
142
+ },
143
+ {
144
+ "path": "data/splits/xd_violence_v1/val.json",
145
+ "size_bytes": 143465,
146
+ "sha256": "35457e59c9cbd872330837f5e736f1d0d2568329ab4a1e605e12e5e754ee62aa"
147
+ },
148
+ {
149
+ "path": "requirements-dev.txt",
150
+ "size_bytes": 55,
151
+ "sha256": "68274312f8393efd3885af6e426b5e2736b58b218d4f757db9f3af445dc42b4c"
152
+ },
153
+ {
154
+ "path": "requirements-extraction.txt",
155
+ "size_bytes": 155,
156
+ "sha256": "d1507f3ce7555b7c773355156125f8cc1a68d0f919520839a7f48ce9ae6a9f19"
157
+ },
158
+ {
159
+ "path": "requirements.txt",
160
+ "size_bytes": 105,
161
+ "sha256": "a0acc602f8811ca49f1875bb3d31073df3cc65ddccaf04ea6e5b0e0179f75482"
162
+ },
163
+ {
164
+ "path": "results/evaluations/pact_10seed_selected_runs.json",
165
+ "size_bytes": 126005,
166
+ "sha256": "31c1c5be3c338ea53426d7d5b6852db6759aa2fe6f4936903b3cf6eef8633fb7"
167
+ },
168
+ {
169
+ "path": "src/data.py",
170
+ "size_bytes": 13853,
171
+ "sha256": "27c7e93481e1b5ca59be3a0de18455d1f410770ac8627c41e9ce17f64c855982"
172
+ },
173
+ {
174
+ "path": "src/metrics.py",
175
+ "size_bytes": 6953,
176
+ "sha256": "1004c08c0de7dd03c9255fc9d3aefb6c77434b2d322494a6ad6642a9d1127dd8"
177
+ },
178
+ {
179
+ "path": "src/model.py",
180
+ "size_bytes": 11347,
181
+ "sha256": "ab11dec3af5c4aeb868ac8c0cfa0fbacb45b8171c65a795118694c60c4452dee"
182
+ },
183
+ {
184
+ "path": "src/released_checkpoint.py",
185
+ "size_bytes": 1732,
186
+ "sha256": "7cc54c1df858e2faa6a778ea50dc5edbd0e6a6579bdb6b80685ada6004c4836a"
187
+ },
188
+ {
189
+ "path": "src/utils.py",
190
+ "size_bytes": 866,
191
+ "sha256": "b7fa9c3a024012fd050b1bacadcdc94a064e24d90f753188dbe7d7ff796fd864"
192
+ },
193
+ {
194
+ "path": "tests/test_checkpoint_manifest.py",
195
+ "size_bytes": 2543,
196
+ "sha256": "d80559c3bf6134ed28aa657c5f39c5f68412c18d23dce92d147273f2f3cfb601"
197
+ },
198
+ {
199
+ "path": "tests/test_model.py",
200
+ "size_bytes": 5416,
201
+ "sha256": "40f8ebba24e0d709b46ff901555b98735193a6d05afe8c37b889f4189b35031b"
202
+ },
203
+ {
204
+ "path": "tests/test_multitarget_extraction.py",
205
+ "size_bytes": 2827,
206
+ "sha256": "466657837b1414e824bbdecd9341d14d7d25a368ab372491bd6bee9a86bee883"
207
+ },
208
+ {
209
+ "path": "tests/test_multitarget_metrics.py",
210
+ "size_bytes": 1968,
211
+ "sha256": "06bf754499a076b5b1f4a435f05736d3f29d7b400bdf0fc35ad94d99720c6135"
212
+ },
213
+ {
214
+ "path": "tests/test_multitarget_statistics.py",
215
+ "size_bytes": 1171,
216
+ "sha256": "1353ef1e489d3809a36ffcc4d1f4d5803652b49daf9bb11f6e8f45c9969dd5cc"
217
+ },
218
+ {
219
+ "path": "tests/test_paper_statistics.py",
220
+ "size_bytes": 879,
221
+ "sha256": "cdcb9180037e708280945c37bda3e1e6c2dee7d265769ed97f525040f3cb1950"
222
+ },
223
+ {
224
+ "path": "tests/test_source_objective.py",
225
+ "size_bytes": 991,
226
+ "sha256": "d9552b2537f512005ee8b6add3c2f4f25eec050db124076b13130d5c9bd70c04"
227
+ },
228
+ {
229
+ "path": "tools/analyze_pact_10seed.py",
230
+ "size_bytes": 8391,
231
+ "sha256": "eef3e58ea5944cbfa7953894d614abde5b3edf169ff30dd5935fc20a665e04c4"
232
+ },
233
+ {
234
+ "path": "tools/audit_multitarget_data.py",
235
+ "size_bytes": 6414,
236
+ "sha256": "1703b8c905b594088f49cba3ba36801cad15fb4ef5d28fad5f6f6e57bfc6ec0e"
237
+ },
238
+ {
239
+ "path": "tools/evaluate.py",
240
+ "size_bytes": 4466,
241
+ "sha256": "8c0e864dac43c3b25b4ec25d3c1bd41a751cd772dc3a511e9a51df0592317246"
242
+ },
243
+ {
244
+ "path": "tools/evaluate_multitarget.py",
245
+ "size_bytes": 6358,
246
+ "sha256": "c6b9414ff1c47f7e9bcb51ea0c092dd7b14a4ada169349610c0c012c5fed2ed2"
247
+ },
248
+ {
249
+ "path": "tools/extract_multitarget_vitl14.py",
250
+ "size_bytes": 14372,
251
+ "sha256": "1c7f85ee58dc34e674dc3f421c29ba9ac41cb13a74d60e94cdb9494f8dc7eef1"
252
+ },
253
+ {
254
+ "path": "tools/fetch_paa_ground_truth.py",
255
+ "size_bytes": 1412,
256
+ "sha256": "2e2ff299288c8654a03ae2e06982de79527570f74054215be7f021640131e05f"
257
+ },
258
+ {
259
+ "path": "tools/lock_multitarget_lengths.py",
260
+ "size_bytes": 5736,
261
+ "sha256": "5f3726e28abc46ba907d27d35623a2372415338f66c167291f87111663595566"
262
+ },
263
+ {
264
+ "path": "tools/paper_statistics.py",
265
+ "size_bytes": 5329,
266
+ "sha256": "a01304f8159b302194f7fe3e3b0f0f86c5e1b739076e8f66c15773727dea2498"
267
+ },
268
+ {
269
+ "path": "tools/prepare_multitarget_manifests.py",
270
+ "size_bytes": 5558,
271
+ "sha256": "33f00719a298db90e7e72addc2d70b9977b4a75472b4814722adfdac16454842"
272
+ },
273
+ {
274
+ "path": "tools/pretrain_prevad.py",
275
+ "size_bytes": 9522,
276
+ "sha256": "afe46102e6ef750bb1e03fd5e858885d90bf70cc94b30b641a5de7765f48ce5b"
277
+ },
278
+ {
279
+ "path": "tools/train_ablation.py",
280
+ "size_bytes": 7963,
281
+ "sha256": "ab14e6625847864b3a6c72fea99d2df23e79375cd3af05562b9fafc27ce4df73"
282
+ },
283
+ {
284
+ "path": "tools/train_prevad_initialization_adaptation.py",
285
+ "size_bytes": 15767,
286
+ "sha256": "a555bc54eb31c7eb1e637ee166a09394de4d74392badfdd08a9c6c791fcf76b4"
287
+ }
288
+ ],
289
+ "archive_sha256": "64ae1b063feb97fb275e5234ce088e83e98b6655a5ca286fdb396a6a647b1302",
290
+ "archive_size_bytes": 266330,
291
+ "license": "MIT for project code; third-party data not relicensed"
292
+ }
code/pact_vad_code.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64ae1b063feb97fb275e5234ce088e83e98b6655a5ca286fdb396a6a647b1302
3
+ size 266330
evidence/checkpoint_cpu_audit.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "verified_target_checkpoints": 180,
3
+ "compact_checkpoints_requiring_source": 90,
4
+ "source_sha256": "f3c3ecd73a046beab6bdf4fcff6c2850c0428afa3361236d20ed21ea91d9473a",
5
+ "strict_state_load": true,
6
+ "synthetic_cpu_forward": true,
7
+ "test_metrics_recomputed": false,
8
+ "training_performed": false
9
+ }
source/prevad_temporal_e02.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3c3ecd73a046beab6bdf4fcff6c2850c0428afa3361236d20ed21ea91d9473a
3
+ size 22137301