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.1.tar.gz (10.4 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.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polarini_focusini-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 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.1.tar.gz
Algorithm Hash digest
SHA256 c88a6eacea91431c0f1e8f0d3a682111af0c0ccd303e27a5d7a6382ce4ae2291
MD5 e6e7b6085f694f785af8328fac42c64c
BLAKE2b-256 97e22a85015a99e9b18bf5766da46396696e48b6378114044e598126989e55b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for polarini_focusini-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5949d5889cb2e1b9f2118df09f6ea5a74951ca678ac215ab239121351638d3a
MD5 4bc9577a71d4b0dd8860fc593ba6e866
BLAKE2b-256 bbb994b3776c4dd906e13fd98f3bbf1769f04f640fc96de75b533f614f7b2b57

See more details on using hashes here.

Provenance

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