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.2.tar.gz (10.7 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.2-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polarini_focusini-0.1.2.tar.gz
  • Upload date:
  • Size: 10.7 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.2.tar.gz
Algorithm Hash digest
SHA256 4e551b3ca97cc549f20fc2f15d7d06e2c36866204a42e24c3f5ca92f3b93dfb9
MD5 0d477ece082c4d33e235b7d3529e19d0
BLAKE2b-256 071e6c9e838bb2a3dcf58c2ccfcd6462d0496bb93844b85b790453b0529c14f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for polarini_focusini-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for polarini_focusini-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06577c35c0a5c42792d03120c782b3fafb4f674950a15afe4e34c4238a324eec
MD5 d27e7a18ce71356c0a2b7a6ca2bc14ed
BLAKE2b-256 4c9b485b8a4d7ae83aecf726b2953c532c5f213f3671aad5fa06ed1d7c8ed92e

See more details on using hashes here.

Provenance

The following attestation bundles were made for polarini_focusini-0.1.2-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