Computer vision
Classical CV and modern architectures, aimed at document and drawing understanding rather than photographs — segmentation, detection, geometry, OCR, and turning pixels into measurable geometry.
| # | File | Covers |
|---|---|---|
| 01 | The computer vision task taxonomy | classification, detection, semantic/instance/panoptic; array conventions; choosing the task from the consumer |
| 02 | OpenCV and classical preprocessing | threshold, morphology, Canny, Hough, resizing, augmentation and what not to augment |
| 03 | Object detection | one- vs two-stage, YOLO, Detectron2, DETR, anchors, NMS, tiling and small objects |
| 04 | Segmentation architectures | U-Net skips, DeepLab atrous, SegFormer, Mask R-CNN, SAM, Dice and focal loss |
| 05 | Geometry: homography, rectification, vanishing lines | affine vs homography, four-point rectification, vanishing points, RANSAC, pixels to metres |
| 06 | Monocular depth estimation | MiDaS, Depth Anything, relative vs metric depth, when depth is the wrong tool |
| 07 | Contours, polygons and vector geometry | contour retrieval and holes, Douglas-Peucker, Shapely, validity repair, snapping |
| 08 | OCR inside a vision pipeline | detect-then-recognise, text vs symbol, line removal, parsing dimensions |
| 09 | CV pipelines and designing for imperfect input | stage contracts, fallback ladders, independent cross-checks, reproducibility, tiling |
| 10 | Evaluating vision models and pipelines | IoU vs Dice, mAP and what the mean hides, signed area error, splitting without leakage |
| 11 | Synthetic data and image normalization | procedural rendering, the domain gap, image-to-image normalization |
| 12 | Floor plan recognition and takeoff | takeoff end to end: source classification, walls as a graph, scale, validation |
The three things that carry most interviews
Name the task precisely before choosing a model. “Detect the walls” is four different problems with four label formats and four metrics. Work backwards from what the consumer needs: a count needs boxes, an area needs pixels, a CAD polygon needs pixels plus vectorisation.
Classical beats learned more often than people expect. A planar drawing photographed at an angle is a homography, solved exactly and cheaply. Reaching for a depth model there is a signal you have not thought about the geometry. The same applies to morphology, contours and line removal.
A mask is not a measurement. Every error between the model output and the number a customer sees — vectorisation, simplification, scale, shared-wall accounting — is unmeasured unless you build a per-stage error budget. IoU 0.93 and 6% median area error are both true at once.
Related folders
- Deep learning — CNNs, transfer learning, the backbones every architecture here uses.
- Structured Document Pipelines — Parsing, Tables, OCR, Extraction — OCR engines, table extraction and document pipelines for retrieval.
- ML system design — structuring an ML design answer.
- Vision-language models — VLMs on documents, and the hybrid pipeline that uses the detectors and OCR here.