/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
transformers
Опубликована
8 сен 2026

badas-3.0

Классификация видеоВидео → label
3 793скачиваний за 30 дней1лайквеса обновлены2 дек 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

BADAS-3.0 анализирует видео с автомобильной камеры, чтобы прогнозировать траектории движения и оценивать риск столкновения.

BADAS-3.0 — видеомодель Empiric Earth для анализа дорожной обстановки по видео с фронтальной камеры автомобиля. Модель на основе видеокодировщика ViT-g примерно с 1 млрд параметров обрабатывает двухсекундное окно и предсказывает движение автомобиля в его собственной системе координат: шесть возможных траекторий на 6,4 секунды, выбранную траекторию и недавний путь автомобиля. Также пакет включает оценку риска столкновения и скорости, сборщик траекторий и средства потоковой обработки.

Модель предназначена для исследования и оценки сценариев дорожного движения, прогнозирования траекторий и риска столкновений. Она обучалась и оценивалась на кадрах 256×256 с частотой 8 кадров в секунду; другие параметры видео, ракурсы камер и недорожные сцены могут ухудшить результаты. Оценка риска относится к двухсекундному окну и не является гарантией безопасности; модель не сертифицирована для систем помощи водителю. Для точности скорости рекомендуется использовать показания датчика или калибровку. Весам требуется автоматическое одобрение доступа на Hugging Face. Лицензия — Apache-2.0.

Сценарии применения

  • прогнозирование возможных траекторий автомобиля по видео с передней камеры
  • оценка риска столкновения на коротком участке дорожного видео
  • восстановление пути автомобиля без GPS и IMU
  • анализ дорожных инцидентов и предаварийных ситуаций
  • потоковая оценка движения автомобиля по видеопотоку

Ограничения

Модель рассчитана на дорожное видео с фронтальной камеры, снятое примерно в условиях обучения; другие ракурсы, частота кадров, разрешение и типы сцен могут быть вне распределения. Оценка риска не гарантирует безопасность, а модель не сертифицирована для помощи водителю; оценка скорости может занижать фактическую.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

BADAS-3.0

Try BADAS 3 on your own video in Atlas | Paper | Code | Project page | Discord

BADAS-3.0 predictions on four real incidents

BADAS-3.0 on four real incidents from the public Nexar Collision Prediction test set, rendered with the library's overlay (python -m badas3.overlay): the forward camera, the ego path and the six futures over the next 6.4 s, collision risk and speed, from one 2 s window at a time. The last 6 s of each clip; the dataset's watermark is blurred.

BADAS-3.0 is Empiric Earth's video model for driving. From one forward pass over a 2 second window of forward-facing camera video it predicts, in the vehicle's own frame:

outputwhat it isshape
trajectory_xysix candidate futures, 6.4 s at 10 Hz(B, 6, 64, 2)
trajectory_bestthe candidate the car drives(B, 64, 2)
pose_xythe ego path over the last 1.9 s(B, 20, 2)
speed_mpsthe ego speed now, from video alone(B,)
risk_probcollision or near-collision probability(B,)

Each candidate has a logit (trajectory_logits), the K-way selector's ranking, and a candidate that brakes to a stop stays stopped.

Try it with nothing to install: run BADAS 3 on sample clips or your own video in Empiric Earth Atlas.

A trajectory stitcher (TrajectoryAssembler) turns consecutive windows into arbitrarily long trajectories without GPS, IMU or a pose graph. The model has about 1 billion parameters: the backbone is a 1B ViT-g video encoder pretrained from scratch on real driving with the V-JEPA objective; the four heads, the stitcher and the trajectory selector add about 29 million.

The release is this repository, the weights and three benchmark datasets, pinned to each other and used as one system: Reproduce everything re-derives every published number with one command.

Which of the six futures the car drives: the K-way selector

The trajectory head proposes six candidates and scores each with a linear classifier. Since 3.1.0 the ranking the model drives on comes from the K-way selector: the head's own scores plus the mean residual of five small transformer members that read each candidate's decoder feature, its trajectory in metres and the standardised logit of the package's collision-risk head (the one behind risk_prob), plus one constant on the slow anchor. The argmax is the pick; there is no threshold anywhere, and the six candidates themselves do not change. On DCA-Bench (100 real incidents, collisions and near-misses, reconstructed, each paired with a hazard-free twin from the same clip; 89 pairs) the selector's pick passes 39% of the pairs where the head's own ranking passes 20%, and on the Euro NCAP crash-avoidance bench (one 75° forward camera, sensor speed and ego history) it raises the mean protocol score from 0.193 to 0.296 with no false braking on the no-crash twins, at a top-1 cost near zero on most trajectory sets. Every number and how to reproduce it: results/README.md.

out.trajectory_logits        # (B, 6) the selector's ranking; out.trajectory_best drives it
out.trajectory_base_logits   # (B, 6) the head's own classifier; out.trajectory_base_best is that pick

One thing to know: the selector reads the candidates as integrated with the speed you chose (see the next section), so speed_source is part of its input; the benchmark rows were scored with the sensor speed. (3.1.0 carried a second, older risk head as the selector's input; since 3.2.0 the selector reads risk_head itself, so there is one risk head and one classifier in the package.)

The package badas3 is a standard Hugging Face transformers model: from_pretrained, save_pretrained, a video processor, plus streaming, TensorRT export, a video overlay, training and evaluation code.

Requirements

  • Linux, Python 3.10 or newer.
  • PyTorch 2.4 or newer. Inference needs an NVIDIA GPU with about 8 GB of free memory for batch 1 (the weights are 4.2 GB in fp32, 2.1 GB after warmup() casts to bf16). CPU works for the tests and for small models but is far too slow for video.
  • transformers 4.53 or newer, including the 5.x series.
  • ffmpeg on the PATH for H.264 output from the video overlay (optional: without it OpenCV's writer is used; pip install "badas3[video]" bundles one).

Install

pip install "git+https://github.com/empiric-earth/badas3.git@3.14.14"     # inference, streaming, video overlay

The weights are gated: request access on the model page (approval is automatic), then log in with hf auth login (or set HF_TOKEN). The code installs without it, but from_pretrained needs it.

Or, to work on the code, run the tests and the notebooks:

git clone https://github.com/empiric-earth/badas3.git
cd badas3
pip install -e .                    # inference, streaming, video overlay
pip install -e ".[all]"             # + training, evaluation, notebooks, tests (TensorRT: ".[export]")

The weights are on the Hugging Face Hub at empiricearth/badas-3.0; the first from_pretrained call downloads them (4.2 GB) and caches them.

Check the installation (from the clone):

pip install -e ".[test]"
python -m pytest tests -q           # about two minutes on CPU, no weights needed

Tests that need a GPU, the weights (BADAS3_MODEL=<local copy>) or a benchmark snapshot skip with a message saying what they need.

Using only the Hugging Face repository

The model also loads without this package through trust_remote_code; the video processor does not, so preprocess as the input contract below says (or install the package for BADAS3VideoProcessor):

from transformers import AutoModel
model = AutoModel.from_pretrained("empiricearth/badas-3.0", trust_remote_code=True)
out = model(pixel_values_videos=x)   # x: (B, 3, 16, 256, 256), ImageNet-normalised RGB, 8 fps, oldest first

In a process that has imported badas3, AutoModel resolves to the installed package's class (the package registers it), not to the Hub's modeling_badas3.py.

Reproduce everything

The release is five repositories, versioned together. You never fetch them by hand: badas3 pins each one (a tag, the commit it must resolve to, and for the weights the sha256 of model.safetensors), downloads what an arm needs and stops on any mismatch.

repositorywhat it holdspinned as
empiric-earth/badas3this package: model code, inference, training, evaluation, dataset adapters, resultstag 3.14.14
empiricearth/badas-3.0the weights (and this package, for trust_remote_code)revision 3.10.0 + sha256
empiricearth/badas3-bench-future-trajectoryour trajectory predictions, window ids, golden.jsonv1.26-cvpr + commit
empiricearth/badas3-bench-ncap-crash-avoidancethe Euro NCAP renders (CARLA), plans, ledgers, golden.jsonv1.6-cvpr + commit
empiricearth/badas3-bench-dcaDCA-Bench annotations over the public Nexar Kaggle clips, plans, golden.jsonv1.4-cvpr + commit

Third-party datasets are not redistributed: each has an adapter that downloads it from its official source, checks it against published checksums and prepares it (python -m badas3.eval datasets lists sources, access and licences).

git clone https://github.com/empiric-earth/badas3.git && cd badas3 && git checkout 3.14.14
pip install -e ".[eval]"
python -m badas3.eval env build all                                          # once: the pinned environments (~/.cache/badas3/envs; BADAS3_ENVS moves them)
python -m badas3.eval reproduce all --raw RAW --work WORK                    # rescore: CPU, every arm
python -m badas3.eval reproduce all --raw RAW --work WORK --level rerun      # rerun: one GPU, the model itself

Each arm prints a PASS / FAIL table against results/<arm>.json within its documented tolerance; reproduce all ends with one summary and writes WORK/reproduce/all.<level>.json. It exits 0 only when no arm fails. RAW holds the official downloads (one folder per dataset, filled by the fetch steps), WORK everything derived.

armrescore (CPU) needsrerun (GPU) also needs
trajectoryour predictions (bench-future-trajectory); ground-truth poses from nuScenes, Argoverse 2, Waymo, PhysicalAI-AVthe clips of those sets
riskour predictions (results/predictions/risk); no downloadNexar Kaggle, DAD, DoTA, DADA-2000 videos
ncapplans and ledgers (bench-ncap-crash-avoidance)the shipped renders
dcaplans and annotations (bench-dca)the public Nexar Kaggle clips
ego_pose_2s, ego_pose_full_videoour per-window errors (results/predictions/ego)nuScenes, Argoverse 2, Waymo, KITTI, PhysicalAI-AV
ego_speed_v0our predictions; ground truth from nuScenes, Argoverse 2, Waymo, KITTI, PhysicalAI-AVthe clips of those sets
kitti_fulln/a (no per-drive predictions were kept)KITTI odometry

One arm, or some of its sets: python -m badas3.eval reproduce <arm> --set <set>; --dry-run prints every step without running it. Tolerances, their provenance and the known non-deterministic rows: docs/EVALUATION.md. The numbers themselves: results/README.md.

Quick start

pip install "git+https://github.com/empiric-earth/badas3.git@3.14.14"
python -m badas3 run drive.mp4 --overlay drive_overlay.mp4      # one GPU; a folder, a list or rtsp://... work too
head -1 drive.badas3.jsonl                                      # per 2 s window, 8 per second: risk, alert, speed, futures

Every window gets the raw and smoothed collision risk with its alert level, the speed, the top trajectory and the six ranked futures, and the recovered past path; drive.badas3.trail.csv is the assembled long trajectory. --stream runs causally, one tick per frame, for a live camera or RTSP stream; --engine compile|tensorrt and --mode fast|reference choose speed or bit-exact benchmark preprocessing. Details, throughput and the measured fast-vs-reference agreement: docs/INFERENCE.md. Evaluating your own labelled videos as a benchmark: docs/EVALUATION.md.

In Python, one window at a time:

import torch
from badas3 import BADAS3Model, BADAS3VideoProcessor

processor = BADAS3VideoProcessor.from_pretrained("empiricearth/badas-3.0")
model = BADAS3Model.from_pretrained("empiricearth/badas-3.0").warmup("cuda")   # compiles once (a few minutes), about 43 ms per window after (A100)

frames = processor.read_video_window("drive.mp4")   # the last 2 s of a video as 16 RGB frames, or pass your own list
inputs = processor(frames, return_tensors="pt").to("cuda")
with torch.inference_mode():
    out = model(**inputs)

out.trajectory_best                 # (1, 64, 2) the most likely future in metres, x forward, y left
out.trajectory_xy, out.trajectory_logits          # all six candidates and their logits
out.pose_xy[0]                      # (20, 2) the path of the last 1.9 s; row 19 is now, at (0, 0)
float(out.speed_mps), float(out.risk_prob)

trajectory_xy and trajectory_best are the decode the model was trained and benchmarked on: the controls integrated from the speed without a floor, so a braking candidate whose deceleration outlasts the stop rolls backward along its line (x falls below the stopping point, even below zero). To draw or act on a future, hold the speed at zero once reached, as the video overlay does:

from badas3 import integrate_forward_stopping
futures = integrate_forward_stopping(out.trajectory_controls[0], out.speed_mps.expand(6), 0.1)   # (6, 64, 2)

warmup() is optional. Without it the model runs eagerly in the dtype you load it in (fp32 by default; about 146 ms per window eager on an A100). Wrap inference in torch.inference_mode() as above; gradients are only needed for fine-tuning.

Input contract

16 frames at 8 fps, the 2.0 s ending at the moment of interest, oldest first. Each frame is resized to 256x256 without preserving the aspect ratio (a plain squash, no letterboxing), converted to RGB and normalised with the ImageNet mean and standard deviation. BADAS3VideoProcessor does exactly this from a list of frames, a video path (the last window) or a tensor. Do not preprocess any other way: the model was trained on this contract.

Frame convention

Every output is in the ego frame at the end of the window: x forward, y left, heading counter-clockwise positive, positions in metres on a 0.1 s grid. Tools that draw in forward/right must negate y (badas3.assembly.to_forward_right). The convention is recorded in config.json as frame: forward_left.

Choosing the speed source

The trajectory head predicts controls (acceleration and curvature) and integrates them from an initial speed. Three sources, from most to least sensor dependent:

model(**inputs, speed_source="sensor", speed_mps=torch.tensor([v]))   # v: a CAN-bus or GPS speed in m/s, one per window
model.set_speed_factor(k); model(**inputs, speed_source="fewshot")   # the speed head times the camera's speed factor k
model(**inputs, speed_source="head")                  # video only, the default

badas3.speed_factor_from_examples fits k from at least ten speed-labelled windows of a new camera, with the one rule the benchmarks use. The preprocessing of a camera and its factors are kept together in a source profile, saved once and reused (python -m badas3 run drive.mp4 --profile cam.profile.json; a known factor needs no file: --speed-factor 1.08): docs/INFERENCE.md, "The source profile". The future-trajectory benchmark (empiricearth/badas3-bench-future-trajectory) reports all three.

Ego-pose history (optional)

model(**inputs, past_pose=history) with history of shape (B, 20, 7): the last 2.0 s of ego poses at 10 Hz in the anchor frame, each row (x, y, z, roll, pitch, sin yaw, cos yaw). Without it the head uses a learned null block; the weights were trained with 50 percent history dropout, so both paths are in distribution. On the benchmark, history adds nothing once speed is known.

Long trajectories: the stitcher

from badas3 import TrajectoryAssembler

assembler = TrajectoryAssembler(model.stitcher, context=8, device="cuda")
with torch.inference_mode():
    for t, frames in windows_every_half_second:      # 0.5 s stride, the stride the stitcher was trained at
        out = model(**processor(frames, return_tensors="pt").to("cuda"))
        track = assembler.push(out.pooled_tokens[0], out.pose_controls[0], float(out.speed_mps[0]), t)
track.positions, track.heading, track.speed          # metres, radians, m/s on the 0.1 s grid

Grid steps older than 1.9 s never change; the newest 1.9 s are provisional and are refined by later windows (track.provisional_from_index).

Streaming

badas3.streaming.StreamingSession owns a GPU frame ring, runs the model on every frame once 16 are present, smooths the risk with RiskSmoother (the production smoother) and feeds the stitcher at the right stride:

from badas3.streaming import StreamingSession

session = StreamingSession(model, model.config)                      # or: python -m badas3 run rtsp://... --stream
for t, frame_bgr in frames_at_8_hz:                  # OpenCV frames, time in seconds
    state = session.push_frame(frame_bgr, t)         # None until 16 frames are in
    if state:
        state.output.trajectory_best, state.risk_smoothed, state.assembled

Video overlay

python -m badas3.overlay drive.mp4 --out drive_overlay.mp4 --session drive.npz

One video in, one video out: the camera on the left and a heading-up bird's-eye view on the right with the assembled ego trail, the six candidate futures, a speed gauge, a collision-risk readout and the whole-clip risk timeline, at the source frame rate. OverlaySession caches every per-window output so re-rendering never touches the model; render_frame is a pure function of a per-frame state, and StreamingOverlay feeds it from a live camera. The style is code, so every overlay looks the same. Details: docs/OVERLAY.md.

TensorRT

from badas3.export import export_onnx, build_tensorrt_engine, TensorRTRuntime

export_onnx(model, "badas3.onnx")                                                        # about 40 s
build_tensorrt_engine("badas3.onnx", "badas3_fp16.plan", fp16=True, optimization_level=5)   # about 30 min on an A100
runtime = TensorRTRuntime("badas3_fp16.plan", device="cuda:0", config=model.config)
out = runtime(inputs["pixel_values_videos"])                                             # the same BADAS3Output

The engine ranks the six candidates with the K-way selector inside the graph, using the head's own speed (it has no sensor input), and returns the head's classifier as trajectory_base_logits beside it; engines built with 3.0.0 lack that output and must be rebuilt.

With fp16=True the heads stay in float32 (fp32_heads=True), the split the evaluation harness uses (--dtype bf16: backbone bf16, heads fp32; BADAS3Model.warmup() instead casts the whole model to bf16); the heads are a few hundred small layers, so it costs nothing. TensorRT 10.16.1.11 cannot build this graph (a Myelin failure on the selector fusion); use the 10.13 line, which builds and verifies it. Check an engine on real windows, not only random ones: compare_runtimes reports nonfinite_windows.

TensorRT engines are bound to the GPU architecture, the TensorRT version and the driver, so no engine ships with the model: build one on the target machine, on an otherwise idle GPU (TensorRT times its kernels during the build, so a busy GPU yields a slower engine), with scripts/build_engine.py (--compare N also checks the engine against the PyTorch model on N real windows and times both). On an A100 the fp16 engine agreed with the fp32 model on real windows to 0.06 m over the 6.4 s future, with the mode argmax identical on every window and speed within 0.02 m/s.

Latency, A100, batch 1, one full BADAS3Output per two-second window (backbone, heads, integration), median, GPU otherwise idle: PyTorch after warmup() (compiled) about 43 ms, PyTorch eager about 146 ms (the paper's runtime table). Timings taken while the GPU is shared with other work come out 30 to 50 percent higher. Needs pip install -e ".[export]".

Examples

Eight notebooks under examples/ go from the first forward pass to deployment, evaluation, fine-tuning and the video overlay, each in a minute or two on one GPU. Each opens on Google Colab from its badge in examples/README.md; the first cell installs this release there and logs in to Hugging Face from a Colab secret. They are committed without outputs. One sample clip ships with the repository (Nexar Collision Prediction, used by notebooks 04 and 08); the other six download one PhysicalAI-AV clip from the gated NVIDIA dataset with your own access (instructions in examples/README.md).

Training and fine-tuning

badas3.training fine-tunes any head, or the stitcher, in plain PyTorch and saves the result with save_pretrained, so it loads back with from_pretrained. It ports the recipes that produced the shipped weights and includes adapters for two public datasets: Nexar Collision Prediction (risk) and NVIDIA PhysicalAI-AV (trajectory, pose, speed).

pip install -e ".[train]"
python -m badas3.training trajectory --config cfg.yaml      # also: pose_speed, risk, stitcher, cache, build_*

Labels, hyperparameters and how to fine-tune one head without touching the others: docs/TRAINING.md.

Evaluation

badas3.eval reproduces every published number from the official downloads: one adapter per upstream dataset (nuScenes, Argoverse 2, Waymo, PhysicalAI-AV, the Nexar Kaggle set, DAD, DoTA, DADA-2000, Euro NCAP renders, DCA-Bench) fetches, verifies against published checksums and prepares the BADAS format; shared tasks run the model and score. No third-party data is hosted: only id lists, checksums, our labels, predictions and results.

pip install -e ".[eval,video]"
python -m badas3.eval datasets                                   # sources, access, licences
python -m badas3.eval reproduce trajectory --raw RAW --work WORK --level rescore    # PASS / FAIL vs results/
python -m badas3.eval prepare video --raw my_clips/ --out OUT --set video     # encoder: imageio-ffmpeg's
python -m badas3.eval predict --root OUT --set video --out preds.jsonl               # your own videos

The user guide (concepts, the dataset table, reproducing everything, evaluating your own videos, adding a dataset) and the reference (formats, extraction rules, scoring): docs/EVALUATION.md. The published numbers (future trajectory, collision risk, ego pose, speed, Euro NCAP, DCA-Bench), generated from the pinned golden.json files: results/README.md.

Intended use and limitations

BADAS-3.0 is a research model for forward-facing camera video of road driving. It was trained and evaluated on 256x256 frames at 8 fps; other resolutions, frame rates, camera placements (side or rear views, interior cameras) and non-road footage are out of distribution. The speed head reads speed from appearance and under-reads on cameras outside its training range (about 0.76 of the true speed on Waymo); use a sensor or the few-shot scale where speed accuracy matters. The risk output is a probability for a 2 s window, not a safety guarantee, and the production thresholds (0.5 elevated, 0.8 high) were tuned on Nexar data. Nothing here is a certified driver-assistance system.

Troubleshooting

  • 401 or GatedRepoError on the first from_pretrained. Request access on the model page with the account you log in with, then hf auth login.
  • Wrong outputs (speed in the hundreds of km/h, flat risk) after loading. Every parameter must come from the checkpoint. tests/test_loading.py checks this against model.safetensors (set BADAS3_MODEL to a local copy). Versions of this package before 2026-09-09 loaded wrongly under transformers 5; update the package.
  • CUDNN_STATUS_SUBLIBRARY_LOADING_FAILED or an undefined libcudnn_graph symbol on the first convolution. A system cuDNN on LD_LIBRARY_PATH (common on cloud images) shadows the one PyTorch installed. The command-line tools (python -m badas3.eval, badas3.overlay, badas3.training), every step reproduce launches and the environments env build makes drop it by themselves; in your own Python process import badas3 warns about it, and the fix is to start that process without it: env -u LD_LIBRARY_PATH python ....
  • Notebooks open with a kernel prompt. Pick the kernel of the environment where you installed badas3.
  • The overlay writes no H.264 file. Install ffmpeg or pip install -e ".[video]"; without either, OpenCV's mp4v writer is used, which some players do not open.
  • torch.compile fails or is slow in warmup(). The first warmup() autotunes kernels for several minutes (about 7 on an A100 with torch 2.15) and logs its benchmarks; later processes reuse the inductor cache. Pass compile=False to skip it; eager runs at about 146 ms per window on an A100.

Provenance and licence

The weights were converted losslessly to fp32 from the training checkpoints, and the K-way selector was added in 3.1.0; config.lineage in config.json carries the sha256 of every component. The benchmarks that scored this model, with every input and result file, are in the datasets empiricearth/badas3-bench-future-trajectory, empiricearth/badas3-bench-ncap-crash-avoidance and empiricearth/badas3-bench-dca (golden.json in each); benchmarks/ in this repository re-scores and re-runs them.

Code and weights are released under the Apache License 2.0 (the weights: LICENSE-WEIGHTS, the same text); third-party material keeps its own terms, see NOTICE. Cite with CITATION.cff. Changes by version: CHANGELOG.md.

Next step

See what BADAS 3 does on your own driving: try it on sample clips or your own video in Empiric Earth Atlas.

Resources

Contact

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · video-classification

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Ревизия весов
745666b

0 моделей