Instructions to use CceJJ/qwen-drive-4b-perception-bev7 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CceJJ/qwen-drive-4b-perception-bev7 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import QwenDriveForPlanning model = QwenDriveForPlanning.from_pretrained("CceJJ/qwen-drive-4b-perception-bev7", device_map="auto") - Notebooks
- Google Colab
- Kaggle
You need to agree to share your Hugging Face information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This model was trained on the Wayve LingoQA dataset. Under the LingoQA licence it may be made available only on an academic or scientific basis and free of charge, and it may not be used in the operation of a vehicle or robot, to assist in the operation of a vehicle or robot, or for any high-risk purpose. It was also trained on nuReasoning and NAVSIM / nuPlan images (Motional data, CC BY-NC-SA 4.0 plus Motional's Dataset Terms of Use) and on IDKB, and it inherits the training data of Qwen-Drive-1.0-4B. Access is granted for academic, non-commercial research only.
Log in or Sign Up to review the conditions and access this model content.
Qwen-Drive-1.0-4B with a 7-class BEV map head (nuReasoning)
Academic or scientific use only, free of charge. This model was trained on or refined using the Wayve LingoQA dataset. It may be shared only on an academic or scientific basis and free of charge.
Not for use in operating a vehicle or robot. Do not use it in the operation of a vehicle or robot, to assist in such operation, or for any high-risk purpose (anything that risks damage to property, personal injury or death).
This work was made using the Wayve LingoQA dataset and benchmark, provided by Wayve Technologies Ltd under licence terms available at https://github.com/wayveai/LingoQA.
What it is
- Qwen-Drive-1.0-4B (a Qwen3.5-4B vision-language model plus a BEV perception head), fine-tuned on nuReasoning driving data.
- The BEV perception head's map output has 7 classes instead of the original 6. The new class is
construction_zone. - This repository holds the fine-tuned VLM and the fine-tuned perception head. It does not hold a planner. The original planner heads are in the base model repository; they were trained with the base VLM.
Inputs and outputs
Input: 8 surround cameras, each resized to 896 ร 512, in the upstream perception frame format (a prompt with view tags and images, camera calibrations). Camera order used in training: front, front-right, right, back-right, back, back-left, left, front-left.
3D boxes: up to 300 boxes in the lidar frame, range ยฑ51.2 m in x and y. 7 detection classes:
vehicle,czone_sign,bicycle,generic_object,pedestrian,traffic_cone,barrier.generic_objectandbarrierwere not supervised in our fine-tuning (no matching labels). Their outputs come from the base model and are not reliable on this data.
BEV map: 200 ร 400 cells of 0.15 m, x from โ30 m to +30 m (forward), y from โ15 m to +15 m. 7 classes:
index class 0 background 1 driveable_surface 2 road_line 3 road_edge 4 crosswalk 5 walkway (not supervised: no labels in nuReasoning) 6 construction_zone (new) Occupancy: a 200 ร 200 ร 16 voxel grid with 10 classes, as in the base model. It was trained further but not evaluated here.
Text: the VLM still answers prompts like the base model. It was fine-tuned on driving question answering (see the data below).
How it was made
- Base: Qwen-Drive-1.0-4B (VLM and perception head).
- Stage 1 (head only): the perception head trained on nuReasoning perception frames; the VLM unchanged.
- Stage 2 (this model): VLM, vision encoder and head trained together for 3,770 steps at global batch 128
(482,560 rows). 12.5 % of rows are perception frames; the rest are language rows (12 % nuReasoning reasoning
question answering, 88 % a driving question-answering mix, listed below). AdamW, VLM lr 5e-6 (head ร20, vision
encoder ร0.2), cosine schedule, 5 % warm-up.
- The map head's last layer was widened from 6 to 7 outputs. The 6 old rows were copied exactly. The new
construction_zonerow started from thedriveable_surfacerow with a prior of 0.048 (the class's share of train map cells). - The construction-zone map labels were derived by us, with fixed rules, from nuReasoning train annotations.
- The map head's last layer was widened from 6 to 7 outputs. The 6 old rows were copied exactly. The new
Training data
No nuReasoning validation or test data was used for training. All nuReasoning data came from the train split, and only from 7,911 of its 9,895 clips; the other 1,984 train clips were held out for evaluation.
| data | rows | terms (check them yourself) |
|---|---|---|
| nuReasoning train: perception frames (8 cameras, 3D boxes, map, occupancy, construction-zone masks) | 318,286 frames | Motional: CC BY-NC-SA 4.0 plus Dataset Terms of Use |
| nuReasoning train: reasoning question answering | 102,809 | same |
| nuReasoning train: other driving question answering made from its annotations | 139,697 | same |
| LingoQA (Wayve) | 28,745 | Wayve Dataset Licence Agreement for Non-Commercial Use |
| IDKB | 11,055 | see the IDKB repository; terms of the source material not confirmed |
| NAVSIM (nuPlan images) question answering | 6,088 | nuPlan: Motional terms (CC BY-NC-SA 4.0 plus Dataset Terms) |
| everything Qwen-Drive-1.0-4B was trained on (inherited) | โ | see the base model card; its data includes nuScenes, OpenScene / nuPlan, NAVSIM, Waymo (WOD-E2E, WaymoQA), PhysicalAI-AV, LingoQA, DriveLM and other public driving VQA sets |
The language rows were sampled from these sets during the 3,770 steps.
Results (held-out nuReasoning train clips)
Measured on 500 frames from 457 nuReasoning train clips that were held out from all training of this model. This is not the official validation split. The labels use the 7-class map. Detection AP is centre-distance AP in the bird's-eye view, averaged over 0.5 / 1 / 2 / 4 m thresholds; recall uses score โฅ 0.3 and a 2 m match radius.
Map IoU:
| class | IoU |
|---|---|
| background | 0.820 |
| driveable_surface | 0.712 |
| road_line | 0.560 |
| road_edge | 0.551 |
| crosswalk | 0.641 |
| walkway | 0.000 (not supervised) |
| construction_zone | 0.468 |
| driveable_surface โช construction_zone | 0.749 |
Detection:
| class | AP | recall |
|---|---|---|
| vehicle | 0.505 | 0.673 |
| czone_sign | 0.195 | 0.354 |
| bicycle | 0.327 | 0.510 |
| generic_object | 0.183 | 0.042 |
| pedestrian | 0.375 | 0.553 |
| traffic_cone | 0.475 | 0.629 |
| mean (6 classes above) | 0.343 |
- Compared with the same recipe trained with the 6-class map, road edge IoU is 0.014 lower: road edges inside closed lanes are now often drawn as construction zone. The other map classes are equal or better.
- On the same frames, the base model (without our fine-tuning) gets vehicle recall 0.470 (this model 0.673) and driveable_surface โช construction_zone IoU 0.578 (this model 0.749).
- Results come from one dataset (US cities) and one camera rig. Other data may give different results.
Known limitations
- The map covers only 30 m ahead and 30 m behind, and 15 m to each side.
- Construction zones far from the vehicle are often missed or drawn too small.
- Road edge is slightly worse than with a 6-class map (see above).
walkway,generic_objectandbarrierwere not supervised in our fine-tuning.- Detection range is ยฑ51.2 m.
- Language answers were not checked for safety or factual accuracy.
Intended use
Academic research on perception and scene understanding for driving, free of charge. Not for use in, or to assist, the operation of a vehicle or robot, and not for any high-risk purpose.
Files
| file | what |
|---|---|
model.safetensors, config.json, generation_config.json |
the fine-tuned VLM (same format and config as the base model) |
tokenizer.json, tokenizer_config.json, vocab.json, merges.txt, chat_template.jinja, chat_template.json, preprocessor_config.json |
tokenizer and processor files, unchanged from the base model |
perception/model.safetensors, perception/config.json |
the 7-class perception head |
load_bev7.py |
loader for the 7-class head with the upstream code |
LICENSE.Qwen-Drive-Apache-2.0 |
the base model's licence |
How to run
You need the upstream code: https://github.com/QwenLM/Qwen-Drive-1.0 (tested at commit 28091c1), with its
environment (the perception head compiles two CUDA kernels on first use).
The upstream perception code builds the map layer with 6 outputs, so QwenDrivePerception.from_pretrained alone fails
on this head with a size mismatch. load_bev7.py builds that one layer with 7 outputs; then every tensor loads with
matching shapes. Nothing else in the upstream code needs to change.
import torch
from transformers import AutoTokenizer
from qwen_drive import QwenDriveForPlanning
from qwen_drive_perception.dataset import PerceptionFrame, PerceptionProcessor
from load_bev7 import load_perception_head, MAP_CLASS_NAMES_BEV7
root = "<local copy of this repository>"
holder = QwenDriveForPlanning.from_pretrained(root, dtype=torch.bfloat16, attn_implementation="sdpa")
vlm = holder.vlm
head = load_perception_head(root + "/perception", dtype=torch.bfloat16).to("cuda").eval()
processor = PerceptionProcessor(AutoTokenizer.from_pretrained(root))
head.attach(vlm.to("cuda").eval(), processor)
frame = PerceptionFrame("<frame directory in the upstream perception format>")
with torch.inference_mode():
inputs, metas = processor(frame, device="cuda")
out = head.infer(inputs, metas) # boxes, scores, labels, occ, map (map values 0..6)
For the frame format, see docs/perception.md in the upstream repository. To draw the map with the new class, extend
the upstream palette by one colour.
Licence and terms
- Licence of this release: academic, non-commercial research only, free of charge. This follows from the strictest of the training-data terms below.
- LingoQA (Wayve Dataset Licence Agreement for Non-Commercial Use, February 2024): "You agree (a) not to distribute or publish or otherwise make available any models trained on or refined using the Dataset, or the parameters from such trained models, in whole or in part unless such model and/or its parameters are being distributed or published on an academic or scientific basis and free of charge; and (b) not to use or deploy the Dataset, any models trained on or refined using the Dataset, or the parameters from such trained models, in whole or in part, (i) in operation of a vehicle or robot or to assist in the operation of a vehicle or robot, or (ii) for any high-risk purpose, including without limitation any use that risks damage to property, personal injury or death." Attribution: "This work was made using the Wayve LingoQA dataset and benchmark, provided by Wayve Technologies Ltd under licence terms available at https://github.com/wayveai/LingoQA."
- nuReasoning and nuPlan (Motional): the nuReasoning licence file
(https://huggingface.co/datasets/nureasoning/nuReasoning,
LICENSE-NONCOMMERCIAL.md) says: "For non-commercial use of this dataset or related materials, please refer to the official nuScenes Terms of Use (https://www.nuscenes.org/terms-of-use)." Those terms state: "Unless specifically labeled otherwise, these Datasets are provided to You under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License (โCC BY-NC-SA 4.0โ), with the additional terms included herein." and "Use of any data derived from the Datasets, which may appear in any format such as tables and charts, is also subject to these Dataset Terms." This release is not endorsed by Motional. - IDKB: the repository https://github.com/4DVLab/IDKB carries an MIT licence; we found no separate data terms. Check them yourself.
- Base model: Qwen-Drive-1.0-4B is released under the Apache License 2.0 (see
LICENSE.Qwen-Drive-Apache-2.0). This repository contains modified versions of its weights: the VLM and the perception head were fine-tuned, and the map head's last layer was widened from 6 to 7 classes. The tokenizer and processor files are unchanged. The base model's own training data (including Waymo data, PhysicalAI-AV and other driving VQA sets) has its own terms, which also apply.
Acknowledgements
- Qwen-Drive-1.0 (Qwen Team and Huazhong University of Science and Technology), https://github.com/QwenLM/Qwen-Drive-1.0.
- nuReasoning, nuScenes and nuPlan datasets (Motional).
- This work was made using the Wayve LingoQA dataset and benchmark, provided by Wayve Technologies Ltd under licence terms available at https://github.com/wayveai/LingoQA.
- IDKB (4DVLab). NAVSIM.
- Downloads last month
- 2