Instructions to use swedishtech/RAQEEB-CCTV with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use swedishtech/RAQEEB-CCTV with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("swedishtech/RAQEEB-CCTV", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
RAQEEB-CCTV v1.0.0
Floor-plan element segmentation for CCTV planning. One YOLO11s-seg model that finds and outlines eleven building elements on architectural floor plans: walls, doors, windows, open passages, columns, stairs, lifts, escalators, exit markers, gates and rooms/spaces. Each detection is a polygon mask with a bounding box, a class name and a confidence. The model works on raster plans (PNG, JPEG, scanned or exported PDF), and a companion tool runs it on AutoCAD drawings (DWG/DXF) and writes the labelled boxes back into the drawing.
It was trained on 62,205 labelled plan images merged from 16 public sources, with a partial-label training scheme so that datasets which only annotate some classes do not teach the model that the other classes are background.
| Version | 1.0.0 (2026-11-14) |
| Architecture | YOLO11s-seg, 10.1 M parameters, 1024 px input |
| Weights | raqeeb-cctv-v1.0.0.pt (20.6 MB, fp16) + thresholds.json |
| Held-out test | mask mAP50 0.691, mask mAP50-95 0.427, box mAP50-95 0.567 (1,682 images) |
| AutoCAD check | real DWG, held-out floors: doors 96-99% found; stairs/rooms partly; walls, windows, columns not reliable (details) |
| Licence | CC BY-NC 4.0 (non-commercial; inherited from CubiCasa5K and FloorPlanCAD) |
Classes
| id | class | what it marks | test mask mAP50 | status |
|---|---|---|---|---|
| 0 | wall |
wall thickness, cut at openings | 0.530 | usable |
| 1 | door |
doorway / portal footprint | 0.820 | strong |
| 2 | window |
glazing / opening along a wall | 0.636 | usable |
| 3 | open_passage |
opening without a door | 0.434 | weak (few examples) |
| 4 | column |
structural column / pillar | 0.300 | weak |
| 5 | stair |
stair flights and landings | 0.761 | strong |
| 6 | elevator |
lift car / shaft | 0.974 | strong |
| 7 | escalator |
escalator footprint | 0.606 (4 instances) | not validated |
| 8 | exit_marker |
printed exit / egress sign | 0.952 | strong |
| 9 | gate |
pedestrian / vehicle gate | — | not supported (no training data) |
| 10 | space_region |
room, corridor or defined zone | 0.898 | strong |
Quick start
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights = hf_hub_download("swedishtech/RAQEEB-CCTV", "raqeeb-cctv-v1.0.0.pt", revision="v1.0.0")
model = YOLO(weights)
result = model.predict("plan.png", imgsz=1024, conf=0.25)[0] # whole plan, no tiling
for box, cls, conf in zip(result.boxes.xyxy, result.boxes.cls, result.boxes.conf):
print(model.names[int(cls)], round(float(conf), 2), box.tolist())
result.save("plan_detections.jpg")
For best results use the per-class operating thresholds in thresholds.json (chosen on the
validation split) instead of one global conf. The scripts in code/ do this for you
(pip install -r code/requirements.txt):
# labelled boxes + before/after image for PNG / JPEG / PDF pages
python code/annotate_raqeeb.py plan.pdf --weights raqeeb-cctv-v1.0.0.pt --thresholds thresholds.json --out out/
# polygons in page coordinates + review queue (JSON) and overlays
python code/infer_raqeeb.py plan.pdf --weights raqeeb-cctv-v1.0.0.pt --thresholds thresholds.json --output out/
# AutoCAD drawing: labelled boxes on the drawing and back inside a copy of the DWG (one layer per class)
python code/cad_raqeeb.py drawing.dwg --weights raqeeb-cctv-v1.0.0.pt --thresholds thresholds.json --out out/ \
--region floor1=x0,y0,x1,y1 --px-per-unit 0.1 --plot
Use whole pages for raster plans. The model was trained on whole plans resized to 1024 px. Cutting a 300 dpi
page into 1024 px tiles makes rooms about three times larger than anything seen in training and produces false,
tile-shaped room regions; infer_raqeeb.py and annotate_raqeeb.py therefore default to whole-page inference.
CAD drawings are the exception: they are rendered at a fixed drawing scale and tiled (see below).
Results
Held-out test split
1,682 images whose drawings never appear in training (splits are grouped by near-duplicate drawing). Each image is
scored only on the classes its source fully annotates (see Partial labels). conf 0.001,
max_det 1500, 1024 px.
| class | instances | images | mask P | mask R | mask mAP50 | mask mAP50-95 | best F1 |
|---|---|---|---|---|---|---|---|
| wall | 30,469 | 1,061 | 0.620 | 0.513 | 0.530 | 0.230 | 0.564 |
| door | 7,579 | 893 | 0.843 | 0.737 | 0.820 | 0.488 | 0.789 |
| window | 7,326 | 652 | 0.703 | 0.664 | 0.636 | 0.257 | 0.685 |
| open_passage | 47 | 23 | 0.516 | 0.298 | 0.434 | 0.140 | 0.449 |
| column | 154 | 36 | 0.621 | 0.247 | 0.300 | 0.072 | 0.379 |
| stair | 426 | 225 | 0.737 | 0.736 | 0.761 | 0.511 | 0.751 |
| elevator | 142 | 75 | 0.898 | 0.965 | 0.974 | 0.833 | 0.939 |
| escalator | 4 | 3 | 0.436 | 0.970 | 0.606 | 0.507 | 0.615 |
| exit_marker | 76 | 24 | 0.804 | 0.974 | 0.952 | 0.526 | 0.943 |
| gate | 0 | 0 | — | — | — | — | — |
| space_region | 2,032 | 136 | 0.865 | 0.863 | 0.898 | 0.705 | 0.867 |
| all | 48,255 | 1,682 | 0.691 | 0.427 |
Walls and windows are long, thin shapes, so the strict mask mAP50-95 stays low even when their boxes are right (wall box mAP50-95 is 0.38 on validation against 0.21 for the mask).
Validation split (2,252 images): mask mAP50 0.616, mask mAP50-95 0.351, box mAP50-95 0.477
(metrics/val_METRICS.txt).
Against the project's previous model (same test images, same scoring; only 5 of the 1,682 images come from drawings that model saw in training):
| model | mask mAP50 | mask mAP50-95 | box mAP50-95 |
|---|---|---|---|
| RAQEEB-CCTV v1.0.0 | 0.691 | 0.427 | 0.567 |
| previous 11-class research model (334 training views) | 0.108 | 0.055 | 0.059 |
Before and after: held-out test images
Every image below is from the test split; they were chosen by which classes they contain, not by how well the model
did. "Correct" means a predicted box overlaps a ground-truth box of the same class with IoU >= 0.5 (one-to-one),
counted only for the classes that source annotates (metrics/gallery_check.json).
Architectural plan (CubiCasa5K) — CubiCasa5K (high_quality_architectural/416), CC BY-NC 4.0. Correct / ground truth: wall 37/41 (42 predicted), door 9/10 (10 predicted), window 8/11 (9 predicted), open_passage 1/1, column 7/7 (10 predicted), stair 1/1, space_region 12/16 (14 predicted).
CAD sheet (FloorPlanCAD) — FloorPlanCAD (CAD drawing crop), CC BY-NC 4.0. Correct / ground truth: door 18/19 (21 predicted), window 0/13, stair 1/1, elevator 0/1 (1 predicted).
CAD sheet with escalator (FloorPlanCAD) — FloorPlanCAD (CAD drawing crop), CC BY-NC 4.0. Correct / ground truth: door 5/5 (6 predicted), escalator 0/1.
Lifts, stairs and spaces — Roboflow Universe kt/floor-spac, CC BY 4.0. Correct / ground truth: stair 2/2, elevator 2/2, space_region 19/29.
Evacuation plan with exit signs — Roboflow Universe tw/evacuation-plan, CC BY 4.0. Correct / ground truth: exit_marker 9/9.
Working-drawing sheet — Roboflow Universe Doxle/floor-plan, CC BY 4.0. Correct / ground truth: wall 16/20 (18 predicted), door 7/9 (8 predicted), window 9/10 (11 predicted), stair 1/1.
Residential plan — Roboflow Universe Floorplanes/training-ai, CC BY 4.0. Correct / ground truth: wall 14/26 (19 predicted), door 2/9, window 5/5.
Simple floor plan — Roboflow Universe simple-floor-plan/floor-plan, CC BY 4.0. Correct / ground truth: door 6/17 (10 predicted), window 1/21 (6 predicted).
AutoCAD drawing check
Checked on a real AutoCAD drawing: the teaching-building construction drawing (DWG, drawn with TArch) from
Men (2021), CC BY 4.0. code/cad_raqeeb.py opened the DWG with AutoCAD 2026 (headless
accoreconsole), rendered each floor at 0.1 px per mm (100 px per metre, the scale of the CAD training images) in
1024 px tiles, ran the model with the operating thresholds, drew every detection as a box with its class name, and
wrote the boxes back into the drawing: 597 detections became 1,194 new entities (a rectangle and a
class confidence text each) on layers RAQEEB-DOOR, RAQEEB-WALL, ... AutoCAD then plotted the annotated drawing
to PDF; the plot images below are AutoCAD's own output. The annotated drawing is in
examples/autocad/ (DXF, opens in AutoCAD).
Because the drawing was made with TArch, its own objects are a ground truth: door, window and column blocks, the
WALL and STAIR layers and the room-name texts. The render scale was chosen on the second floor
(metrics/cad_verification.json); the ground and third floors below were not used
for any choice.
| class (truth = the drawing's own objects) | ground floor | third floor |
|---|---|---|
| door: found / in drawing | 88 / 92 | 95 / 96 |
| door: detections that are real doors | 65% | 77% |
| stair: found / stair groups | 4 / 18 | 6 / 10 |
| room-name texts inside a predicted space | 21 / 62 | 15 / 66 |
| window: found / in drawing | 4 / 47 | 5 / 61 |
| column: found / in drawing | 0 / 119 | 0 / 106 |
| WALL-layer lines covered by a wall mask | 4% | 3% |
"Found" means the detection box covers at least half of the smaller of the two boxes (TArch door blocks include the swing arc, many training labels do not; with strict box IoU >= 0.5, 52 and 51 doors match).
Verdict for AutoCAD drawings (v1.0.0): the pipeline works end to end, and boxes and class names appear in AutoCAD on their own layers. On this drawing the model reliably marks doors, partly marks stairs and rooms, and does not reliably mark walls, windows or columns drawn in thin-line CAD style. Treat CAD output for those classes as unsupported in this version. (Two small re-rendered crops of this building, a stairwell and a freight lift, were in the training data; the evaluated floors were not.)
AutoCAD's plot of the annotated drawing (third floor, detail):
Same area, rendered drawing before and after:
Whole ground floor (labels readable when zoomed in):
Intended use and limits
Intended use: research and non-commercial pre-processing of floor plans for CCTV / security planning: finding doors, stairs, lifts, exits and rooms so that a person can plan camera coverage faster. Every output should be reviewed by a person; the inference scripts put low-confidence and unvalidated detections in a review queue.
Not suitable for: commercial use (licence), safety-critical decisions such as certifying emergency exits, or any use without human review.
Known limits:
- gate has no labelled training data anywhere in the inventory (4 instances); treat gate output as absent.
- escalator has 360 training instances (all from FloorPlanCAD) and only 2 validation / 4 test instances; its threshold is unvalidated and every escalator detection goes to review.
- column and open_passage are weak (few or inconsistent examples).
- AutoCAD / CAD drawings: see the check above. Doors and stairs transfer well; CAD walls drawn as thin double lines, CAD windows and small solid columns are largely missed, because the CAD training source (FloorPlanCAD) was converted only for doors, windows, stairs, lifts and escalators, and the wall/column/room knowledge comes from raster plans.
- Sources disagree on conventions (e.g. some Roboflow sets draw wall boxes straight across door openings); the model inherits some of that inconsistency.
- The model detects symbols and footprints; it does not decide which doors are emergency exits, entrances or interior/exterior. Those need schedules, signage or a reviewer.
Training data
All sources listed in the project inventory that carry labels. Images were deduplicated and split by perceptual-hash drawing groups so near-duplicates of one drawing never straddle train and test.
| source | licence | labelled classes used (fully annotated) | train | val | test |
|---|---|---|---|---|---|
| CubiCasa5K | CC BY-NC 4.0 | wall, door, window, open_passage, column, stair, space_region | 4,799 | 120 | 81 |
| FloorPlanCAD | CC BY-NC 4.0 | door, window, stair, elevator, escalator | 15,113 | 300 | 250 |
| Floorplanes / training-ai | CC BY 4.0 | wall, door, window | 11,252 | 300 | 250 |
| Doxle / floor-plan | CC BY 4.0 | wall, door, window, stair | 3,910 | 290 | 241 |
| Floorplan-Segmentation | CC BY 4.0 | wall, door, window (+ rooms, partial) | 5,306 | 48 | 29 |
| kt / floor-plan | CC BY 4.0 | wall, door, window | 1,213 | 181 | 67 |
| Segmenting a Floor Plan | CC BY 4.0 | door, window (+ rooms, partial) | 1,499 | 39 | 31 |
| Floorplanes / walls | Public Domain | wall | 1,704 | 256 | 209 |
| Floorplanes / doors-detection2 | CC BY 4.0 | door | 4,236 | 300 | 250 |
| Floorplanes / doors-detection | CC BY 4.0 | window | 3,997 | 2 | 1 |
| kt / floor-spac | CC BY 4.0 | stair, elevator, space_region | 963 | 96 | 43 |
| ArchitecturalBlueprints | CC BY 4.0 | column (+ walls, partial) | 99 | 10 | 4 |
| tw / evacuation-plan | CC BY 4.0 | exit_marker (+ stairs, partial) | 635 | 54 | 27 |
| Testing / floor-plan-walls | CC BY 4.0 | wall | 6,969 | 225 | 178 |
| simple-floor-plan / floor-plan | CC BY 4.0 | door, window (+ rooms, partial) | 198 | 21 | 9 |
| earlier project review set (CubiCasa5K-derived plus a few CC BY sources) | CC BY-NC 4.0 / CC BY 4.0 | all 11 classes | 312 | 10 | 12 |
| total | 62,205 | 2,252 | 1,682 |
Excluded: a 60-image "columns" set that turned out to be wine-rack photographs, and 2,402 images with no annotations
at all. FloorPlanCAD drawings were rendered from the vector data at 1536 px and their symbol primitives grouped into
instance polygons; CubiCasa5K SVG annotations were converted to polygons (walls cut at openings).
Per-class training instances: wall 1,075,001 · door 279,157 · window 283,206 · space_region 99,286 · stair 13,479 ·
column 11,808 · elevator 4,360 · open_passage 2,330 · exit_marker 2,128 · escalator 360 · gate 4
(data/dataset_summary.json).
Training method
Merging 16 datasets that each label a different subset of the classes needs care: a doors-only dataset contains unlabelled walls, and naive training would teach the model that those walls are background.
- Partial labels.
data/label_sets.jsonrecords, per source and per image, which classes are exhaustively annotated ("full") and which only contribute positives ("partial"). In the classification loss the negative (background) term is applied only to an image's full classes; positives always count (loss * max(full_mask, target > 0)). 9,351 images have per-image overrides, e.g. 58% of one large source labels walls but not doors/windows on many sheets. - Label-set-aware mosaic. Mosaic augmentation only combines images with the same label set, so a fully labelled tile is never pasted next to a partially labelled one.
- Label-set-aware validation. Predictions and ground truth are filtered to each image's full classes before scoring, which is also how all numbers on this card were computed.
- Leak-free splits. Images are grouped by perceptual hash of the drawing (very large near-duplicate groups stay in train), with per-source validation/test budgets.
- Rare-class repeat sampling (LVIS-style repeat factor, threshold 0.08, capped at 4x): training images with escalators are repeated 4x, exit markers about 3x, open passages about 2x (67,170 training entries in total).
Hyper-parameters (data/train_args.yaml): COCO-pretrained YOLO11s-seg, 40 epochs, SGD
(lr 0.01 -> 0.0005 cosine, momentum 0.937, weight decay 5e-4, 2 warm-up epochs), batch 20 (10 per GPU), 1024 px,
mosaic (closed for the last 8 epochs), scale 0.5, translate 0.1, horizontal and vertical flips, HSV jitter, AMP,
mask ratio 4, max 800 detections. Trained on two RTX 3090s with Windows DDP (gloo, fp16 gradient compression) in
11.4 hours; the final epoch had the best validation fitness and is the released checkpoint.
Training code: code/raqeeb_trainer.py, code/train_raqeeb.py,
dataset builder code/build_dataset.py (paths are those of the original machine).
Operating thresholds
thresholds.json: per-class confidence at the class's maximum mask F1 on the validation split,
clipped to [0.05, 0.9].
| wall | door | window | open_passage | column | stair | elevator | escalator | exit_marker | gate | space_region |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.28 | 0.30 | 0.35 | 0.18 | 0.09 | 0.41 | 0.71 | 0.68* | 0.33 | 0.50* | 0.38 |
* unvalidated (fewer than 30 validation instances); detections of these classes always go to human review.
Files
| path | contents |
|---|---|
raqeeb-cctv-v1.0.0.pt |
released weights (Ultralytics checkpoint, loads with YOLO(...), no custom code needed) |
thresholds.json |
validation-selected per-class operating thresholds |
config.json |
version, classes, recommended inference settings |
checkpoints/ |
training checkpoints every 5 epochs (epoch0 ... epoch35) and last.pt, with optimizer state |
metrics/ |
validation and test metrics (JSON + text), comparison with the previous model, training log (training_results.csv), gallery and AutoCAD checks |
images/ |
before/after examples, AutoCAD verification images, training curves |
examples/autocad/ |
the AutoCAD check drawing with RAQEEB layers (DXF) and the detections per floor (JSON) |
code/ |
inference, annotation, AutoCAD, evaluation and training code |
data/ |
label-set definitions, dataset statistics, training arguments |
Licence and attribution
The weights are released under CC BY-NC 4.0 because they are trained on CubiCasa5K and FloorPlanCAD (both CC BY-NC 4.0). The Roboflow Universe datasets above are CC BY 4.0 (one is Public Domain); thanks to their authors. The AutoCAD check uses the teaching-building drawing from Men, Y. (2021), 3D indoor navigation network model, figshare, doi:10.6084/m9.figshare.15170475.v1 (CC BY 4.0). The model runs on Ultralytics YOLO, which is AGPL-3.0 licensed; using the Ultralytics library is subject to its licence.
@misc{raqeeb_cctv_2026,
title = {RAQEEB-CCTV: floor-plan element segmentation for CCTV planning},
author = {{RAQEEB-CCTV contributors}},
year = {2026},
version = {1.0.0},
url = {https://huggingface.co/swedishtech/RAQEEB-CCTV}
}
@inproceedings{kalervo2019cubicasa5k,
title = {CubiCasa5K: A Dataset and an Improved Multi-Task Model for Floorplan Image Analysis},
author = {Kalervo, Ahti and Ylioinas, Juha and H{\"a}iki{\"o}, Markus and Karhu, Antti and Kannala, Juho},
booktitle = {Scandinavian Conference on Image Analysis (SCIA)},
year = {2019}
}
@inproceedings{fan2021floorplancad,
title = {FloorPlanCAD: A Large-Scale CAD Drawing Dataset for Panoptic Symbol Spotting},
author = {Fan, Zhiwen and Zhu, Lingjie and Li, Honghua and Chen, Xiaohao and Zhu, Siyu and Tan, Ping},
booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
year = {2021}
}
@software{yolo11_ultralytics,
title = {Ultralytics YOLO11},
author = {Jocher, Glenn and Qiu, Jing},
year = {2024},
url = {https://github.com/ultralytics/ultralytics}
}
Version history
- 1.0.0 (2026-11-14): first release. 62,205 training images from 16 sources, partial-label training, validation-selected thresholds, AutoCAD tool.
- Downloads last month
- 322
Evaluation results
- mask mAP50 on RAQEEB merged floor-plan test split (1,682 held-out images)test set self-reported0.691
- mask mAP50-95 on RAQEEB merged floor-plan test split (1,682 held-out images)test set self-reported0.427
- box mAP50-95 on RAQEEB merged floor-plan test split (1,682 held-out images)test set self-reported0.567











