Automated in-focus region detector that blends monocular depth estimation with classic frequency-domain (Difference of Gaussian - DoG) sharpness cues.
- Runs Depth-Anything V2 to get floating-point depth.
- Builds a 3-level Gaussian pyramid and two Difference-of-Gaussians (DoG) maps.
- Applies Non-Maximum Suppression in space and across scales.
- Keeps only strong extrema → votes for focus → finds dominant depth bins.
- Saves every intermediate step to a per-image
debug/
folder for easy inspection.
polarini_focusini.mp4
Watch the 90-minute live “vibe-coding” session that produced this repo (English code + English subs + Russian-language commentary):
@misc{poliarnyi2025,
title = {Polarini Focusini: open-source pipeline for in-focus region detection},
howpublished = {\url{https://github.com/UnicornGlade/PolariniFocusini}},
author = {Poliarnyi, N.},
year = {2025},
note = {YouTube demo: “Finding Focus in Photos Using Depth Anything and DoG”}
}