Code

Toolbox

Open tools from my own work — optical simulation, imaging pipelines, and AI from training to deployment, published here as each one is ready to be looked at.

Optics

2 projects

Design, simulation, and metrology tools for optical systems.

  • Four panels of the same ColorChecker scene through camsim: a RAW CFA mosaic, the demosaiced colour image, the colour-corrected image, and the final tone-mapped output.
    camsim — Camera Sensor & ISP SimulationWrite-upFull physical simulation of the camera sensor and ISP — from sensor-plane spectral irradiance → RAW through QE, CFA, IR-cut, shot/read/dark-current/fixed-pattern noise and dual conversion gain (LCG/HCG) → a linear-light ISP → MTF, SNR, ΔE2000 and acutance. Published on PyPI, it is the bridge from photon-level optical simulation to image-quality metrics and downstream machine-vision and ML studies.PythonNumPySciPycolour-scienceSourcePyPI
  • A synthetic slanted-edge test chart: nine tilted squares on grey, each with green ROI boxes labelled 0_T through 8_B for the thirty-six edges the pipeline measures.
    Slanted-Edge SFRWrite-upSynthetic slanted-edge charts with a known answer — noise, vignetting, distortion, gamma — measured back by an ISO 12233 pipeline: 36 edges per chart, MTF50 and Nyquist metrics, and a validation module that says where recovery fails.PythonNumPySciPyOpenCVSource

AI

2 projects

Imaging pipelines, model training, and edge inference where models meet hardware.

  • A framework diagram for cnn-classifier: typed YAML flows through data adapters, a model registry, trainer and callbacks, evaluation and diagnostics, to a report, with every stage writing a self-describing run directory; below, CIFAR-10 train/validation accuracy curves and a row-normalized 10-class confusion matrix.
    cnn-classifier — Config-Driven CNN TrainingWrite-upA config-driven PyTorch toolkit that takes any image/label dataset from typed YAML to a trained, evaluated, and reported classifier — dataset adapters with leakage checks, a model registry, a headless trainer with callbacks/AMP/EMA/checkpointing, calibration and bootstrap evaluation, training diagnostics, and self-contained reports. Exercised end-to-end on CIFAR-10 with a residual CNN and ResNet-18 transfer, and published on PyPI as cnn-classifier-toolkit, it is reusable infrastructure for the next classification project.PythonPyTorchtorchvisionPydanticSourcePyPI
  • A detection frame from the pipeline: green boxes labelled “person: 0.84” and “person: 0.82” drawn over two people on a stadium touchline.
    Webcam Smart DetectionWrite-upReal-time webcam detection: YOLO objects and OpenCV faces in the same frame, both publishing an identical result so the render loop never learns which detector drew a box.PythonYOLOv8OpenCVSource

Everything lands on GitHub as it becomes presentable.