Skip to main content

Detect in-focus regions in images using depth estimation and Difference-of-Gaussian (DoG) extrema voting across depth bins.

Project description

Polarini Focusini project logo

Polarini Focusini

Automated in-focus region detector that blends monocular depth estimation with classic frequency-domain (Difference of Gaussian - DoG) sharpness cues.

Example

Example how in-focus part of photo is detected

What happens under the hood

  1. Runs Depth-Anything V2 to get floating-point depth.
  2. Builds a 3-level Gaussian pyramid and two Difference-of-Gaussians (DoG) maps.
  3. Applies Non-Maximum Suppression in space and across scales.
  4. Keeps only strong extrema → votes for focus → finds dominant depth bins.
  5. Saves every intermediate step to a per-image debug/ folder for easy inspection.

Live coding walkthrough 🎬

Watch the 90-minute live “vibe-coding” session that produced this repo (English code + English subs + Russian-language commentary):

Link to youtube live coding sessions playlist

Please cite ⭐

@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”}
}

Stars, forks, issues – all very welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polarini_focusini-0.1.3.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polarini_focusini-0.1.3-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file polarini_focusini-0.1.3.tar.gz.

File metadata

  • Download URL: polarini_focusini-0.1.3.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for polarini_focusini-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1711ea2dc080a3bd26bd200e0af977f506ee19a7af6a454434455931b4bc6206
MD5 c0c23b40e78eeb59e4fef0e6e2f7f872
BLAKE2b-256 41d99d5a10f5819c8b5ac07dbe021d593e7c271ee5a25f1590e74dbbba7b161e

See more details on using hashes here.

Provenance

The following attestation bundles were made for polarini_focusini-0.1.3.tar.gz:

Publisher: publish.yml on UnicornGlade/PolariniFocusini

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polarini_focusini-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for polarini_focusini-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c11625b779f2b2ffe6db7e55a601582c00c261aff347be25067785d1a1cd7f92
MD5 ca75345b53817653fc5a62000a24b73d
BLAKE2b-256 7438f420192fd2d73a649dc9c8bad81eade4675f51e5d57cce74e21f343979d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for polarini_focusini-0.1.3-py3-none-any.whl:

Publisher: publish.yml on UnicornGlade/PolariniFocusini

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page