Hollis71025 commited on
Commit
fedfcdc
·
verified ·
1 Parent(s): 3049097

Cosmos3_Official: re-upload the ONNX bundle; add a sanity check on three driving clips (straight, left turn, right turn)

Browse files
.gitattributes CHANGED
@@ -38,3 +38,9 @@ NoMaD_GL_Official/nomad_vision_encoder.onnx.data filter=lfs diff=lfs merge=lfs -
38
  Vint_GL_Official/vint_imagegoal.onnx.data filter=lfs diff=lfs merge=lfs -text
39
  Cosmos3_Official/denoiser.onnx.data filter=lfs diff=lfs merge=lfs -text
40
  Cosmos3_Official/encoder.onnx.data filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
38
  Vint_GL_Official/vint_imagegoal.onnx.data filter=lfs diff=lfs merge=lfs -text
39
  Cosmos3_Official/denoiser.onnx.data filter=lfs diff=lfs merge=lfs -text
40
  Cosmos3_Official/encoder.onnx.data filter=lfs diff=lfs merge=lfs -text
41
+ Cosmos3_Official/sanity_check/clips/right_turn.png filter=lfs diff=lfs merge=lfs -text
42
+ Cosmos3_Official/sanity_check/clips/right_turn.mp4 filter=lfs diff=lfs merge=lfs -text
43
+ Cosmos3_Official/sanity_check/clips/left_turn.png filter=lfs diff=lfs merge=lfs -text
44
+ Cosmos3_Official/sanity_check/clips/left_turn.mp4 filter=lfs diff=lfs merge=lfs -text
45
+ Cosmos3_Official/sanity_check/clips/straight.png filter=lfs diff=lfs merge=lfs -text
46
+ Cosmos3_Official/sanity_check/clips/straight.mp4 filter=lfs diff=lfs merge=lfs -text
Cosmos3_Official/sanity_check/README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Cosmos3_Official sanity check
2
+
3
+ Checks the ONNX bundle in the parent folder on three driving clips: straight,
4
+ left turn, right turn. The model plans 6 s from the first frame of each clip.
5
+ That plan's heading change is compared with the recorded one.
6
+
7
+ ```bash
8
+ pip install "onnxruntime-gpu[cuda,cudnn]" numpy pillow
9
+ python sanity_check.py # --bundle defaults to the parent folder
10
+ ```
11
+
12
+ It prints one line per clip and then `PASS` or `FAIL`. It also writes
13
+ `out/<clip>.png`, with the plans (orange, one per seed) and the recorded path
14
+ (white) drawn on the frame.
15
+
16
+ Expected output (seeds 1-3; 6 s heading in degrees, left +):
17
+
18
+ | clip | recorded | plans |
19
+ |------------|---------:|---------------|
20
+ | straight | -0.0 | +3 +6 +0 |
21
+ | left_turn | +83.6 | +76 +81 +79 |
22
+ | right_turn | -74.5 | -93 -83 -96 |
23
+
24
+ A clip passes when every seed turns the same way as the recording, within
25
+ 30°. On the straight clip, every seed must stay within 15° of 0.
26
+
27
+ The input is the RGB frame with no JPEG round trip, centre-cropped and resized
28
+ to the 832x480 canvas. One frame takes about 1 min on one GPU (encoder plus
29
+ 30 UniPC denoiser steps per seed).
30
+
31
+ ## Clips
32
+
33
+ `clips/{straight,left_turn,right_turn}.{mp4,json,png}` are NVIDIA's Cosmos
34
+ action-conditioning samples from
35
+ [nvidia-cosmos/cosmos-dependencies](https://github.com/nvidia-cosmos/cosmos-dependencies/tree/2b17a2413bd86b2cf9b03823637108851e4ddf2d/inputs/action)
36
+ (Apache-2.0):
37
+
38
+ - `straight`: `av_480_20260501_3`
39
+ - `left_turn`: `av_vision_25_73d01c91-51f0-46cf-9b76-5682a76fb349` with `av_action_25.json`
40
+ - `right_turn`: `av_480_20260501_5`
41
+
42
+ Each `.json` holds the recorded camera motion in the model's action format: 10 Hz
43
+ framewise poses `[t_xyz | rot6d]` in the camera frame (x right, y down, z forward).
44
+ Each `.png` is the first frame of the `.mp4`.
Cosmos3_Official/sanity_check/clips/left_turn.json ADDED
@@ -0,0 +1 @@
 
 
1
+ [[-0.12026730179786682, 0.0017713659908622503, 0.5684227347373962, 0.9991111159324646, -0.0015334925847128034, 0.042125724256038666, 0.0015808206517249346, 0.999998152256012, -0.0010902057401835918], [-0.12804141640663147, 0.002229508012533188, 0.5940384864807129, 0.9989725351333618, -0.001204136642627418, 0.04530496895313263, 0.0012632064754143357, 0.9999983906745911, -0.0012752176262438297], [-0.13004480302333832, 0.0009306636056862772, 0.6178169250488281, 0.9989343285560608, -6.02635154791642e-05, 0.04615442827343941, 0.00013157085049897432, 0.9999988675117493, -0.0015419400297105312], [-0.13660947978496552, -0.0005720956833101809, 0.6402947306632996, 0.9988917112350464, -0.0019285852322354913, 0.04702725261449814, 0.0020434530451893806, 0.9999949932098389, -0.0023946312721818686], [-0.1308821141719818, 0.0007168878219090402, 0.6626824140548706, 0.9988586902618408, 0.002549123717471957, 0.047693513333797455, -0.002391596557572484, 0.9999914765357971, -0.0033596763387322426], [-0.13752663135528564, 0.00559708196669817, 0.6847425699234009, 0.9987595677375793, 0.0009776675142347813, 0.049784332513809204, -0.0008356657926924527, 0.9999955296516418, -0.002873070538043976], [-0.14002758264541626, 0.004100925754755735, 0.7021879553794861, 0.9988041520118713, -0.00032487494172528386, 0.048889726400375366, 0.00035206208121962845, 0.9999998211860657, -0.0005474779172800481], [-0.1500609964132309, -0.0012903420720249414, 0.7191776037216187, 0.9987573027610779, -0.004832719452679157, 0.049601804465055466, 0.004813776351511478, 0.9999882578849792, 0.0005013602785766125], [-0.14648327231407166, -0.0026733886916190386, 0.7395944595336914, 0.9987809062004089, -0.002424099249765277, 0.04930396005511284, 0.0024444295559078455, 0.9999969601631165, -0.0003520397876854986], [-0.1460268646478653, -0.00021255668252706528, 0.7622190117835999, 0.9987704753875732, -0.0026650922372937202, 0.04950123280286789, 0.0028147350531071424, 0.9999917149543762, -0.0029535407666116953], [-0.14090557396411896, 0.004231681115925312, 0.7837788462638855, 0.9988074898719788, -2.28022581723053e-05, 0.04882212355732918, 0.0002442722034174949, 0.9999897480010986, -0.004530321341007948], [-0.14225849509239197, 0.0009396650129929185, 0.7996976375579834, 0.9988813400268555, -0.003087613731622696, 0.047187440097332, 0.003199781756848097, 0.9999922513961792, -0.002301702508702874], [-0.13233378529548645, 0.0011183001333847642, 0.8183503746986389, 0.9989896416664124, 0.0008758579497225583, 0.04493272677063942, -0.0008072418277151883, 0.9999984502792358, -0.0015452469233423471], [-0.13975462317466736, 0.0009136341395787895, 0.8376764059066772, 0.9989259243011475, -0.004130692221224308, 0.04615023359656334, 0.004198129288852215, 0.9999901652336121, -0.0013643904821947217], [-0.12653152644634247, -0.004086479544639587, 0.8536048531532288, 0.9990729689598083, 0.0009709938312880695, 0.043039366602897644, -0.0010258086258545518, 0.9999987483024597, 0.0012515161652117968], [-0.1302531659603119, -0.010011332109570503, 0.87111496925354, 0.9990827441215515, -0.002835423219949007, 0.04272790998220444, 0.0027697819750756025, 0.9999949336051941, 0.001595384906977415], [-0.1301908940076828, -0.006506784353405237, 0.8918353915214539, 0.9991073608398438, -0.0024780083913356066, 0.042170342057943344, 0.0024681976065039635, 0.9999969005584717, 0.0002847015857696533], [-0.1251635104417801, -0.0039050683844834566, 0.9114601016044617, 0.9991185069084167, 0.0005345670506358147, 0.04197607561945915, -0.0005479573737829924, 0.9999997615814209, 0.0003075073764193803], [-0.11868228018283844, -0.0048194769769907, 0.9314054846763611, 0.9990880489349365, 0.003579585114493966, 0.04254790395498276, -0.0035326327197253704, 0.9999931454658508, -0.0011786542600020766], [-0.12054426968097687, -0.004967142827808857, 0.9504997730255127, 0.9991070628166199, 0.002097031334415078, 0.042198941111564636, -0.001982279121875763, 0.9999942183494568, -0.002761006820946932], [-0.12040779739618301, 8.790940228209365e-06, 0.9704052209854126, 0.9991544485092163, 0.0014463396510109305, 0.041089341044425964, -0.0013138296781107783, 0.9999938607215881, -0.0032517488580197096], [-0.13204418122768402, 0.0007861554622650146, 0.9861482977867126, 0.9991764426231384, -0.005458076950162649, 0.04020677134394646, 0.005502214189618826, 0.9999843835830688, -0.0009872436057776213], [-0.12998038530349731, 0.007033053785562515, 1.0089209079742432, 0.999167263507843, -0.004320904146879911, 0.0405719056725502, 0.004483286291360855, 0.9999822974205017, -0.003912234678864479], [-0.11372072994709015, 0.007775858044624329, 1.031522274017334, 0.9993134140968323, 0.0012757866643369198, 0.037029728293418884, -0.0010499208001419902, 0.9999807476997375, -0.00611839909106493], [-0.11856930702924728, 0.003941760864108801, 1.05104398727417, 0.9992676973342896, -0.002674712100997567, 0.03816841170191765, 0.002911253832280636, 0.9999768733978271, -0.00614304980263114], [-0.11039328575134277, 0.0015286178095266223, 1.067551851272583, 0.9994114637374878, -0.0004201462143100798, 0.03430071473121643, 0.0005043093115091324, 0.9999969005584717, -0.0024449347984045744], [-0.11867938190698624, -0.007653992157429457, 1.0783600807189941, 0.999382734298706, -0.005864775273948908, 0.03463919460773468, 0.005687727127224207, 0.9999702572822571, 0.005207460839301348], [-0.11224208027124405, -0.010553191415965557, 1.0973423719406128, 0.9994036555290222, -0.0029192387592047453, 0.034405969083309174, 0.0027678103651851416, 0.9999862313270569, 0.004448088351637125], [-0.10676779597997665, -0.006749249529093504, 1.1227619647979736, 0.9994156956672668, 0.0003511296526994556, 0.03417840600013733, -0.0003125729563180357, 0.9999993443489075, -0.0011334725422784686], [-0.10233056545257568, -0.0015584909124299884, 1.1481082439422607, 0.9994795918464661, 0.00014422526874113828, 0.03225761651992798, 4.957193959853612e-05, 0.9999819397926331, -0.006006928626447916], [-0.09780192375183105, -0.0020018802024424076, 1.165030598640442, 0.9995834231376648, -0.002240641973912716, 0.028775904327630997, 0.002337930491194129, 0.9999917149543762, -0.0033476632088422775], [-0.08911736309528351, -0.011832605116069317, 1.1755260229110718, 0.9997004866600037, -0.004143653437495232, 0.024120252579450607, 0.0040411148220300674, 0.9999825358390808, 0.004298365209251642], [-0.07697725296020508, -0.020361265167593956, 1.1878108978271484, 0.9998055100440979, -0.004334670025855303, 0.019238129258155823, 0.004162495490163565, 0.9999510049819946, 0.008980611339211464], [-0.06432666629552841, -0.019232233986258507, 1.208953619003296, 0.9998736381530762, -0.003201964544132352, 0.015570137649774551, 0.0031274904031306505, 0.999983549118042, 0.004805233795195818], [-0.051229335367679596, -0.009870312176644802, 1.237890601158142, 0.999920666217804, -0.0004109164874535054, 0.012589626014232635, 0.0004679737030528486, 0.9999895691871643, -0.004529398865997791], [-0.035821009427309036, 0.005727166775614023, 1.2630938291549683, 0.9999560713768005, 0.002714411821216345, 0.008969303220510483, -0.002638631733134389, 0.9999607801437378, -0.008449826389551163], [-0.04273596033453941, 0.005872026085853577, 1.277230143547058, 0.9999515414237976, -0.0009937724098563194, 0.009784482419490814, 0.0010401068720966578, 0.9999881982803345, -0.004731615073978901], [-0.041712429374456406, 0.0018146351212635636, 1.2902206182479858, 0.9999570846557617, 7.39612223696895e-05, 0.009269969537854195, -6.344386929413304e-05, 0.9999993443489075, -0.0011348093394190073], [-0.04490790516138077, -0.004935841541737318, 1.3036926984786987, 0.9999505281448364, -0.0022418180014938116, 0.009686710312962532, 0.0022263412829488516, 0.9999961853027344, 0.0016081654466688633], [-0.042241573333740234, -0.012890535406768322, 1.3182950019836426, 0.9999697208404541, -0.0030185335781425238, 0.007180940359830856, 0.003006273414939642, 0.9999940395355225, 0.0017175357788801193], [-0.038063764572143555, -0.011848296038806438, 1.3367623090744019, 0.9999802112579346, -0.0026785291265696287, 0.005689053796231747, 0.0026759004686027765, 0.9999962449073792, 0.00046992278657853603], [-0.03488502651453018, -0.01649625040590763, 1.3500515222549438, 0.999984860420227, -0.0016346215270459652, 0.005255414638668299, 0.001620424329303205, 0.9999950528144836, 0.002704364713281393], [-0.02967209927737713, -0.021472586318850517, 1.3631991147994995, 0.9999903440475464, -0.0002479591057635844, 0.004387234337627888, 0.00022767786867916584, 0.9999892711639404, 0.004622901789844036], [-0.03065958060324192, -0.020474456250667572, 1.3783525228500366, 0.9999877214431763, 5.559391138376668e-05, 0.004951141774654388, -7.693344377912581e-05, 0.9999907612800598, 0.004309793934226036], [-0.03108959272503853, -0.016124514862895012, 1.3967734575271606, 0.9999894499778748, -0.0013926529791206121, 0.004373505711555481, 0.0013922173529863358, 0.9999989867210388, 0.00010257430403726175], [-0.030745839700102806, -0.006060468032956123, 1.4162321090698242, 0.9999922513961792, -0.003019534284248948, 0.002528178272768855, 0.00302924495190382, 0.9999880194664001, -0.0038456704933196306], [-0.026965856552124023, -0.004415541421622038, 1.429595947265625, 0.9999938011169434, -0.0034749293699860573, 0.0006310429889708757, 0.0034764432348310947, 0.9999911189079285, -0.002413516165688634], [-0.023308182135224342, -0.00567862531170249, 1.44109046459198, 0.9999990463256836, -0.0013085316168144345, 0.0004416478332132101, 0.0013084439560770988, 0.9999991655349731, 0.00019912370771635324], [-0.02489175833761692, -0.008309923112392426, 1.4540165662765503, 0.999997615814209, -0.001744328299537301, 0.001262582722119987, 0.0017434206092730165, 0.9999982714653015, 0.000716916867531836], [-0.02183404006063938, -0.00934371817857027, 1.4686059951782227, 0.9999997615814209, -0.0006087875226512551, 0.0004140722448937595, 0.0006090542301535606, 0.9999995827674866, -0.0006431179353967309], [-0.02338542975485325, -0.008244991302490234, 1.4838495254516602, 0.9999984502792358, -0.0017083139391615987, 0.00044887865078635514, 0.001709098694846034, 0.9999970197677612, -0.0017551680793985724], [-0.020305825397372246, -0.006316361017525196, 1.497362732887268, 0.9999999403953552, -0.0001689325290499255, 7.782400643918663e-06, 0.00016894265718292445, 0.9999989867210388, -0.001372592058032751], [-0.02326183393597603, -0.0096277492120862, 1.509428858757019, 0.9999988675117493, -0.0015175367007032037, 0.00017948813911061734, 0.001517593627795577, 0.9999988079071045, -0.0003378468391019851], [-0.019620895385742188, -0.01188772451132536, 1.5208872556686401, 0.9999999403953552, 9.780155960470438e-05, -0.00028313513030298054, -9.742547263158485e-05, 0.9999991059303284, 0.0013391639804467559], [-0.02049250714480877, -0.014170834794640541, 1.5334322452545166, 0.9999996423721313, -0.000806970230769366, -0.0003485118504613638, 0.0008075422956608236, 0.9999983310699463, 0.0016414019046351314], [-0.01940331421792507, -0.01480107195675373, 1.5464098453521729, 0.9999999403953552, 0.00025884711067192256, -0.0001198861573357135, -0.00025870834360830486, 0.9999992847442627, 0.0011494177160784602], [-0.02174391783773899, -0.01701892912387848, 1.5579763650894165, 0.9999997615814209, -0.0006587872048839927, -4.885522503172979e-05, 0.0006588586838915944, 0.9999986290931702, 0.0015296117635443807], [-0.022475196048617363, -0.015560129657387733, 1.5704596042633057, 0.9999995231628418, -0.000990303116850555, -6.466326885856688e-05, 0.0009903698228299618, 0.9999989867210388, 0.0010475394083186984], [-0.019475413486361504, -0.010610694997012615, 1.5847400426864624, 0.9999997019767761, -7.788289076415822e-05, -0.0006807635072618723, 7.703630399191752e-05, 0.9999991655349731, -0.0012373138451948762], [-0.022390222176909447, -0.00821391399949789, 1.598433494567871, 0.9999991655349731, -0.0012492685345932841, -0.0004874816513620317, 0.0012478821445256472, 0.9999951124191284, -0.0028429694939404726]]
Cosmos3_Official/sanity_check/clips/left_turn.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e9447b9874b61ffd6fc48bd798ea09a564b57b15af24a65f9fde0625bf403ad
3
+ size 487707
Cosmos3_Official/sanity_check/clips/left_turn.png ADDED

Git LFS Details

  • SHA256: 918936305c10943ea31a560eefc01e3cf33abce618558a6277d78096f8c3a2e2
  • Pointer size: 131 Bytes
  • Size of remote file: 293 kB
Cosmos3_Official/sanity_check/clips/right_turn.json ADDED
@@ -0,0 +1 @@
 
 
1
+ [[0.06428173184394836, -0.01344044879078865, 1.1796869039535522, 0.9998218417167664, -0.001662788214161992, -0.01880280300974846, 0.0016629357123747468, 0.9999986290931702, -7.789294613758102e-06], [0.0708073303103447, -0.01387939602136612, 1.1444509029388428, 0.9997755885124207, -0.00182456080801785, -0.021104663610458374, 0.0018231839640066028, 0.9999983310699463, -8.447083382634446e-05], [0.07186532020568848, -0.02077260985970497, 1.111383080482483, 0.9997243285179138, -0.004042795393615961, -0.023125503212213516, 0.00410115160048008, 0.9999884963035583, 0.0024765681009739637], [0.08570311963558197, -0.028176339343190193, 1.0772625207901, 0.9996545910835266, -0.001330096973106265, -0.026251113042235374, 0.00149510835763067, 0.9999792575836182, 0.006267234217375517], [0.09311949461698532, -0.028649527579545975, 1.048304557800293, 0.9995658993721008, -0.003056612564250827, -0.029303746297955513, 0.003266467247158289, 0.9999693632125854, 0.007116164546459913], [0.0972619578242302, -0.015444920398294926, 1.0345091819763184, 0.9994394779205322, -0.006277831736952066, -0.03288262337446213, 0.00637428741902113, 0.9999756813049316, 0.0028293635696172714], [0.10777254402637482, 0.0011091219494119287, 1.0335551500320435, 0.9993128180503845, -0.00609141169115901, -0.0365610271692276, 0.00597408739849925, 0.9999765753746033, -0.0033173980191349983], [0.12668994069099426, 0.01585014909505844, 1.0308187007904053, 0.9992505311965942, 0.0001335519045824185, -0.03870951756834984, -0.00044060387881472707, 0.9999685287475586, -0.007923833094537258], [0.13728173077106476, 0.022375140339136124, 1.0262861251831055, 0.9991694092750549, 0.0016913036815822124, -0.04071550816297531, -0.0020507064182311296, 0.9999593496322632, -0.008787022903561592], [0.13784025609493256, 0.01576949842274189, 1.0158287286758423, 0.9990800023078918, -0.000994963920675218, -0.04287275671958923, 0.0007960820221342146, 0.999988853931427, -0.0046556256711483], [0.1329236775636673, 0.007408448960632086, 1.0053642988204956, 0.9990209937095642, -0.004637646954506636, -0.04399304464459419, 0.004654454533010721, 0.9999890923500061, 0.00027957113343290985], [0.13683772087097168, 0.003937315195798874, 0.9988194704055786, 0.9989803433418274, -0.003900561947375536, -0.04498004913330078, 0.003988818731158972, 0.9999903440475464, 0.0018726011039689183], [0.143858402967453, 0.0038303956389427185, 0.9970788359642029, 0.9989731907844543, -0.0011437665671110153, -0.0452912338078022, 0.0011670003877952695, 0.9999992847442627, 0.0004865264636464417], [0.14817944169044495, 0.006886846851557493, 0.9978448748588562, 0.9990001320838928, 0.0017023399705067277, -0.044672708958387375, -0.001808397239074111, 0.9999955892562866, -0.002333765383809805], [0.1449970006942749, 0.010555545799434185, 1.0001455545425415, 0.9990154504776001, 0.0006855124374851584, -0.04435933008790016, -0.0008636259008198977, 0.9999915957450867, -0.003996245097368956], [0.1412569284439087, 0.009555148892104626, 0.9995867609977722, 0.9990259408950806, -0.0003426076436880976, -0.04412596672773361, 0.00026373143191449344, 0.9999983906745911, -0.0017933602211996913], [0.13858062028884888, 0.006656532175838947, 0.9999627470970154, 0.9990609884262085, -0.00022423642803914845, -0.043323736637830734, 0.00023614348901901394, 0.9999999403953552, 0.0002697338059078902], [0.1341179609298706, 0.006107007618993521, 1.0050945281982422, 0.9991262555122375, -0.000491695071104914, -0.04179053381085396, 0.0005184606998227537, 0.9999996423721313, 0.0006296391366049647], [0.13334356248378754, 0.00918963085860014, 1.0156015157699585, 0.9991711974143982, 0.0006893932586535811, -0.04069800302386284, -0.000735333189368248, 0.9999991059303284, -0.0011138806585222483], [0.1311793327331543, 0.013146679848432541, 1.028122067451477, 0.999187171459198, 0.0005351232830435038, -0.04030850902199745, -0.0006380974664352834, 0.9999966025352478, -0.002541846130043268], [0.13005666434764862, 0.016828393563628197, 1.0414679050445557, 0.9991933107376099, 0.00026292065740562975, -0.04015858843922615, -0.00040355397504754364, 0.9999937415122986, -0.003493916243314743], [0.13809235394001007, 0.020500190556049347, 1.056359887123108, 0.999193012714386, 0.004943854175508022, -0.03985914960503578, -0.005099849309772253, 0.9999797940254211, -0.0038129359018057585], [0.1367875188589096, 0.018290849402546883, 1.0681942701339722, 0.9992281198501587, 0.004925130866467953, -0.038974177092313766, -0.005029742605984211, 0.9999840259552002, -0.002586525399237871], [0.12945027649402618, 0.013845006935298443, 1.0802075862884521, 0.9992706179618835, 0.002628871239721775, -0.03809652104973793, -0.0026813861913979053, 0.9999954700469971, -0.0013274067314341664], [0.1239141970872879, 0.01356798131018877, 1.0939782857894897, 0.9993101954460144, 0.001823364058509469, -0.03709206357598305, -0.001857970841228962, 0.9999978542327881, -0.000898569414857775], [0.1163007989525795, 0.012174747884273529, 1.1081146001815796, 0.9993845224380493, 0.0006463717436417937, -0.03507345914840698, -0.0006630286807194352, 0.9999997019767761, -0.0004632944182958454], [0.1192600280046463, 0.013875624164938927, 1.1260050535202026, 0.9994164109230042, 0.004246050026267767, -0.03389119356870651, -0.004292260389775038, 0.9999899864196777, -0.0012908416101709008], [0.11689624935388565, 0.014381012879312038, 1.1442922353744507, 0.999434232711792, 0.003683653427287936, -0.03343082591891289, -0.003750490490347147, 0.9999910593032837, -0.0019367244094610214], [0.10889468342065811, 0.012167747132480145, 1.1600532531738281, 0.9994909167289734, 0.0021961689926683903, -0.03182913735508919, -0.0022113199811428785, 0.9999974370002747, -0.0004408174136187881], [0.1002313643693924, 0.009591478854417801, 1.1774803400039673, 0.999565064907074, 0.001767881098203361, -0.029435887932777405, -0.0017579072155058384, 0.9999983906745911, 0.0003647102857939899], [0.08874206990003586, 0.007391973864287138, 1.1954352855682373, 0.9996536374092102, 0.0004383849154692143, -0.02631545253098011, -0.00039996084524318576, 0.9999988675117493, 0.0014653763500973582], [0.07940926402807236, 0.0005518477410078049, 1.2119662761688232, 0.9997124671936035, -0.00040593056473881006, -0.023974036797881126, 0.0004894974990747869, 0.9999938011169434, 0.003479957114905119], [0.07653050869703293, -0.0005316859460435808, 1.2313836812973022, 0.9997346997261047, 0.00010071826545754448, -0.023029271513223648, -1.8380736946710385e-05, 0.9999935030937195, 0.003575520124286413], [0.0746392235159874, 0.0024314720649272203, 1.2524877786636353, 0.9997562766075134, 0.000398283067625016, -0.022073697298765182, -0.00033359212102368474, 0.9999956488609314, 0.0029342803172767162], [0.07056698948144913, 0.009095343761146069, 1.2769392728805542, 0.99977046251297, -0.0008959496044553816, -0.021405044943094254, 0.000896469340659678, 0.9999996423721313, 1.46884976857109e-05], [0.06670074909925461, 0.013615033589303493, 1.3006722927093506, 0.9997787475585938, -0.0018081909511238337, -0.020954769104719162, 0.0017727820668369532, 0.9999969601631165, -0.0017082252306863666], [0.06183929368853569, 0.014345838688313961, 1.3212947845458984, 0.999812126159668, -0.0014492886839434505, -0.019330495968461037, 0.001423212350346148, 0.9999980330467224, -0.0013626733561977744], [0.06037158891558647, 0.016687117516994476, 1.3416959047317505, 0.9998582005500793, 0.0018795881187543273, -0.016735320910811424, -0.0018857329851016402, 0.9999982118606567, -0.00035142182605341077], [0.05422782897949219, 0.017032375559210777, 1.3629621267318726, 0.9999083876609802, 0.004392602480947971, -0.01280317921191454, -0.00440042931586504, 0.9999901652336121, -0.0005831940798088908], [0.04409937933087349, 0.015667498111724854, 1.3847357034683228, 0.9999450445175171, 0.0032468826975673437, -0.009969502687454224, -0.0032582178246229887, 0.9999940395355225, -0.0011209406657144427], [0.03697199746966362, 0.011728934943675995, 1.4040398597717285, 0.9999646544456482, 0.002556494204327464, -0.008008098229765892, -0.002556426217779517, 0.9999967813491821, 1.869299194368068e-05], [0.025021791458129883, 0.006580773275345564, 1.4209932088851929, 0.9999851584434509, 0.0004976680502295494, -0.005423576571047306, -0.0004854888829868287, 0.9999973177909851, 0.0022466774098575115], [0.016350746154785156, 0.005982164293527603, 1.441105842590332, 0.9999960064888, -8.40354769024998e-05, -0.002836870728060603, 9.111492545343935e-05, 0.9999969601631165, 0.0024952648673206568], [0.017935609444975853, 0.007957994006574154, 1.462624430656433, 0.9999952912330627, 0.002638124395161867, -0.0015343223931267858, -0.0026359071489423513, 0.9999954104423523, 0.001445359317585826], [0.01556024607270956, 0.011401829309761524, 1.484604001045227, 0.9999973177909851, 0.002174753462895751, -0.0007982167880982161, -0.0021746065467596054, 0.999997615814209, 0.0001854294678196311], [0.010105276480317116, 0.015752198174595833, 1.5071371793746948, 0.9999999403953552, 0.00023261811293195933, -2.0510055037448183e-05, -0.00023263973707798868, 0.9999994039535522, -0.001126601709984243], [0.008080101571977139, 0.018523938953876495, 1.528230905532837, 0.9999998807907104, -0.00033307261765003204, 0.00030374436755664647, 0.0003335312649141997, 0.9999987483024597, -0.001508521381765604], [0.009341812692582607, 0.017259372398257256, 1.548325538635254, 0.9999996423721313, 0.0007280496647581458, 0.0005516272503882647, -0.0007273707306012511, 0.9999989867210388, -0.0012333689955994487], [0.00849852617830038, 0.01620711386203766, 1.5675756931304932, 0.9999991059303284, 0.0008707558154128492, 0.0010394633281975985, -0.0008703856728971004, 0.9999995827674866, -0.0003560237237252295], [0.007715750019997358, 0.012820570729672909, 1.5854971408843994, 0.9999977946281433, 0.0012725971173495054, 0.0016754516400396824, -0.001273736939765513, 0.9999989867210388, 0.0006784762372262776], [0.0074350833892822266, 0.01290381234139204, 1.6052364110946655, 0.9999964833259583, 0.0015975737478584051, 0.0021171204280108213, -0.0015975342830643058, 0.9999986886978149, -2.058264726656489e-05], [0.006009865086525679, 0.014526615850627422, 1.6250066757202148, 0.9999972581863403, 0.0007307171472348273, 0.0022327895276248455, -0.0007300052093341947, 0.9999997615814209, -0.0003187139518558979], [0.0062313079833984375, 0.01604718714952469, 1.6451014280319214, 0.9999982118606567, 0.00019013966084457934, 0.0018760847160592675, -0.0001889495615614578, 0.9999997615814209, -0.0006347883609123528], [0.006213283631950617, 0.01583576202392578, 1.6639292240142822, 0.9999988675117493, -0.0006865289760753512, 0.0013794092228636146, 0.0006873150705359876, 0.9999996423721313, -0.0005705059156753123], [0.008117437362670898, 0.015481911599636078, 1.6828908920288086, 0.9999995231628418, -0.000548621523194015, 0.000767040066421032, 0.0005489868926815689, 0.9999997019767761, -0.0004727826453745365], [0.010020303539931774, 0.014735265634953976, 1.701136827468872, 0.9999996423721313, 0.0004124369297642261, 0.0007225513691082597, -0.0004124643455725163, 0.9999998807907104, 3.6546589399222285e-05], [0.010531425476074219, 0.016125038266181946, 1.7185896635055542, 0.9999994039535522, 0.000672351976390928, 0.000857794308103621, -0.000671879795845598, 0.9999996423721313, -0.0005511959898285568], [0.012113714590668678, 0.014520903117954731, 1.7339824438095093, 0.999997615814209, 0.0018770754104480147, 0.001139253843575716, -0.001876089838333428, 0.9999978542327881, -0.0008662664331495762], [0.010895776562392712, 0.012311701662838459, 1.7472639083862305, 0.9999974966049194, 0.0016016480512917042, 0.001536266296170652, -0.0016010914696380496, 0.9999986290931702, -0.0003632627194747329], [0.009506607428193092, 0.01019567996263504, 1.7582639455795288, 0.9999973177909851, 0.0013544050743803382, 0.0019140392541885376, -0.0013549006544053555, 0.9999990463256836, 0.0002587111957836896]]
Cosmos3_Official/sanity_check/clips/right_turn.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e82146dfca888dd831e9a9893f59ba3dc5c348982c11fd4422cc7b5a3829b80e
3
+ size 8493365
Cosmos3_Official/sanity_check/clips/right_turn.png ADDED

Git LFS Details

  • SHA256: c8f12e81158192f456149f9ec407f832fed732f56e1bb7daac0eb02225c88ab1
  • Pointer size: 131 Bytes
  • Size of remote file: 518 kB
Cosmos3_Official/sanity_check/clips/straight.json ADDED
@@ -0,0 +1 @@
 
 
1
+ [[0.0003749974712263793, -0.0005379821523092687, 0.13496705889701843, 1.0, -5.7715795264812186e-05, -0.00018577351875137538, 5.7750297855818644e-05, 1.0, 0.00018572210683487356], [-0.0010018812026828527, 0.0008064350113272667, 0.12753836810588837, 0.9999998807907104, -0.00041408545803278685, 4.300483851693571e-06, 0.0004140867094974965, 0.9999998211860657, -0.0003003705060109496], [-0.0013529842253774405, -0.00014935535728000104, 0.11837495863437653, 0.9999998807907104, -0.000427804421633482, 0.00014945471775718033, 0.00042778803617693484, 0.9999998807907104, 0.0001097458298318088], [-0.0006829601479694247, 0.00040830904617905617, 0.11115144193172455, 0.9999999403953552, -0.0002782203664537519, 1.1304600775474682e-05, 0.00027822109404951334, 0.9999999403953552, -5.654238339047879e-05], [5.36500992893707e-05, -0.0005208752700127661, 0.10356322675943375, 1.0, -0.00010200122778769583, -9.626871906220913e-05, 0.00010202638804912567, 1.0, 0.000260538246948272], [-0.00025540072238072753, 6.152681453386322e-05, 0.0976167693734169, 1.0, -5.7615088735474274e-05, 3.483433465589769e-05, 5.761200009146705e-05, 1.0, 8.878036169335246e-05], [-1.805713509384077e-05, -0.00032521772664040327, 0.09152491390705109, 1.0, 9.716866043163463e-05, 7.241711136884987e-05, -9.718401270220056e-05, 1.0, 0.0002088655310217291], [0.00043956414447166026, -1.0455865776748396e-05, 0.0859156921505928, 1.0, 0.00018152860866393894, -2.9805893063894473e-05, -0.00018152718257624656, 1.0, 4.529888246906921e-05], [4.2050229239976034e-05, -0.0001402105117449537, 0.08018061518669128, 0.9999999403953552, -4.402433205541456e-06, -4.1142862755805254e-05, 4.4044463720638305e-06, 1.0, 5.302567660692148e-05], [-0.00019486637029331177, 0.00020955497166141868, 0.0748145654797554, 1.0, -4.8617981519782916e-05, 4.54617511422839e-05, 4.862139394390397e-05, 0.9999999403953552, -6.990842666709796e-05], [-0.00038617648533545434, 0.0001979521766770631, 0.06932048499584198, 1.0, -0.000106204861367587, 3.847476182272658e-05, 0.00010620537068461999, 1.0, -2.044011853286065e-05], [0.00020653617684729397, -0.00011698850721586496, 0.06347227841615677, 1.0, 5.4290641855914146e-05, -4.6723518607905135e-05, -5.428740769275464e-05, 1.0, 6.712949107168242e-05], [0.00037170498399063945, 0.00030605707434006035, 0.05791519582271576, 0.9999999403953552, 0.00014573783846572042, -1.9311737560201436e-05, -0.00014573980297427624, 1.0, -9.756500367075205e-05], [7.741075387457386e-05, -5.0812013796530664e-05, 0.05284654721617699, 1.0, 0.00016622990369796753, 6.213207234395668e-05, -0.00016623591363895684, 1.0, 9.87884632195346e-05], [0.0004072618030477315, -0.0003974490100517869, 0.048309534788131714, 1.0, 0.00017489976016804576, 3.3849512419692473e-06, -0.00017490056052338332, 1.0, 0.00024087794008664787], [0.000402036210289225, -0.0003962306655012071, 0.04421919211745262, 0.9999999403953552, 0.00011715892469510436, -3.25004912156146e-05, -0.00011715429718606174, 0.9999999403953552, 0.00014110223855823278], [8.110779890557751e-05, -0.00022019159223418683, 0.04046230390667915, 1.0, 6.183895311551169e-05, 7.893193469499238e-06, -6.183924415381625e-05, 1.0, 4.157312650931999e-05], [-7.326265767915174e-05, -0.0016705733723938465, 0.03519240766763687, 1.0, 2.455623325658962e-05, 2.9873466701246798e-05, -2.4573981136200018e-05, 0.9999998211860657, 0.0005955908563919365], [8.444086415693164e-05, -0.0036612115800380707, 0.02792823314666748, 1.0, 9.410420898348093e-05, 3.900313822668977e-05, -9.415418026037514e-05, 0.9999991655349731, 0.0012836416717618704], [0.0002223191986558959, -0.0033750173170119524, 0.021390670910477638, 1.0, 9.660910291131586e-05, 1.069565200850775e-06, -9.661034710006788e-05, 0.9999994039535522, 0.0011613242095336318], [0.00013853880227543414, -0.0025470033288002014, 0.015865374356508255, 1.0, 9.445503383176401e-05, 4.6355371523532085e-06, -9.445901378057897e-05, 0.9999996423721313, 0.0008723016362637281], [5.257221346255392e-05, -0.00106524839065969, 0.012086356058716774, 0.9999999403953552, 4.546548007056117e-05, 2.4871240384527482e-05, -4.547354546957649e-05, 0.9999998807907104, 0.00032432968146167696], [0.00011522047134349123, 0.00022797791461925954, 0.009538632817566395, 1.0, 4.3167845433345065e-05, -4.086394255864434e-06, -4.316826016292907e-05, 1.0, -0.00010186809959122911], [0.00025886695948429406, 0.0012851032661274076, 0.007695794105529785, 1.0, 0.0001136401406256482, -2.5375285986228846e-05, -0.00011365248064976186, 0.9999998807907104, -0.0004868402029387653], [0.0002551441139075905, 0.0015835831873118877, 0.0063164415769279, 1.0, 3.454944453551434e-05, -1.1123309377580881e-05, -3.455561090959236e-05, 0.9999998807907104, -0.0005545768653973937], [0.00015516480198130012, 0.0014543593861162663, 0.0045539080165326595, 1.0, 9.13720068638213e-05, -1.599336974322796e-05, -9.138065070146695e-05, 0.9999998211860657, -0.0005415074992924929], [5.4484818974742666e-05, 0.0009438162669539452, 0.0022683441638946533, 1.0, 2.122522801073501e-06, -1.808189153962303e-05, -2.12882946470927e-06, 0.9999999403953552, -0.00034777913242578506], [0.00021403397840913385, 0.0002859438245650381, -0.0006247401470318437, 1.0, 5.3836614824831486e-05, -1.7517548258183524e-05, -5.3838906751479954e-05, 1.0, -0.00013104583194945008], [-0.00014614220708608627, 0.0011896465439349413, -0.002114975592121482, 1.0, -1.2343564776529092e-05, 8.948704248723516e-07, 1.2343983144091908e-05, 0.9999998807907104, -0.0004534746694844216], [0.0002151566295651719, 0.001469882088713348, -0.0027876736130565405, 1.0, 5.067996244179085e-05, -2.1608833776554093e-05, -5.0690763600869104e-05, 0.9999999403953552, -0.0005000085802748799], [2.5723373255459592e-05, 0.00031798871350474656, -0.002850437304005027, 1.0, 2.121608304150868e-06, -6.82223173953389e-07, -2.1216253571765264e-06, 1.0, -1.959289875230752e-05], [-4.4359290768625215e-05, -0.0008310614502988756, -0.001657122396863997, 1.0, -2.896418664022349e-06, -3.42825660482049e-06, 2.8972865493415156e-06, 0.9999999403953552, 0.0002542819711379707], [8.781204815022647e-05, -0.0008050638134591281, -0.0005658388254232705, 1.0, -1.3414501154329628e-05, -1.7667922293185256e-05, 1.3418473827186972e-05, 1.0, 0.0002255188301205635], [-7.151799218263477e-05, 0.0001607420708751306, 0.00012150406837463379, 1.0, -3.5415574529906735e-05, -1.5872312815190526e-06, 3.541549085639417e-05, 1.0, -5.6524175306549296e-05], [0.00013427514932118356, 0.0004580688546411693, 0.00033441782579757273, 0.9999999403953552, 5.618364957626909e-05, -4.655546035792213e-06, -5.6184333516284823e-05, 1.0, -0.000155854198965244], [5.905965008423664e-05, -0.00022786382760386914, -0.00017058849334716797, 1.0, 3.0495824830722995e-05, 2.2399674435291672e-06, -3.049604310945142e-05, 0.9999999403953552, 7.947734411573038e-05], [0.00010132860916201025, -0.00035520546953193843, -0.000266343355178833, 1.0, 5.135594983585179e-05, 3.1304507501772605e-06, -5.1356328185647726e-05, 1.0, 0.0001240223937202245], [3.600115087465383e-05, -1.544260885566473e-05, -1.2552738553495146e-05, 1.0, 1.6785481420811266e-05, 2.862017112192916e-08, -1.678546868788544e-05, 1.0, 5.875272563571343e-06], [-7.623354122188175e-06, 3.652414306998253e-06, 2.8967858725081896e-06, 1.0, -3.4812956073437817e-06, 4.80727031515471e-08, 3.4813217553164577e-06, 1.0000001192092896, -1.3732860679738224e-06], [-9.825686220210628e-07, -0.00012462527956813574, -9.221434447681531e-05, 1.0, 1.131047838498489e-06, 1.1756094409065554e-06, -1.1310816034892923e-06, 1.0, 4.2951240175170824e-05], [-3.379056943231262e-05, -0.0004683539445977658, -0.00034568310366012156, 1.0, -9.411370228917804e-06, 4.667836947191972e-06, 9.41062444326235e-06, 0.9999999403953552, 0.00016096926992759109], [2.1388115783338435e-05, -0.0003205245011486113, -0.00023785830126143992, 1.0, 1.4013070540386252e-05, 3.0098995011940133e-06, -1.4013349755259696e-05, 1.0, 0.00011083872232120484], [-4.441589044290595e-05, 2.5419483790756203e-05, 2.0116567611694336e-05, 1.0, -2.0703932023025118e-05, -3.141594007161075e-08, 2.0703966583823785e-05, 1.0, -9.440250323677901e-06], [3.957306091706414e-07, -0.00013509501877706498, -0.00010010004189098254, 1.0, 1.9242240796302212e-06, 1.2882481996712158e-06, -1.924267508002231e-06, 0.9999999403953552, 4.6583030780311674e-05], [1.776780095497088e-06, -0.00024462060537189245, -0.00018104910850524902, 1.0, 4.028255716548301e-06, 2.3705056264589075e-06, -4.028467628813814e-06, 1.0, 8.436840289505199e-05], [-7.307539817702491e-06, 9.270908776670694e-06, 7.081031981215347e-06, 1.0, -3.573086132746539e-06, -1.2865514520399302e-07, 3.573145022528479e-06, 1.0, -3.3107287435996113e-06], [7.912769797258079e-05, -0.00010916883911704645, -8.352399163413793e-05, 1.0, 3.813870353042148e-05, 9.861548733169911e-07, -3.8138710806379095e-05, 1.0, 3.8858215702930465e-05], [2.5337956685689278e-05, -9.027561463881284e-05, -6.759166717529297e-05, 1.0, 1.2896600310341455e-05, 8.220646918744023e-07, -1.289666943193879e-05, 0.9999999403953552, 3.151399505441077e-05], [-2.985616993100848e-05, -5.826040796819143e-05, -4.216432716930285e-05, 1.0, -1.2983856322534848e-05, 6.693113618894131e-07, 1.2983874512428883e-05, 1.0, 1.962986061698757e-05], [-4.44956858700607e-05, -0.00013943295925855637, -0.0001018702969304286, 1.0, -1.8727647329797037e-05, 1.4579590015273425e-06, 1.872755638032686e-05, 0.9999999403953552, 4.739124051411636e-05], [3.960728281526826e-05, -4.071593502885662e-05, -3.1381845474243164e-05, 1.0, 1.9009174138773233e-05, 4.3314244635439536e-07, -1.9009155948879197e-05, 0.9999999403953552, 1.4651081073679961e-05], [-5.0093356549041346e-05, -9.111170948017389e-05, -6.582141213584691e-05, 1.0, -2.2050226107239723e-05, 9.261316336051095e-07, 2.205022974521853e-05, 1.0, 3.064173870370723e-05], [3.893895700457506e-05, -7.516178447986022e-05, -5.680918911821209e-05, 1.0, 1.888599399535451e-05, 5.722906166738539e-07, -1.888600309030153e-05, 1.0, 2.6508054361329414e-05], [-1.782339677447453e-05, -9.547197259962559e-05, -7.000565528869629e-05, 1.0, -6.873393431305885e-06, 1.0491916100363596e-06, 6.8734207161469385e-06, 1.0, 3.264693441451527e-05], [4.048832488479093e-05, -6.499129085568711e-05, -4.956722477800213e-05, 1.0, 1.941159280249849e-05, 4.27788506840443e-07, -1.941162918228656e-05, 0.9999999403953552, 2.3024271285976283e-05], [6.584521997865522e-06, -4.797549991053529e-05, -3.556609226507135e-05, 1.0, 3.6830394947173772e-06, 4.5907626144980895e-07, -3.6830483622907195e-06, 0.9999999403953552, 1.6642527043586597e-05], [9.117991794482805e-06, -0.00010324765753466636, -7.676482346141711e-05, 1.0, 5.6132753343263175e-06, 1.0156689995710622e-06, -5.6133035286620725e-06, 0.9999999403953552, 3.573891081032343e-05], [3.0091518055996858e-05, -0.00010045522503787652, -7.531642768299207e-05, 1.0, 1.526633968751412e-05, 9.394772746418312e-07, -1.5266363334376365e-05, 1.0, 3.5098270018352196e-05], [2.530672099965159e-05, -6.644219683948904e-05, -5.005002094549127e-05, 1.0, 1.2470409274101257e-05, 5.171923476154916e-07, -1.2470397450670134e-05, 1.0, 2.3292759578907862e-05], [-1.781616811058484e-05, -7.291878864634782e-05, -5.3590538300340995e-05, 1.0, -7.094255124684423e-06, 8.832519142742967e-07, 7.0942660386208445e-06, 0.9999999403953552, 2.487359961378388e-05]]
Cosmos3_Official/sanity_check/clips/straight.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78f753b0a19ba1770e46cc26cfd3c8e525ff0a9c3194a92ae230c44c5cbd9fe1
3
+ size 5705662
Cosmos3_Official/sanity_check/clips/straight.png ADDED

Git LFS Details

  • SHA256: 153a2fa811b0c704a80c2159985040571ebd657c7778c68b5d151d4d05ccb18b
  • Pointer size: 131 Bytes
  • Size of remote file: 502 kB
Cosmos3_Official/sanity_check/sanity_check.py ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Sanity check of the Cosmos3-Nano WAM (av domain) ONNX bundle on three of NVIDIA's own driving clips.
3
+
4
+ The model plans from the first frame of each clip (60 camera poses, 10 Hz, 6 s); the 6 s heading change is
5
+ compared with the recorded one (clips/*.json, same action format). A correct bundle turns the right way on
6
+ both turns and stays near 0 on the straight clip, for every seed. Writes <out>/<clip>.png with the plans
7
+ (orange) and the recorded path (white) drawn on the frame (approximate fisheye lens, ground at 1.4 m).
8
+
9
+ pip install "onnxruntime-gpu[cuda,cudnn]" numpy pillow
10
+ python sanity_check.py --bundle .. # the Cosmos3_Official folder
11
+
12
+ Expected (RTX PRO 6000, seeds 1-3), 6 s heading [deg], left +:
13
+ straight GT -0.0 plans +3 +6 +0
14
+ left_turn GT +83.6 plans +76 +81 +79
15
+ right_turn GT -74.5 plans -93 -83 -96
16
+ """
17
+ import argparse
18
+ import json
19
+ import os
20
+
21
+ import numpy as np
22
+ from PIL import Image, ImageDraw, ImageOps
23
+
24
+ HERE = os.path.dirname(os.path.abspath(__file__))
25
+ CLIPS = ("straight", "left_turn", "right_turn")
26
+
27
+
28
+ def session(path):
29
+ import onnxruntime as ort
30
+
31
+ ort.set_default_logger_severity(3)
32
+ if hasattr(ort, "preload_dlls"): # CUDA/cuDNN from the nvidia-* wheels (onnxruntime-gpu[cuda,cudnn]) or torch
33
+ ort.preload_dlls()
34
+ s = ort.InferenceSession(path, providers=[("CUDAExecutionProvider", {"arena_extend_strategy": "kSameAsRequested"}), "CPUExecutionProvider"])
35
+ if "CUDAExecutionProvider" not in s.get_providers():
36
+ print(f"warning: {os.path.basename(path)} runs on CPU (CUDA/cuDNN not found); this takes hours", flush=True)
37
+ return s
38
+
39
+
40
+ def canvas(png, wh):
41
+ """First frame -> uint8 (1, 3, 1, H, W): centre crop + Lanczos to the canvas."""
42
+ im = ImageOps.fit(Image.open(png).convert("RGB"), wh, method=Image.Resampling.LANCZOS)
43
+ return np.ascontiguousarray(np.asarray(im).transpose(2, 0, 1)[None, :, None])
44
+
45
+
46
+ def sample(denoiser, meta, latent, seed):
47
+ """UniPC (order 2, bh2, x0-prediction) over the joint [vision | action] state -> av actions (chunk, 9)."""
48
+ C, T, H, W = meta["layout"]["latent_shape"][-4:]
49
+ cond = np.asarray(meta["layout"]["condition_frames"], dtype=bool)
50
+ chunk, raw, dim = meta["chunk"], meta["arch"]["raw_action_dim"], meta["arch"]["action_dim"]
51
+ rng = np.random.default_rng(seed)
52
+ xv = rng.standard_normal((1, C, T, H, W)).astype(np.float32)
53
+ xa = np.zeros((1, chunk, dim), dtype=np.float32)
54
+ xa[..., :raw] = rng.standard_normal((1, chunk, raw))
55
+ if meta.get("action_pad_noise") == "gaussian":
56
+ xa[..., raw:] = rng.standard_normal((1, chunk, dim - raw))
57
+ xv[:, :, cond] = latent[:, :, : int(cond.sum())]
58
+ x, outs, last = (xv, xa), [], None
59
+ for k, d in enumerate(meta["unipc"]):
60
+ t = np.array([meta["model_t"][k]], dtype=np.float32)
61
+ v = denoiser.run(None, {"x_vision": x[0].astype(np.float32), "x_action": x[1].astype(np.float32), "t": t})
62
+ x0 = tuple(xi - d["sigma"] * vi for xi, vi in zip(x, v))
63
+ c = d["corrector"]
64
+ if c is not None:
65
+ m0 = outs[-1]
66
+ xt = tuple(c["x_coef"] * ls + c["m0_coef"] * m for ls, m in zip(last, m0))
67
+ if c["order"] == 2:
68
+ xt = tuple(a + c["d1s_coef"] * (m2 - m) / c["rk"] for a, m2, m in zip(xt, outs[-2], m0))
69
+ x = tuple(a + c["d1t_coef"] * (b - m) for a, b, m in zip(xt, x0, m0))
70
+ outs.append(x0)
71
+ last = x
72
+ p = d["predictor"]
73
+ xt = tuple(p["x_coef"] * a + p["m0_coef"] * b for a, b in zip(x, x0))
74
+ if p["order"] == 2:
75
+ xt = tuple(a + p["d1s_coef"] * (m2 - b) / p["rk"] for a, m2, b in zip(xt, outs[-2], x0))
76
+ x = xt
77
+ return x[1][0, :, :raw]
78
+
79
+
80
+ def poses(actions):
81
+ """Framewise camera motions (N, 9) [t_xyz | rot6d, column-based] -> camera poses (N+1, 4, 4).
82
+ Camera frame: x right, y down, z forward."""
83
+ a = np.asarray(actions, dtype=np.float64)
84
+ c0 = a[:, 3:6] / np.linalg.norm(a[:, 3:6], axis=1, keepdims=True)
85
+ c1 = a[:, 6:9] - (c0 * a[:, 6:9]).sum(1, keepdims=True) * c0
86
+ c1 /= np.linalg.norm(c1, axis=1, keepdims=True)
87
+ R = np.stack([c0, c1, np.cross(c0, c1)], axis=-1)
88
+ out = [np.eye(4)]
89
+ for r, t in zip(R, a[:, :3]):
90
+ d = np.eye(4)
91
+ d[:3, :3], d[:3, 3] = r, t
92
+ out.append(out[-1] @ d)
93
+ return np.stack(out)
94
+
95
+
96
+ def heading(P):
97
+ """6 s heading change [deg], left +."""
98
+ f = P[-1, :3, 2]
99
+ return float(np.degrees(np.arctan2(-f[0], f[2])))
100
+
101
+
102
+ def draw(png, paths, out):
103
+ """Paths (camera frame) dropped to the ground (1.4 m) and drawn with an equidistant 120 deg fisheye."""
104
+ im = Image.open(png).convert("RGB")
105
+ w, h = im.size
106
+ F, Hc = (w / 2) / np.radians(60), 1.4
107
+ d = ImageDraw.Draw(im)
108
+ for P, col, wd in paths:
109
+ p = P[:, :3, 3]
110
+ p = p[p[:, 2] > 0.5]
111
+ if len(p) < 2:
112
+ continue
113
+ x, z = p[:, 0], p[:, 2]
114
+ rho = np.hypot(x, Hc)
115
+ r = F * np.arctan2(rho, z)
116
+ d.line(list(zip(w / 2 + r * x / rho, h / 2 + r * Hc / rho)), fill=col, width=wd, joint="curve")
117
+ im.save(out)
118
+
119
+
120
+ def main():
121
+ ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
122
+ ap.add_argument("--bundle", default=os.path.dirname(HERE), help="folder with encoder/denoiser .onnx(.data), meta.json, io_spec.json")
123
+ ap.add_argument("--seeds", type=int, nargs="+", default=[1, 2, 3])
124
+ ap.add_argument("--out", default=os.path.join(HERE, "out"))
125
+ a = ap.parse_args()
126
+ meta = json.load(open(os.path.join(a.bundle, "meta.json")))
127
+ spec = json.load(open(os.path.join(a.bundle, "io_spec.json")))
128
+ enc = session(os.path.join(a.bundle, spec["encoder"]["file"]))
129
+ den = session(os.path.join(a.bundle, spec["denoiser"]["file"]))
130
+ os.makedirs(a.out, exist_ok=True)
131
+ ok = True
132
+ for clip in CLIPS:
133
+ png = os.path.join(HERE, "clips", f"{clip}.png")
134
+ gt = poses(json.load(open(os.path.join(HERE, "clips", f"{clip}.json")))[: meta["chunk"]])
135
+ latent = enc.run(None, {"frames": canvas(png, tuple(spec["encoder"]["canvas_wh"]))})[0]
136
+ plans = [poses(sample(den, meta, latent, s)) for s in a.seeds]
137
+ yaws = [heading(P) for P in plans]
138
+ g = heading(gt)
139
+ good = all(abs(y) < 15 for y in yaws) if abs(g) < 10 else all(np.sign(y) == np.sign(g) and abs(y - g) < 30 for y in yaws)
140
+ ok &= good
141
+ print(f"{clip:11s} GT {g:+6.1f} plans " + " ".join(f"{y:+4.0f}" for y in yaws) + f" {'OK' if good else 'FAIL'}", flush=True)
142
+ draw(png, [(gt, (255, 255, 255), 7)] + [(P, (255, 140, 0), 4) for P in plans], os.path.join(a.out, f"{clip}.png"))
143
+ print("PASS" if ok else "FAIL")
144
+ raise SystemExit(0 if ok else 1)
145
+
146
+
147
+ if __name__ == "__main__":
148
+ main()