sergiudanstan/motor-nameplate-labels
Motor Nameplate — Auto-Labeled (OCR + Qwen2.5-1.5B) Motor Nameplate — Auto-Labeled (OCR + Qwen2.5-1.5B) A derived dataset that adds structured field annotations to the sergiudanstan/motor-nameplate image collection (286 motor-nameplate photos from Google Images). The original upstream dataset ships images only. This repo adds an auto-labeling pipeline output, ready for downstream fine-tuning of a vision-language model for nameplate field extraction.… See the full description on the dataset page: https://huggingface.co/datasets/sergiudanstan/motor-nameplate-labels.
Motor Nameplate — Auto-Labeled (OCR + Qwen2.5-1.5B)
Motor Nameplate — Auto-Labeled (OCR + Qwen2.5-1.5B)
A derived dataset that adds structured field annotations to the `sergiudanstan/motor-nameplate` image collection (286 motor-nameplate photos from Google Images).
The original upstream dataset ships images only. This repo adds an auto-labeling pipeline output, ready for downstream fine-tuning of a vision-language model for nameplate field extraction.
What you get
The seven structural fields use "unclear" (string) when the field could not be read.
Top manufacturers extracted
9 × SIEMENS 4 × Baldor 4 × WEG 4 × ABB
2 × NEMA 2 × MALMBERGS 2 × Seas 2 × EMERSON
2 × TOSHIBA 2 × Innomotics 1 × GRUNDFOS 1 × Boilermaker Motor CompanyPipeline
- Tesseract OCR (
run_ocr.py) — parallel over 6 workers, 9.9 s for 286 images. 257/286 produce non-trivial text (>10 chars); 54 images are blank or near-blank (mostly explanatory diagrams, no plate text).
- Qwen2.5-1.5B-Instruct (4-bit, MLX) (
extract_fields.py) — receives the OCR text + strict JSON schema prompt, returns a structured dict per image. ~8 min for 257 non-empty texts on M4 Pro 16 GB.
- Merge (
merge_labels.py) — combines all sources (current labels are LLM-extracted; the pipeline supports manual overrides viacorrections.json).
- Splits (
make_splits.py) — 80/20 stratified by manufacturer, in SmolVLM conversation format (train.jsonl/eval.jsonl, 144 + 36 examples after filtering rows with ≥2 fields).
Layout
.
├── README.md # this file
├── labels_final.json # 286 entries, the full per-image label set
├── train.jsonl # 144 entries, SmolVLM conversation format
├── eval.jsonl # 36 entries, SmolVLM conversation format
├── ocr_text/<stem>.txt # raw Tesseract output per image (286 files)
├── annotations_v2.json # raw LLM output (incl. raw_ocr + llm_raw)
├── annotations.json # legacy run (broken SmolVLM2-2.2B attempt, kept)
├── run_ocr.py # step 1
├── extract_fields.py # step 2
├── merge_labels.py # step 3
├── make_splits.py # step 4
├── finetune.py # (work-in-progress) SmolVLM-256M LoRA trainer
├── finetune_notes.md # what blocked the fine-tune, how to continue
├── correct.html # optional: web UI for manual corrections
└── 01.jpg … 286.jpg # the original nameplate imagesTotal repo size: ~10 MB (286 thumbnails + OCR text + scripts).
Loading
from datasets import load_dataset
ds = load_dataset("sergiudanstan/motor-nameplate-labels", split="train")
# Each row has: filename, manufacturer, hp_or_kw, voltage, rpm, phase,
# frame, model_or_serial, visible_text, sourceQuality & known limitations
- Auto-labels, no human review. Roughly 70% field coverage is usable, but inspection shows the LLM hallucinates common values (e.g. "50 HP" appears 33% of the time even when OCR is empty). Treat these as silver labels, not gold.
- Manufacturer noise. OCR mis-reads of brand logos produce short fragments ("BH", "TD", "AFL", "ee") that the LLM passes through faithfully. A few noisy rows are also diagrams from "How to read a nameplate" articles.
- Hallucination example. The upstream sample
017.jpgis read as "Boilermaker Motor Company, 50 kW, 230/460 V, 1765 RPM, frame 326T" — the values are real for that plate. A counter-example:011.jpg(a Grundfos pump) was given HP=50, RPM=1765, frame=326T, model=M3558T — those are Baldor defaults, not Grundfos values.
For better labels, open correct.html in a browser, navigate with ← →, fix any fields you care about, and click Export to write corrections.json into the repo root; merge_labels.py will then prefer your edits over the LLM output.
Fine-tuning status (SmolVLM-256M LoRA on M4 Pro 16 GB)
The fine-tune script (finetune.py) is infrastructure-complete but blocked on a transformers-5.x compatibility issue with SmolVLM. See `finetune_notes.md` for the full error chain and workarounds already tried. The dataset is shipped without a fine-tuned checkpoint so a future agent can resume from a clean dataset state.
Provenance
- Images: `sergiudanstan/motor-nameplate` (MIT, scraped from Google Images thumbnails)
- OCR: Tesseract 5.5.1 (
eng,--psm 6) - Field extraction: `mlx-community/Qwen2.5-1.5B-Instruct-4bit`
- Hardware: Apple M4 Pro, 16 GB unified memory
License
MIT — same as the upstream image dataset.
