Dont-Blink — AI Timelapse for 3D Printers
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.
How it works
- A lightweight MobileNetV3-based model detects the printhead position in each frame
- A tracker monitors printhead movement and captures frames when it parks
- 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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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
Release files / dontblink-2.1.1.tar.gz
| Download URL | dontblink-2.1.1.tar.gz |
|---|---|
| Size | 66.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6766856c41581fa8044a8ffe5d5291d05c960f81b41e3b53cdd5f2b5022af053
|
|
BLAKE2b-256 checksum How to use checksums |
fa1d76344aecce50978a4a20932ecc34cb39afe27369a243f17eff8bf9dbf761
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / dontblink-2.1.1-py3-none-any.whl
| Download URL | dontblink-2.1.1-py3-none-any.whl |
|---|---|
| Size | 67.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df4593ccc874c9707166cc7ed6db919e58c6720bf39e12b42807719742742ee8
|
|
BLAKE2b-256 checksum How to use checksums |
85f26977d61e5b07bc432974e8c1d8de5bce277bb18092274c5b1e5bed0c067e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
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.