RGB + LiDAR comparison. For the RGB-only pipeline with estimated cameras and a mouse-controlled viewer, use RGB-only road reconstruction.
Turn measured driving data into an ego-centered view. PandaSet supplies real camera images, LiDAR and camera poses. NuRec reconstructs the surroundings; an independently rendered Volvo S90 Recharge shows the ego position. Watch the saved example first, then reproduce the scene on a GPU.
How it works
- InputRead measured surroundings
Six RGB cameras + timestamps + 4×4 poses + real LiDAR XYZPandaSet supplies real observations. Align asynchronous exposures before packaging NCore V4.
- ProcessReconstruct and change the viewpoint
456 images + 320k seed Gaussians → USDZ → new-view RGBA static NuRec baseline can smear moving traffic and expose holes in unobserved surfaces.
- OutputPlace an identifiable ego car
Same camera pose → Blender Volvo RGBA → compositeAlign the detailed CC BY Volvo mesh with a measured road plane. It does not supply vehicle control.
1. What enters the reconstruction?
Six real cameras + intrinsics + timestamped poses
+ measured LiDAR XYZ
↓
NCore V4 + colored point seed
↓ NuRec fitting
3D Gaussian appearance / USDZ
↓ chosen camera pose + K
New-view RGB image
↓ optional Harmonizer
Enhanced RGB + Volvo overlay
An RGB frame is uint8[576,1024,3]: one red, green and blue value per pixel. The original 1920×1080 photographs are resized and their camera intrinsics scaled by the same factor. The front camera has approximately:
K = [[1050.674, 0, 517.333],
[ 0, 1050.672, 257.759],
[ 0, 0, 1 ]]
fx/fy are focal lengths in pixels, not millimeters. cx/cy locate the optical center. A 4×4 camera-to-world matrix and a timestamp place each image in the measured world. Camera coordinates are right/down/forward; the display rig uses forward/left/up, in meters.
A LiDAR frame is a pandas table with columns x,y,z,i,t,d: world-space position, intensity, measurement time and sensor identifier. For example, an actual frame-0 point is [-58.4572,-61.2693,2.8810] meters in the dataset world. These are already world coordinates; applying a second sensor-to-world transform would put them in the wrong place. The official projection implementation projects world points through the inverse camera pose and K.
We retain frames 2–77 from all six cameras: 456 images. Each eighth image is reserved by the NuRec validation split. Nineteen different LiDAR frames seed 320,000 colored Gaussians; validation-frame scans are excluded. Sensor exposures are asynchronous, so the adapter interpolates ego poses before estimating rigid camera calibration. Measured maximum residuals are below 1.44 cm and 0.131°. This is an approximation, recorded per camera.
2. What is real, reconstructed or added?
The road, buildings and surrounding traffic come from PandaSet photographs and LiDAR. NuRec optimizes Gaussian appearance and geometry; the elevated and quarter views are newly rendered images, not ordinary video playback. The added cameras use fx=fy=512, giving a 90° horizontal pinhole view.
The white Volvo S90 Recharge is lazercar’s detailed vehicle model, not the original collection vehicle. Blender renders its body, glass, wheels and interior from the same display cameras. A measured local road-plane fit aligns its base; a shadow catcher adds contact shadows. The car layer is then alpha-composited after enhancement. It supplies no Volvo controller, tire dynamics or manufacturer validation. Vehicle layers were rendered on macOS with Blender 4.5.1 / Cycles CPU, while NuRec and Harmonizer ran on the Linux GPU machine.
3. Why can another viewpoint look imperfect?
This preset is a static-scene baseline. Moving road users are not separated into tracked dynamic layers, so they can smear or appear more than once. Newly exposed surfaces can be incomplete. The per-frame non-temporal Harmonizer can alter pixels or flicker; it does not establish ground-truth geometry. Built on NVIDIA Cosmos.
A stationary display mesh follows the recorded ego poses. Wheel rotation, dynamic lighting and depth-based occlusion against other vehicles are not implemented. No Alpamayo inference or closed-loop driving on this real scene is claimed. The separate synthetic-road lab shows the actual Alpamayo input/output experiment.
First time? Get the lab files
Open a terminal on the NVIDIA GPU machine for GPU labs, or on your own computer for CPU-only steps. Press Enter after each line. You can copy a multi-line command block as a whole.
cd "$HOME"
git clone https://github.com/james-joobs/awesome-nvidia-physical-ai.git
cd awesome-nvidia-physical-ai
pwd
This example clones into your home folder. If you already cloned the repo, skip git clone and enter your project folder. In each new terminal, check that pwd ends in awesome-nvidia-physical-ai so commands can find the labs/ files.
Run the lab
1. Inspect the saved result on any computer
Open the comparison video, Volvo quarter view, or NuRec without the car layer. The evidence folder includes matched frames and the measurement receipt.
From a terminal opened in this repository:
python3 labs/pandaset-nurec/check.py
This reads files only; it does not launch a GPU job. With FFmpeg installed, add --decode-video to decode every saved MP4.
2. Download one permitted scene
Read the data/asset rights and attribution first. The original payload says CC BY 4.0 plus PandaSet Dataset Terms; Scale’s Nucleus notice instead says CC BY-SA 4.0. We preserve both notices and apply CC BY-SA 4.0 to our new demo media, alongside the original terms. The data is transported by a pinned unofficial community mirror because original hosting was unavailable. This is not an official NVIDIA dataset or an official mirror.
Use an NVIDIA Linux machine with Docker GPU access. The tested machine has RTX 5090 32 GB and about 32 GB host RAM. Allow at least 15 GB free space; the optional car source adds roughly 3 GB unpacked. Review GPU onboarding if nvidia-smi or Docker cannot see your GPU.
export PANDASET_ROOT="$HOME/physical-ai-labs/pandaset-road"
mkdir -p "$PANDASET_ROOT"
nvidia-smi
docker pull nvcr.io/nvidia/nre/nre-ga:26.04
bash labs/pandaset-nurec/run.sh download
The script reads the ZIP directory, then downloads scene 001’s roughly 416 MiB region, not the whole 44.5 GB archive. It checks each file’s ZIP CRC/size and records SHA-256 hashes. The full archive SHA-256 is not verified by this range download. Keep data/001/LICENSE.txt.
3. Fit the real scene and render three views
Run each line after the previous one finishes:
bash labs/pandaset-nurec/run.sh prepare
bash labs/pandaset-nurec/run.sh train
bash labs/pandaset-nurec/run.sh render
prepare writes calibrated NCore data, a measured-LiDAR seed and ground-plane.json. Pickle reading uses a strict constructor allowlist inside the network-disabled runtime, with only this lab’s output mounted. train runs 6,000 optimization steps. render produces 76 PNGs each under renders/front, renders/ego-elevated and renders/ego-quarter. The pinned 26.04 container selects gsplat explicitly.
For optional enhancement, download the official non-temporal checkpoint at revision 20ca33d4612b1e98e0526b3a7ee604af5b289f58, after reviewing its NVIDIA Open Model License. Point to its containing folder:
export HARMONIZER_WEIGHTS="/absolute/path/to/Harmonizer"
bash labs/pandaset-nurec/run.sh enhance
4. Render the actual car model
Download the Blender archive from the author-provided Google Drive link in the original model page, then extract it. Source size, SHA-256 and attribution are in ego-car.json. Do not put the 1.2 GB archive in Git.
With Blender 4.5 installed, replace these two paths with your extracted files:
export VOLVO_BLEND="/absolute/path/to/Volvo S90.blend"
export VOLVO_TEXTURES="/absolute/path/to/textures"
blender --background --disable-autoexec "$VOLVO_BLEND" \
--python labs/reality-view/render_ego_car.py -- \
--textures "$VOLVO_TEXTURES" --views "$PANDASET_ROOT/ego-views.json" \
--ground-plane "$PANDASET_ROOT/ground-plane.json" \
--output "$PANDASET_ROOT/vehicle-layers"
--disable-autoexec prevents scripts embedded in the downloaded .blend from running. The output contains separate car-only and shadow-catcher PNGs for each display camera. The packager reduces the shadow layer to 22% strength for a readable overlay; lighting is not calibrated to the photographs. The packaging script composites these layers onto matching NuRec frames and writes compact videos with source credits.
To export your completed run, install Pillow and FFmpeg, then run the packager with a Korean-capable font:
python3 labs/pandaset-nurec/package.py --input "$PANDASET_ROOT" \
--output "$PANDASET_ROOT/published" \
--font "/absolute/path/to/NotoSansKR.ttf"
Check the result
The saved run used 6,000 NuRec steps, 456 calibrated images and a 320,000-Gaussian LiDAR seed. NuRec reported 100.80 seconds for training, excluding downloads, conversion and rendering. The USDZ is 110,694,637 bytes. This small baseline is not a quality or runtime benchmark against another reconstruction method.
Check frame counts, calibrated transforms, hashes, video decoding and the recorded scope:
python3 labs/pandaset-nurec/check.py --decode-video
Compare the original camera photograph with the corresponding front render, then compare the two new views before and after enhancement. A visually cleaner lane marking is not necessarily a more faithful one. No ground-truth photograph exists for the elevated camera, so no novel-view accuracy score is invented.
Keep the PandaSet terms and credits with exported results. The Volvo is an added visual reference; this experiment reconstructs measured surroundings and does not validate autonomous vehicle control.
Example run and recording
Source code
index_zip.py
View files on GitHub"""Read only the central directory of the pinned public PandaSet ZIP mirror."""
import argparse,io,json,time,zipfile
from urllib.request import Request,urlopen
REVISION='e2e123aea3b3132c67f4b395ec6120f63e190271'
SIZE=44520528731
URL=f'https://huggingface.co/datasets/georghess/pandaset/resolve/{REVISION}/pandaset.zip?download=true&index={int(time.time())}'
class RemoteZip(io.RawIOBase):
def __init__(self):self.pos=0
def readable(self):return True
def seekable(self):return True
def tell(self):return self.pos
def seek(self,offset,whence=0):
self.pos=offset if whence==0 else self.pos+offset if whence==1 else SIZE+offset
if self.pos<0:raise ValueError('Invalid ZIP offset')
return self.pos
def read(self,n=-1):
n=min(SIZE-self.pos,n if n>=0 else SIZE-self.pos)
if n<=0:return b''
if n>64*1024*1024:raise ValueError('Unexpected large ZIP metadata read')
start=self.pos;end=start+n-1
for attempt in range(5):
try:
with urlopen(Request(URL,headers={'Range':f'bytes={start}-{end}'}),timeout=120) as response:
if response.status!=206 or response.headers.get('Content-Range')!=f'bytes {start}-{end}/{SIZE}':raise ValueError('Server returned a different byte range')
data=response.read(n+1)
if len(data)!=n:raise ValueError('Truncated ZIP metadata')
self.pos+=n;return data
except Exception:
if attempt==4:raise
time.sleep(1+attempt)
if __name__=='__main__':
parser=argparse.ArgumentParser();parser.add_argument('--output',required=True);args=parser.parse_args()
with zipfile.ZipFile(RemoteZip()) as archive:
entries=[{'name':i.filename,'size':i.file_size,'compressed':i.compress_size,'crc32':i.CRC,'offset':i.header_offset,'type':i.compress_type} for i in archive.infolist()]
with open(args.output,'w') as f:json.dump({'revision':REVISION,'archive_size':SIZE,'members':entries},f)
print(f'Indexed {len(entries)} ZIP members without downloading the 44.5 GB archive')
download.py
View files on GitHub"""Fetch one PandaSet scene from a pinned community mirror, with ZIP CRC checks.
The original LICENSE.txt is preserved. Data rights come from that file, not the
mirror's uploader or this repository's code license. No NVIDIA AV data is used.
"""
import argparse
from concurrent.futures import ThreadPoolExecutor
import hashlib
import json
from pathlib import Path, PurePosixPath
import struct
import time
from urllib.request import Request,urlopen
import zlib
parser=argparse.ArgumentParser()
parser.add_argument('--output',type=Path,required=True)
parser.add_argument('--scene',default='001')
parser.add_argument('--inspect',action='store_true',help='Only calibration, terms and three front-camera samples')
parser.add_argument('--index',type=Path,required=True,help='ZIP central-directory index created by index_zip.py')
args=parser.parse_args()
index=json.loads(args.index.read_text());members=[m for m in index['members'] if m['name'].startswith(f'pandaset/{args.scene}/') and not m['name'].endswith('/')]
if not members:raise ValueError('Scene does not exist in the pinned archive')
url=f"https://huggingface.co/datasets/georghess/pandaset/resolve/{index['revision']}/pandaset.zip?download=true&fetch={int(time.time())}"
def fetch_range(start,end):
for retry in range(5):
try:
with urlopen(Request(url,headers={'Range':f'bytes={start}-{end}'}),timeout=120) as response:
if response.status!=206 or not response.headers.get('Content-Range','').startswith(f'bytes {start}-'):raise ValueError('Server returned the wrong byte range')
payload=response.read()
if len(payload)!=end-start+1:raise ValueError('Truncated download')
return payload
except Exception:
if retry==4:raise
time.sleep(1+retry)
def save_member(member,block=None,origin=0):
offset=member['offset']
header=(block[offset-origin:offset-origin+30] if block is not None else fetch_range(offset,offset+29))
fields=struct.unpack('<4s5H3L2H',header)
if fields[0]!=b'PK\x03\x04' or fields[3] != member['type']:raise ValueError('ZIP local header disagrees with index')
start=offset+30+fields[-2]+fields[-1];length=member['compressed']
compressed=block[start-origin:start-origin+length] if block is not None else fetch_range(start,start+length-1)
if member['type']==8:data=zlib.decompress(compressed,-15)
elif member['type']==0:data=compressed
else:raise ValueError('Unsupported compression')
if len(data)!=member['size'] or zlib.crc32(data)!=member['crc32']:raise ValueError('ZIP CRC/size mismatch')
relative=PurePosixPath(member['name']).relative_to('pandaset')
if '..' in relative.parts:raise ValueError('Unsafe member path')
target=args.output/str(relative);target.parent.mkdir(parents=True,exist_ok=True);target.write_bytes(data)
return {'file':str(relative),'bytes':len(data),'sha256':hashlib.sha256(data).hexdigest()}
args.output.mkdir(parents=True,exist_ok=True)
if args.inspect:
selected=[m for m in members if m['name'].endswith('.json') or m['name'].endswith('LICENSE.txt') or any(m['name'].endswith(f'front_camera/{i:02d}.jpg') for i in [0,40,79])]
with ThreadPoolExecutor(max_workers=8) as pool:receipts=list(pool.map(save_member,selected))
else:
# A scene occupies one contiguous region of this ZIP. Download it once, rather than making thousands of per-file requests.
origin=min(m['offset'] for m in members)
following=[m['offset'] for m in index['members'] if m['offset']>max(v['offset'] for v in members)]
end=min(following)-1 if following else max(m['offset']+m['compressed']+1024 for m in members)
chunk=8*1024*1024;ranges=[(i,min(i+chunk-1,end)) for i in range(origin,end+1,chunk)]
with ThreadPoolExecutor(max_workers=6) as pool:parts=list(pool.map(lambda bounds:fetch_range(*bounds),ranges))
block=b''.join(parts)
receipts=[save_member(m,block,origin) for m in members]
receipt={'source':'PandaSet by Scale AI and Hesai','mirror':'https://huggingface.co/datasets/georghess/pandaset',
'mirror_status':'community mirror; not affiliated with the original creators','revision':index['revision'],
'scene':args.scene,'archive_lfs_sha256':'6e2f978fe8e98a8708ca00acae86415096868eccc2effe9826db57514582433e',
'verification':'per-member ZIP CRC and size checked; SHA-256 recorded after download; full archive SHA-256 not checked for this range download',
'files':receipts}
(args.output/f'{args.scene}-download.json').write_text(json.dumps(receipt,indent=2)+'\n')
print(f'PandaSet scene {args.scene}: {len(receipts)} files verified',flush=True)
prepare.py
View files on GitHub"""PandaSet RGB/LiDAR -> NCore V4 + a colored Gaussian seed (NuRec 26.04).
Data terms remain separate from code. Run the pinned runtime with --network none
and only this output folder mounted. A restricted unpickler refuses all globals
except the nine pandas/numpy constructors used by the original LiDAR payload.
This first baseline is static; moving actors can leave reconstruction artifacts.
"""
import gzip,io,json,os,pickle
from pathlib import Path
import numpy as np
from PIL import Image
from scipy.spatial.transform import Rotation,Slerp
from upath import UPath
from ncore.data import OpenCVPinholeCameraModelParameters,ShutterType
from ncore.data.v4 import (SequenceComponentGroupsWriter,SequenceComponentGroupsReader,
PosesComponent,IntrinsicsComponent,MasksComponent,CameraSensorComponent,CuboidsComponent)
from ncore.impl.common.transformations import HalfClosedInterval
root=Path(os.environ['PANDASET_ROOT']);scene=root/'data'/'001'
cameras=['front_camera','front_left_camera','front_right_camera','left_camera','right_camera','back_camera']
class Restricted(pickle.Unpickler):
def find_class(self,module,name):
allow={('pandas.core.frame','DataFrame'),('pandas.core.internals.managers','BlockManager'),('pandas.core.indexes.base','_new_Index'),('pandas.core.indexes.base','Index'),('pandas.core.indexes.range','RangeIndex'),('numpy.core.multiarray','_reconstruct'),('numpy','ndarray'),('numpy','dtype'),('builtins','slice')}
if (module,name) not in allow:raise pickle.UnpicklingError(f'Blocked global: {module}.{name}')
return super().find_class(module,name)
def poses(path):
rows=json.loads(path.read_text());q=np.array([[r['heading'][k] for k in ['x','y','z','w']] for r in rows]);p=np.array([[r['position'][k] for k in ['x','y','z']] for r in rows]);out=np.tile(np.eye(4),(len(rows),1,1));out[:,:3,:3]=Rotation.from_quat(q).as_matrix();out[:,:3,3]=p;return out
L=poses(scene/'lidar/poses.json');lt=np.array(json.loads((scene/'lidar/timestamps.json').read_text()))
# Original lidar ego axes: +X right, +Y forward, +Z up. Target +X forward, +Y left.
G=np.array([[0,-1,0,0],[1,0,0,0],[0,0,1,0],[0,0,0,1]],float);rig=L@G
rinterp=Slerp(lt,Rotation.from_matrix(rig[:,:3,:3]))
def rig_at(times):
times=np.clip(times,lt[0],lt[-1]);out=np.tile(np.eye(4),(len(times),1,1));out[:,:3,:3]=rinterp(times).as_matrix()
for j in range(3):out[:,j,3]=np.interp(times,lt,rig[:,j,3])
return out
# Trim boundary poses instead of extrapolating asynchronous camera exposures.
indices=np.arange(2,78);out=root/'ncore';out.mkdir(exist_ok=True);base=lt[0]
def us(t):return np.rint((np.array(t)-base)*1e6).astype(np.uint64)+1_000_000
writer=SequenceComponentGroupsWriter(UPath(out),'pandaset-001','pandaset-001',HalfClosedInterval.from_start_end(int(us(lt)[0]),int(us(lt)[-1])),{'source':'PandaSet by Scale AI and Hesai; original LICENSE.txt retained; community mirror'},store_type='directory')
def reg(cls,name='default'):return writer.register_component_writer(cls.Writer,component_instance_name=name,group_name='default')
pw=reg(PosesComponent);pw.store_dynamic_pose('rig','world',rig.astype(np.float32),us(lt));pw.store_static_pose('world','world_global',np.eye(4));iw=reg(IntrinsicsComponent);mw=reg(MasksComponent);reg(CuboidsComponent).store_observations([])
meta={};receipt={'camera_pose_approximation':{},'source':'PandaSet scene 001','train_indices':indices.tolist(),'width':1024,'height':576,'baseline':'static 3D Gaussian scene; no actor dynamics or control','original_data_terms':'CC BY 4.0 + PandaSet Dataset Terms; see data/001/LICENSE.txt'}
for cam in cameras:
croot=scene/'camera'/cam;C=poses(croot/'poses.json');ct=np.array(json.loads((croot/'timestamps.json').read_text()));intr=json.loads((croot/'intrinsics.json').read_text());C2R=np.linalg.inv(rig_at(ct[indices]))@C[indices]
# Time-aligned rigid calibration estimate, with measured residuals recorded.
fixed=np.eye(4);fixed[:3,:3]=Rotation.from_matrix(C2R[:,:3,:3]).mean().as_matrix();fixed[:3,3]=np.median(C2R[:,:3,3],axis=0)
err=np.linalg.inv(fixed)@C2R;receipt['camera_pose_approximation'][cam]={'max_translation_m':float(np.linalg.norm(err[:,:3,3],axis=1).max()),'max_rotation_deg':float(np.rad2deg(Rotation.from_matrix(err[:,:3,:3]).magnitude()).max())}
pw.store_static_pose(cam,'rig',fixed.astype(np.float32));scale=1024/1920;K=np.array([[intr['fx'],0,intr['cx']],[0,intr['fy'],intr['cy']],[0,0,1]],float);K[:2]*=scale
iw.store_camera_intrinsics(cam,OpenCVPinholeCameraModelParameters(resolution=np.array([1024,576],np.uint64),shutter_type=ShutterType.GLOBAL,principal_point=K[:2,2].astype(np.float32),focal_length=np.array([K[0,0],K[1,1]],np.float32),radial_coeffs=np.zeros(6,np.float32),tangential_coeffs=np.zeros(2,np.float32),thin_prism_coeffs=np.zeros(4,np.float32)))
mw.store_camera_masks(cam,{});cw=reg(CameraSensorComponent,cam)
for i in indices:
image=Image.open(croot/f'{i:02d}.jpg').convert('RGB').resize((1024,576),Image.Resampling.LANCZOS);stream=io.BytesIO();image.save(stream,format='JPEG',quality=95);ts=int(us(ct[i]));cw.store_frame(image_binary_data=stream.getvalue(),image_format='jpeg',frame_timestamps_us=np.array([ts,ts],np.uint64),generic_data={},generic_meta_data={})
meta[cam]={'C':C,'times':ct,'K':K,'camera_to_rig':fixed.tolist()}
print('CAMERA_WRITTEN',cam,receipt['camera_pose_approximation'][cam],flush=True)
paths=writer.finalize();reader=SequenceComponentGroupsReader(paths);(out/'pandaset-001.json').write_text(json.dumps(reader.get_sequence_meta().to_dict(),indent=2)+'\n')
# LiDAR is already in world coordinates (official devkit geometry.projection).
# Exclude validation-frame scans; project into calibrated RGB to color the seed.
points=[];colors=[];source_frames=[]
for i in indices[1::4]:
with gzip.open(scene/'lidar'/f'{i:02d}.pkl.gz','rb') as f:df=Restricted(f).load()
p=df[['x','y','z']].to_numpy();valid=np.isfinite(p).all(axis=1)&(np.linalg.norm(p-rig[i,:3,3],axis=1)<90);p=p[valid][::2];rgb=np.zeros((len(p),3));assigned=np.zeros(len(p),bool)
for cam in cameras:
m=meta[cam];C=m['C'][i];q=(p-C[:3,3])@C[:3,:3];K=m['K'];z=q[:,2];u=K[0,0]*q[:,0]/np.maximum(z,1e-6)+K[0,2];v=K[1,1]*q[:,1]/np.maximum(z,1e-6)+K[1,2];sel=(z>.5)&(u>=0)&(u<1024)&(v>=0)&(v<576)&~assigned
im=np.array(Image.open(scene/'camera'/cam/f'{i:02d}.jpg').resize((1024,576)));rgb[sel]=im[v[sel].astype(int),u[sel].astype(int)]/255.;assigned[sel]=True
points.append(p[assigned]);colors.append(rgb[assigned]);source_frames.append(int(i))
p=np.concatenate(points);c=np.concatenate(colors);_,keep=np.unique(np.floor(p/.18).astype(np.int64),axis=0,return_index=True);p=p[keep];c=c[keep]
if len(p)>320000:keep=np.random.default_rng(7).choice(len(p),320000,replace=False);p=p[keep];c=c[keep]
fields=[(n,'f4') for n in ['x','y','z','nx','ny','nz','f_dc_0','f_dc_1','f_dc_2','opacity','scale_0','scale_1','scale_2','rot_0','rot_1','rot_2','rot_3']];a=np.zeros(len(p),dtype=fields)
for j,k in enumerate(['x','y','z']):a[k]=p[:,j]
for j in range(3):a[f'f_dc_{j}']=(c[:,j]-.5)/.28209479177387814;a[f'scale_{j}']=np.log(.12)
a['opacity']=1;a['rot_0']=1
header='ply\nformat binary_little_endian 1.0\nelement vertex '+str(len(a))+'\n'+'\n'.join('property float '+n for n in a.dtype.names)+'\nend_header\n'
with (root/'seed.ply').open('wb') as f:f.write(header.encode());f.write(a.tobytes())
# Estimate a local road plane for the display mesh, without inventing its height.
with gzip.open(scene/'lidar/30.pkl.gz','rb') as f:road=Restricted(f).load()[['x','y','z']].to_numpy()
road=(road-rig[30,:3,3])@rig[30,:3,:3];patch=road[(road[:,0]>3)&(road[:,0]<12)&(abs(road[:,1])<1.5)]
A=np.column_stack([patch[:,:2],np.ones(len(patch))]);coef=np.linalg.lstsq(A,patch[:,2],rcond=None)[0]
for _ in range(3):
error=abs(A@coef-patch[:,2]);ok=error<np.quantile(error,.8);coef=np.linalg.lstsq(A[ok],patch[ok,2],rcond=None)[0]
(root/'ground-plane.json').write_text(json.dumps({'forward_slope':float(coef[0]),'left_slope':float(coef[1]),'height_at_rig_m':float(coef[2]),'reference_lidar_frame':30,'plane_rms_m':float(np.sqrt(np.mean((A[ok]@coef-patch[ok,2])**2))),'scope':'static robust fit of observed road patch 3-12m ahead, not per-frame contact physics'},indent=2)+'\n')
receipt.update(seed_gaussians=len(a),seed_lidar_frames=source_frames,camera_count=6,image_count=len(indices)*6,seed_source='measured real LiDAR in world coordinates, colored by real camera RGB; 0.18m voxel subset; no synthetic depth')
(root/'prepared.json').write_text(json.dumps(receipt,indent=2)+'\n');(root/'camera-calibrations.json').write_text(json.dumps({cam:{'K':m['K'].tolist(),'camera_to_rig':m['camera_to_rig']} for cam,m in meta.items()},indent=2)+'\n');print('PREPARED',receipt,flush=True)
scene.yaml
View files on GitHub# Real PandaSet RGB + measured LiDAR, fitted by NuRec 26.04.
# Static baseline: dynamic road users are not modeled as tracked actors.
defaults:
- /experimental/3dgut/3dgut_colmap
- override /model/gaussians/initialization@model.layers.background.initialization: ply
- _self_
out_dir: /work/train
mode: trainval
dataset:
path: /work/ncore/pandaset-001.json
camera_ids: [front_camera, front_left_camera, front_right_camera, left_camera, right_camera, back_camera]
lidar_ids: []
n_samples_per_epoch: 6000
n_val_image_subsample: 1
train_sequential_camera_frame_step: 1
val_camera_frame_step: 8
camera_mask_sources: [dataset]
datamodule:
train_num_workers: 2
val_num_workers: 1
test_num_workers: 1
trainer:
max_epochs: 1
log_every_n_steps: 100
model:
layers:
background:
initialization:
path: /work/seed.ply
translate_world_to_nre: true
strategy:
add:
max_n_gaussians: 450000
system:
test:
video_fps: 10
metrics:
cpsnr:
enabled: false
collect_training.py
View files on GitHub"""Extract observed NuRec timing and configuration from a completed local run."""
import json
import os
from pathlib import Path
import re
root=Path(os.environ['PANDASET_ROOT'])
log=(root/'nurec-train.log').read_text(errors='replace')
steps=re.findall(r'Number of training steps:\s*(\d+)',log)
timing=re.findall(r'Train elapsed time:\s*([\d.]+) seconds',log)
artifacts=list((root/'train').rglob('last.usdz'))
if not steps or not timing or len(artifacts)!=1:
raise RuntimeError('A complete training log and exactly one last.usdz are required')
(root/'nurec-result.json').write_text(json.dumps({
'runtime':'26.4.149','image':'nvcr.io/nvidia/nre/nre-ga:26.04',
'renderer':'gsplat','training_steps':int(steps[-1]),'training_seconds':float(timing[-1]),
'timing_scope':'NuRec-reported training elapsed time; excludes environment setup and data preparation',
'artifact_bytes':artifacts[0].stat().st_size,
},indent=2)+'\n')
print('Collected completed NuRec training metadata')
make_views.py
View files on GitHub"""Author three ego-following cameras without modifying reconstructed geometry."""
import copy,json,os,zipfile
from pathlib import Path
import numpy as np
root=Path(os.environ['PANDASET_ROOT']);artifacts=list((root/'train').rglob('last.usdz'))
if len(artifacts)!=1:raise RuntimeError('Exactly one finished artifact is required')
a=artifacts[0]
with zipfile.ZipFile(a) as z:rig=json.loads(z.read(next(n for n in z.namelist() if n.endswith('rig_trajectories.json'))))
sensor=next(k for k in rig['camera_calibrations'] if k.startswith('front_camera@'));template=rig['rig_trajectories'][0];times=template['cameras_frame_timestamps_us'][sensor];poses=template['cameras_frame_T_rig_worlds'][sensor];views=[]
def camera(eye,target):
eye=np.array(eye,dtype=float);f=np.array(target)-eye;f/=np.linalg.norm(f);right=np.cross(f,[0,0,1]);right/=np.linalg.norm(right);down=np.cross(f,right);T=np.eye(4);T[:3,:3]=np.column_stack([right,down,f]);T[:3,3]=eye;return T.tolist()
for name in ['front','ego-elevated','ego-quarter']:
d=copy.deepcopy(rig);t=d['rig_trajectories'][0];cal=copy.deepcopy(d['camera_calibrations'][sensor]);t['cameras_frame_timestamps_us']={sensor:times};t['lidars_frame_timestamps_us']={};t['cameras_frame_T_rig_worlds']={sensor:poses};t['cameras_linear_start_frame_indices']={sensor:0};t['lidars_linear_start_frame_indices']={};t['T_rig_worlds']=[p[0] for p in poses];t['T_rig_world_timestamps_us']=[ts[0] for ts in times]
if name!='front':
eye=[-4,0,4.5] if name=='ego-elevated' else [-4,-3.5,4.8];target=[.5,0,.6] if name=='ego-elevated' else [.8,0,.6];cal['T_sensor_rig']=camera(eye,target);p=cal['camera_model']['parameters'];p['focal_length']=[512,512];p['principal_point']=[512,288];p['resolution']=[1024,576];p['external_distortion_parameters']=None
views.append({'id':name,'width':1024,'height':576,'K':[[512,0,512],[0,512,288],[0,0,1]],'camera_to_rig':cal['T_sensor_rig']})
d['camera_calibrations']={sensor:cal};d['lidar_calibrations']={};(root/f'rig-{name}.json').write_text(json.dumps(d,indent=2)+'\n')
(root/'ego-views.json').write_text(json.dumps({'views':views},indent=2)+'\n');(root/'artifact.json').write_text(json.dumps({'artifact':str(a.relative_to(root)),'frames':len(times),'views':['front','ego-elevated','ego-quarter']},indent=2)+'\n');print('Prepared',len(times),'frames per view')
run.sh
View files on GitHub#!/usr/bin/env bash
set -euo pipefail
lab_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
repo_dir="$(cd -- "$lab_dir/../.." && pwd)"
root="${PANDASET_ROOT:?Set PANDASET_ROOT to a fresh output folder}"
mkdir -p "$root/runtime-home";root="$(cd -- "$root" && pwd)"
image="nvcr.io/nvidia/nre/nre-ga:26.04@sha256:97f43e7130c5636ce3e80ea3184d97f56a87fdd989b05cce42230881dbdea284"
base=(docker run --rm --gpus all --network none --shm-size=8g --user "$(id -u):$(id -g)"
-v "$root:/work" -v "$lab_dir:/lab:ro" -e PANDASET_ROOT=/work -e HOME=/work/runtime-home)
lock="${GPU_LOCK:-/tmp/physical-ai-four-domains.gpu.lock}"
case "${1:-help}" in
download)
python3 "$lab_dir/index_zip.py" --output "$root/pandaset-index.json"
python3 "$lab_dir/download.py" --index "$root/pandaset-index.json" --scene 001 --output "$root/data"
;;
prepare) flock "$lock" "${base[@]}" "$image" run-script /lab/prepare.py ;;
train)
flock "$lock" "${base[@]}" -v "$lab_dir/scene.yaml:/app/run.runfiles/_main/configs/pandaset-scene.yaml:ro" \
"$image" main --config-name pandaset-scene.yaml 2>&1 | tee "$root/nurec-train.log"
python3 "$lab_dir/collect_training.py"
;;
render)
flock "$lock" "${base[@]}" "$image" run-script /lab/make_views.py
artifact="$(python3 -c 'import json,os; print(json.load(open(os.path.join(os.environ["PANDASET_ROOT"],"artifact.json")))["artifact"])')"
for view in front ego-elevated ego-quarter; do
flock "$lock" "${base[@]}" "$image" render --artifact-path "/work/$artifact" --output-dir "/work/renders/$view" \
--camera-id front_camera --height 576 --renderer gsplat --custom-rig-trajectory "/work/rig-$view.json" \
--no-replicate-training-views --calib-source training-rig-poses --save-workers 2
done
;;
enhance)
# The standalone official non-temporal checkpoint; mount separately if shared.
weights="${HARMONIZER_WEIGHTS:?Set HARMONIZER_WEIGHTS to the folder containing harmonizer_nontemporal.pt}"
if [[ ! -e "$root/novel" ]]; then ln -s renders/ego-quarter "$root/novel"; fi
flock "$lock" "${base[@]}" -v "$repo_dir/labs/reality-view:/enhancer:ro" \
-v "$weights:/work/checkpoints/Harmonizer:ro" -e REALITY_VIEW_ROOT=/work "$image" run-script /enhancer/enhance.py
;;
*) printf '%s\n' 'Choose download, prepare, train, render, or enhance. See the bilingual guide.'; exit 2 ;;
esac
package.py
View files on GitHub"""Package completed PandaSet NuRec/Harmonizer frames; never run fake inference."""
import argparse,hashlib,json,subprocess
from pathlib import Path
from PIL import Image,ImageChops,ImageDraw,ImageFont
p=argparse.ArgumentParser();p.add_argument('--input',type=Path,required=True);p.add_argument('--output',type=Path,required=True);p.add_argument('--font',type=Path,required=True);a=p.parse_args();r=a.input;out=a.output;out.mkdir(parents=True,exist_ok=True)
views=['front','ego-elevated','ego-quarter'];frames={v:sorted((r/'renders'/v).rglob('*.png')) for v in views};frames['enhanced']=sorted((r/'enhanced').glob('*.png'));n=76
if not all(len(v)==n for v in frames.values()):raise ValueError('Expected 76 completed frames per view and enhancement')
layers={}
for v in views[1:]:
clean=Image.open(r/'vehicle-layers'/f'{v}-car.png').convert('RGBA');shadowed=Image.open(r/'vehicle-layers'/f'{v}-shadowed.png').convert('RGBA')
shadow=Image.new('RGBA',clean.size,(16,20,24,0));shadow.putalpha(ImageChops.subtract(shadowed.getchannel('A'),clean.getchannel('A')).point(lambda x:round(x*.22)))
layers[v]=Image.alpha_composite(shadow,clean)
font=ImageFont.truetype(str(a.font),22);small=ImageFont.truetype(str(a.font),16)
for f,w in [(font,450),(small,400)]:
try:f.set_variation_by_axes([w])
except (OSError,AttributeError):pass
copy={
'en':['Real-road reconstruction · Volvo S90 ego reference','PandaSet + NuRec · added car model, not the original collection vehicle','Elevated view','Quarter view · Harmonizer','Original camera photograph','NuRec at original camera','New view · NuRec','Same new view · Harmonizer'],
'ko':['실사 도로 복원 · Volvo S90 자차 표시','PandaSet + NuRec · Volvo는 별도로 추가한 차량 모델입니다','차량을 따라가는 높은 시점','사선 시점 · Harmonizer','원래 카메라 사진','같은 카메라 · NuRec 복원','새 시점 · NuRec','같은 새 시점 · Harmonizer']}
credit='PandaSet: Scale AI / Hesai | Car: lazercar, CC BY 4.0 | Demo: CC BY-SA 4.0 | Built on NVIDIA Cosmos'
def frame(v,i,car=False):
im=Image.open(frames[v][i]).convert('RGBA')
if car:im=Image.alpha_composite(im,layers['ego-quarter' if v=='enhanced' else v])
return im.convert('RGB')
def footer(im,title,subtitle=None):
d=ImageDraw.Draw(im);d.rectangle((0,im.height-82,im.width,im.height),fill='white');d.text((14,im.height-77),title,font=font,fill='#20252a')
if subtitle:d.text((14,im.height-46),subtitle,font=small,fill='#5a626a')
d.text((14,im.height-23),credit,font=small,fill='#5a626a');return im
def encode(name,stream,size=(1024,576)):
proc=subprocess.Popen(['ffmpeg','-v','error','-y','-f','rawvideo','-pix_fmt','rgb24','-s',f'{size[0]}x{size[1]}','-r','10','-i','pipe:0','-an','-c:v','libx264','-preset','fast','-crf','22','-pix_fmt','yuv420p','-movflags','+faststart',str(out/name)],stdin=subprocess.PIPE)
for im in stream:proc.stdin.write(im.resize(size,Image.Resampling.LANCZOS).tobytes())
proc.stdin.close()
if proc.wait():raise RuntimeError('Encoding failed')
def sequence(lang):
c=copy[lang]
for v,title in [('ego-elevated',c[2]),('enhanced',c[3])]:
for i in range(n):yield footer(frame(v,i,True),f'Volvo S90 Recharge · {title}',c[1])
def comparison(lang):
c=copy[lang]
for i in range(n):
im=Image.new('RGB',(2048,1260),'white');d=ImageDraw.Draw(im)
source=Image.open(r/'data/001/camera/front_camera'/f'{i+2:02d}.jpg').convert('RGB').resize((1024,576));tiles=[source,frame('front',i),frame('ego-quarter',i,True),frame('enhanced',i,True)]
for j,(tile,title) in enumerate(zip(tiles,c[4:])):
x=(j%2)*1024;y=(j//2)*606;im.paste(tile,(x,y+30));d.text((x+12,y+2),title,font=font,fill='#20252a')
d.text((12,1227),credit,font=font,fill='#555d65');yield im
for lang in ['en','ko']:
encode(f'pandaset-nurec.{lang}.mp4',sequence(lang));encode(f'comparison.{lang}.mp4',comparison(lang),size=(1280,788))
im=footer(frame('enhanced',36,True),'Volvo S90 Recharge · '+copy[lang][3],copy[lang][1]);im.save(out/f'pandaset-nurec.{lang}.jpg',quality=91)
encode('volvo-quarter.mp4',(footer(frame('enhanced',i,True),'Volvo S90 · added ego reference') for i in range(n)))
encode('nurec-quarter.mp4',(footer(frame('ego-quarter',i),'PandaSet · NuRec novel view') for i in range(n)))
folder=out/'frames';folder.mkdir(exist_ok=True)
for i in [0,36,75]:
for name in ['front','ego-quarter','enhanced']:
(folder/f'{i:02d}-{name}.png').write_bytes(frames[name][i].read_bytes())
for v in views[1:]:layers[v].save(out/f'{v}-layer.png')
for name in ['ground-plane.json','ego-views.json']:(out/name).write_bytes((r/name).read_bytes())
# Clear source attribution and scopes accompany even an independently copied bundle.
(out/'README.md').write_text('''# Real road / Volvo ego-view evidence
PandaSet by Scale AI and Hesai. Original terms: ../PANDASET-DATA-LICENSE.txt.
Volvo S90 Recharge (Free) by lazercar, CC BY 4.0. Paint, alignment, shadows and rendering modified.
https://sketchfab.com/3d-models/volvo-s90-recharge-free-9462b07c10244fd4a28d86846dc9e3a9
https://creativecommons.org/licenses/by/4.0/
New demo media: CC BY-SA 4.0; original PandaSet Dataset Terms also apply.
https://creativecommons.org/licenses/by-sa/4.0/
Built on NVIDIA Cosmos.
Real measured RGB/LiDAR, static NuRec baseline, non-temporal Harmonizer.
The Volvo is an added visual reference. No original ego-vehicle identity,
vehicle control, wheel animation, dynamic actor reconstruction or closed-loop driving is claimed.
No NVIDIA PhysicalAI AV dataset content or model weights are present.
See ../SOURCES.md for the upstream license-label discrepancy and community-mirror provenance.
''')
files={}
for path in out.rglob('*'):
if path.is_file():files[str(path.relative_to(out))]={'bytes':path.stat().st_size,'sha256':hashlib.sha256(path.read_bytes()).hexdigest()}
prepared=json.loads((r/'prepared.json').read_text());h=json.loads((r/'harmonizer-result.json').read_text());nr=json.loads((r/'nurec-result.json').read_text())
report={'recorded_at':'2026-11-23','scope':'real measured road reconstruction + added Volvo display mesh; static scene, non-temporal enhancement, no driving control','dataset':{'name':'PandaSet','authors':'Scale AI and Hesai','scene':'001','mirror':'https://huggingface.co/datasets/georghess/pandaset','mirror_status':'unofficial community mirror','revision':'e2e123aea3b3132c67f4b395ec6120f63e190271','payload_terms':'CC BY 4.0 + PandaSet Dataset Terms','alternate_notice':'Scale Nucleus labels PandaSet CC BY-SA 4.0; preserved in SOURCES.md','new_media_license':'CC BY-SA 4.0 + original data terms','contains_nvidia_av_data':False},'nurec':nr,'preparation':prepared,'harmonizer':h,'video_frames_per_view':n,'capture_fps':10,'added_vehicle':'Volvo S90 Recharge by lazercar, CC BY 4.0','files':files}
(out.parent/'recorded.json').write_text(json.dumps(report,indent=2)+'\n');print('PACKAGED',len(files),'files')
check.py
View files on GitHub"""CPU-only integrity, camera geometry and optional full-video decode checks."""
import argparse,hashlib,json,math,subprocess
from pathlib import Path
ROOT=Path(__file__).resolve().parent
def main(decode=False):
report=json.loads((ROOT/'recorded.json').read_text());assert report['dataset']['contains_nvidia_av_data'] is False
assert report['nurec']['training_steps']==6000 and report['nurec']['training_seconds']>0
assert report['preparation']['image_count']==456 and report['preparation']['camera_count']==6
assert report['preparation']['seed_gaussians']==320000
assert report['harmonizer']['frames']==report['video_frames_per_view']==76
assert all(math.isfinite(t) and t>0 for t in report['harmonizer']['per_frame_seconds'])
for name,expected in report['files'].items():
p=ROOT/'evidence'/name;assert p.stat().st_size==expected['bytes'],name;assert hashlib.sha256(p.read_bytes()).hexdigest()==expected['sha256'],name
if decode and p.suffix=='.mp4':subprocess.run(['ffmpeg','-v','error','-i',str(p),'-f','null','-'],check=True)
views=json.loads((ROOT/'evidence/ego-views.json').read_text())['views'];assert len(views)==2
for view in views:
T=view['camera_to_rig'];assert len(T)==4 and all(len(row)==4 and all(math.isfinite(x) for x in row) for row in T)
for i in range(3):
for j in range(3):assert abs(sum(T[k][i]*T[k][j] for k in range(3))-(1 if i==j else 0))<1e-6
R=[row[:3] for row in T[:3]];det=sum(R[0][i]*(R[1][(i+1)%3]*R[2][(i+2)%3]-R[1][(i+2)%3]*R[2][(i+1)%3]) for i in range(3));assert abs(det-1)<1e-6
print('Verified real-road sources, 456-image preparation, 76-frame outputs, camera transforms and evidence hashes.')
if __name__=='__main__':
parser=argparse.ArgumentParser();parser.add_argument('--decode-video',action='store_true');main(parser.parse_args().decode_video)
