Skip to main content

Dont-Blink — AI Timelapse for 3D Printers

PyPI version Python License: AGPL v3

Dont-Blink watches your 3D print video and captures frames only when the printhead is out of the way, producing clean timelapses with no printhead photobombs.

Demo video
Click to watch the demo

How it works

  1. A lightweight MobileNetV3-based model detects the printhead position in each frame
  2. A tracker monitors printhead movement and captures frames when it parks
  3. Captured frames are stitched into a smooth timelapse video

Works with pre-recorded videos and live camera feeds. Runs on CPU, Apple Silicon (MPS), or NVIDIA GPU.

Quick start

Install

pipx install dontblink

Or with pip:

pip install dontblink

The model weights (~13 MB) download automatically on first run.

Process a video

dontblink process input.mp4

That's it. Output goes to outputs/input/frames/ and outputs/input/timelapse.mp4.

CLI reference

dontblink process <video>              Process a video (recommended entry point)
dontblink process <video> --rotation 90  Override video rotation
dontblink process <video> --print-config Show resolved config and exit

dontblink create-timelapse <dir> <out>  Stitch frames into a timelapse
dontblink process-camera <id> <out>     Process a live camera feed
dontblink visualize-video <in> <out>    Draw bounding boxes on every frame
dontblink test-image <image> [out]      Test model on a single image
dontblink extract-frames <dir>          Extract frames from videos at intervals

dontblink benchmark                     Benchmark inference speed
dontblink doctor                        System diagnostics (paste into bug reports)
dontblink download-model                Download / verify model weights

dontblink --verbose                     Debug logging
dontblink --config path/to/config.yaml  Custom config file

Configuration

Dont-Blink works out of the box with sensible defaults. To customize, create a config.yaml:

dontblink create-config config.yaml

Key settings:

Setting Default Description
detection.device auto auto, cpu, cuda, or mps
detection.confidence 0.5 Detection threshold (0.0–1.0)
processing.batch_size 1 Frames per batch (increase for GPU)
processing.video_rotation 0 Manual rotation override (0/90/180/270)
timelapse.fps 15 Output timelapse frame rate

See config.yaml.example for all options.

Python API

from dontblink.config import Config
from dontblink.detection import DetectionService
from dontblink.video_processor import VideoProcessor
from dontblink.timelapse import TimelapseGenerator

config = Config("config.yaml")
detection = DetectionService(config)
processor = VideoProcessor(config, detection)

stats = processor.process_video_file("input.mp4", "output/frames")

timelapse = TimelapseGenerator(config)
timelapse.create_timelapse("output/frames", "timelapse.mp4")

Architecture

dontblink/
├── cli.py              Command-line interface
├── config.py           YAML configuration with defaults
├── detection.py        Detection service + printhead tracker
├── model_manager.py    Model download, caching, SHA-256 verification
├── video_processor.py  Video/camera processing with batch inference
├── timelapse.py        Timelapse generation from frames
├── utils.py            Device detection, validation, fingerprinting
├── types.py            DetectionResult type
└── ml/                 Training & inference
    ├── model.py        MobileNetV3-Small backbone + detection head
    ├── infer.py        Inference with batch support
    ├── train.py        Training loop with early stopping
    ├── dataset.py      YOLO-format dataset with augmentation
    ├── eval.py         Precision, recall, F1, IoU metrics
    └── config.py       Training hyperparameters

Model

  • Backbone: MobileNetV3-Small (ImageNet pre-trained)
  • Head: presence score + bounding box (x, y, w, h) in normalized coordinates
  • Size: ~13 MB
  • Inference: ~16 ms/frame on CPU, ~5 ms on MPS/CUDA

Currently optimized for Bambu Lab A1 Mini but works with other printers given appropriate camera positioning.

Training your own model

Install training dependencies and see the training guide:

pip install dontblink[train]

See TRAINING.md for dataset preparation, training, and evaluation.

Troubleshooting

Run diagnostics and paste the output into bug reports:

dontblink doctor --copy

Contributing

git clone https://github.com/smoothyy3/Dont-Blink.git
cd Dont-Blink
pip install -e ".[dev,train]"

License

GNU Affero General Public License v3.0 — Copyright 2025 Jonas Möbes

Metadata

Release files for dontblink 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dontblink 2.1.1
File Size Uploaded Provenance Actions
dontblink-2.1.1.tar.gz 66.5 kB Without provenance Details for dontblink-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dontblink 2.1.1
File Interpreter ABI Platform Actions
dontblink-2.1.1-py3-none-any.whl Python 3 none any Details for dontblink-2.1.1-py3-none-any.whl

Total release size: 134.2 kB

Security for dontblink 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page