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

Link to youtube live coding session

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 session

Please cite ⭐

@misc{poliarnyi2025,
  title        = {Polarini Focusini: open-source pipeline for in-focus region detection},
  howpublished = {\url{https://github.com/PolarNick239/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.0.tar.gz (10.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.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polarini_focusini-0.1.0.tar.gz
  • Upload date:
  • Size: 10.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.0.tar.gz
Algorithm Hash digest
SHA256 fb82e616bb0c3ad2a4b8c44c974e74fe21ff32ba66dfb8d74dc86c2dc86c90c4
MD5 7a3d6c1a5c72d047c3575990925bc489
BLAKE2b-256 226f68bd147540f50d8f4e17580e3fbefd2044f03f3b019c1d6134d064fa3688

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for polarini_focusini-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb6b01b2e091387c8a080cf9dcd08ec6aa7bc779e38fa04cff0bb14923beb34b
MD5 092536c2348b9f60297a6e9f04170dfe
BLAKE2b-256 417d2dcff28482b31a6dfef39a404f417c4eb7c1e91ec604d4e5406501a43702

See more details on using hashes here.

Provenance

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