Instructions to use alexha11/construction-tagger-yolo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use alexha11/construction-tagger-yolo 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("alexha11/construction-tagger-yolo", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Construction-site tagger: YOLO26n detector
A small detector (YOLO26n, 2.5 million parameters) that tags photographs from fibre and utility construction sites with a 29-tag company taxonomy. It is the comparison with conventional computer vision in an M.Sc. thesis whose main model is a fine-tuned vision-language model (alexha11/construction-tagger-thesis).
The labels have no boxes. Each tag of a photograph became a box that covers the whole image, so the detector learns which tags are in a photograph, not where the objects are. Read each predicted class as a tag, and ignore the box.
Files
There are three runs of the same recipe. They differ only in the random seed.
| Folder | Seed | Micro-F1 | Macro-F1 | Work-phase accuracy |
|---|---|---|---|---|
seed42/ |
42 | 0.858 | 0.563 | 0.971 |
seed1337/ |
1337 | 0.848 | 0.575 | 0.953 |
seed7/ |
7 | 0.851 | 0.557 | 0.971 |
| mean | 0.852 (sd 0.005) | 0.565 | 0.965 |
seed42/ is the one the thesis demo uses. Each folder holds the weights
(best.pt), the training settings (args.yaml) and the training log
(results.csv).
The scores are on 283 held-out test photographs with human-corrected labels, at a confidence threshold of 0.20. They come from the same scoring code as the vision-language models in the thesis. For comparison, the thesis model gets 0.901 micro-F1 on the same photographs.
Training
- Start weights:
yolo26n.pt - Data: 1,370 training photographs with corrected labels. A tenth of them is kept out of training to choose the best epoch.
- 50 epochs at most, early stop after 15 epochs without improvement, 640 px, batch 8, learning rate 0.001
Use
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model = YOLO(hf_hub_download("alexha11/construction-tagger-yolo", "seed42/best.pt"))
result = model.predict("photo.jpg", conf=0.20)[0]
tags = {}
for box in result.boxes:
tag = result.names[int(box.cls)]
tags[tag] = max(tags.get(tag, 0.0), float(box.conf))
print(tags)
Limits
- It was trained on photographs from one company's sites in Finland. It can do worse on other sites, cameras or kinds of work.
- It has no box locations. Its boxes cover the whole image.
- Rare tags do not work. Seven tags with 5 to 38 training photographs score 0 on
the test photographs:
branching_point,cable_drum,electricity_duct,maintained_grass,manhole,safety_barrierandtelecom_duct. Each has only 1 to 7 test photographs, so these scores are uncertain.
License
The weights are fine-tuned from Ultralytics YOLO26n, which is under AGPL-3.0, so these weights are under AGPL-3.0 too.
- Downloads last month
- -