Skip to main content

Cython implementation of Square Covering approach for Adaptive 2D Keypoints Non-Maximum Suppression

Project description

Efficient Adaptive Non-Maximal Suppression (ANMS)

This project provides a Cython implementation of the Efficient Adaptive Non-Maximal Suppression (ANMS) algorithms, designed to achieve a homogeneous spatial distribution of keypoints. This implementation is based on the paper "Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution" and offers improved packaging and installation via pip.

Installation

You can install the adaptivenms package directly using pip:

pip install adaptivenms

If you have cloned the repository, you can also install it from the project directory:

pip install .

Example

The following example demonstrates how to use the square_covering_adaptive_nms function to select a target number of keypoints with a homogeneous distribution.

import numpy as np
from adaptivenms import square_covering_adaptive_nms

# Randomly generate sample keypoint data
n_kpts = 10000
width, height = 960, 720
kpts_x = np.random.randint(width, size=(n_kpts,))
kpts_y = np.random.randint(height, size=(n_kpts,))
kpts = np.stack([kpts_x, kpts_y], axis=-1)
responses = np.random.random(n_kpts)

# Apply square_covering_adaptive_nms
kpts_idxs = square_covering_adaptive_nms(
    kpts,  # 2-dimensional array of shape [N, 2] representing keypoint coordinates (x, y)
    responses,  # 1-dimensional array of shape [N,] representing keypoint responses (e.g., cornerness scores)
    width=width,  # Width of the image
    height=height,  # Height of the image
    target_num_kpts=2048,  # Desired number of keypoints to retain
    indices_only=True,  # If True, returns only the indices of selected keypoints; otherwise, returns the selected keypoints themselves
    up_tol=10,  # Tolerance for allowing slightly more selected keypoints than target_num_kpts
    max_num_iter=30,  # Maximum number of binary search iterations to find the optimal suppression radius
)

print(f"Original number of keypoints: {n_kpts}")
print(f"Number of selected keypoints: {len(kpts_idxs)}")

References

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

adaptive_nms-1.0.0a2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distributions

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

adaptive_nms-1.0.0a2-cp313-cp313-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

adaptive_nms-1.0.0a2-cp313-cp313-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

adaptive_nms-1.0.0a2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (631.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

adaptive_nms-1.0.0a2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (608.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

adaptive_nms-1.0.0a2-cp312-cp312-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

adaptive_nms-1.0.0a2-cp312-cp312-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

adaptive_nms-1.0.0a2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (632.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

adaptive_nms-1.0.0a2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (612.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

adaptive_nms-1.0.0a2-cp311-cp311-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

adaptive_nms-1.0.0a2-cp311-cp311-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

adaptive_nms-1.0.0a2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (637.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

adaptive_nms-1.0.0a2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (622.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

adaptive_nms-1.0.0a2-cp310-cp310-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

adaptive_nms-1.0.0a2-cp310-cp310-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ ARM64

adaptive_nms-1.0.0a2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (607.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

adaptive_nms-1.0.0a2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (591.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

adaptive_nms-1.0.0a2-cp39-cp39-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

adaptive_nms-1.0.0a2-cp39-cp39-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ ARM64

adaptive_nms-1.0.0a2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (609.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

adaptive_nms-1.0.0a2-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (593.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

adaptive_nms-1.0.0a2-cp38-cp38-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ x86-64

adaptive_nms-1.0.0a2-cp38-cp38-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ ARM64

adaptive_nms-1.0.0a2-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (623.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

adaptive_nms-1.0.0a2-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (607.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

File details

Details for the file adaptive_nms-1.0.0a2.tar.gz.

File metadata

  • Download URL: adaptive_nms-1.0.0a2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for adaptive_nms-1.0.0a2.tar.gz
Algorithm Hash digest
SHA256 38b3e65b39540abb75265efaf70a70a98a0acfda6dc49c0ea54d98cda583f6ca
MD5 bd8effdd18c23d874a93b917e709a819
BLAKE2b-256 c7e632486864d02969136e1c266823888838946a347773594c46bd3498dcdfdd

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a4fa85ee4d3448db241a2fefb3fce114842ea14ec691b04d1cb8a36c21c2560a
MD5 38ad4f3ac868981c217db6a0e541bff7
BLAKE2b-256 10a2c1ca766cc4bd095fbf1d9ab138481e628acc653914a1794ca7e818bb40db

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 899066c5953d64af95ce051b063039aa5fb855643323aa4623b4bc439d3c8226
MD5 3212a6fe7f96990dc5b50469fa5d543c
BLAKE2b-256 c644555cb5f088c92f101a99e3e0934255d710dd85ac5f9c141d4c96e12332d7

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bea618ea27cd2eddd20545fe8848655573ed08ba9dc61a8692be9016ee542f66
MD5 ee00b8c6f1f4603e3fc383b002b1c895
BLAKE2b-256 dd7684388029fea2badd312205a477a78172cbc261f532aeb8b8424ffeb8f986

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3a617b54f1fe73be3a57adb3bab4a2f8a6cc975292599317c0651f0bc080ddd9
MD5 9e2c84a8e8d1ca311313a3283073de37
BLAKE2b-256 42f69ee3b2bf4bcb7aadfb9d9392ffd0a694539ab010816db5c74cd736eb59d7

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 447298a257e736facd87a35010f728e42745a6c7c05efdc88bad5e5fda13367a
MD5 bfbb28515c325003eb0b04406422cb2b
BLAKE2b-256 33d17bc8d27f1d7e3fbef4d2fd6344b3d0e97132dd238426be08d97503dae447

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp312-cp312-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e5833c13b1c09bae6141d90e1bd26b23d463e13e2c362d9a66fa2bf3ee5e066e
MD5 33eeeedb7b6da8b1d808c678a6597fb2
BLAKE2b-256 dfb2735163b74c6fb4a8cd5522fa1a7b9894d5756f6859297694dab0bdf7be6e

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ed4e9519cedb0ace3ce21bdb88bb7674660116edf601140ddddf393577e6eefc
MD5 a8ae2483f586bdb18f6ce77f51e78bb8
BLAKE2b-256 ee4d9ac6eceb15247daaed961ea3235444108565107fb0b32164580c13c242ba

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 17169ff5a4799e6a2f3987862e310ecd2c86eecc445e77fae5083461778f62ff
MD5 08efff49ca7814477272b9708dc43e85
BLAKE2b-256 50126cbe4d8de9a74a34ef72c38ea10a22919a181412b9d3e83f5e90fe7c553d

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a1ba57cb85aa3228872c3502c6d09ead4c8dc18d549e4cc9d68a8400843c7ce2
MD5 45f2d446eccb9c7c3977f2d010f325c1
BLAKE2b-256 fbb146e5139da716f9ac9201366147070e2ff20aa931138dd3b882e3298057eb

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp311-cp311-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0ae06fb4d44b5179e87faf48f87e36ba2a047e8f2f9a3f59ff10a53d2bbdda67
MD5 bbef17070eed33c92a069911f7bef31f
BLAKE2b-256 2d0f184696247e6bf8a8527f4895e86b7bfd6030c3ceae67f65fd88fe2ec3cc7

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0f872d957792cdaa5334ef3cd7e83451805859a18a984105b8211f1e3e28d691
MD5 3e8484caacb6c55aff8e13c5f5986af9
BLAKE2b-256 70d95816b89a4d343f956af65fc4f7b06756f8d0382171065a513fcc51c6cf52

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4474650325f87b06645f62f35f965485a165d56de4ecf5e482370951a54b78cf
MD5 2ff5ed20c69e91499984b4d79eb0e44d
BLAKE2b-256 fc3ba8e4ceaede4f8fb274b5a2b843139f6da9298609ce2ecaea0c10e270a004

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 31d57577d67a6081979872892640be0ed1c1e5cc3aa968bfd41b79a783f1f517
MD5 8368f258497001f48f89507db1f3ef42
BLAKE2b-256 48a79ef413aef20a3d415be1c17e2093a3874f586425dbed92ce2fee8de660d9

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp310-cp310-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 af8e298cc74aa198e8578e78215556461034f54c7e656aad82139896e52241ef
MD5 432bb8ff87ce74a1f5bc3393fdfc5140
BLAKE2b-256 15f07c102e8b159c7450b6cbfd078806e7f3a7b3b2fb4e6f2f7be28f4c940294

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b896a1ea9479622a02546d904a78dcaa265b89d04a7149adc8adf0bc46add311
MD5 e19d6dde8b25b6a3f76d2a9b3e40b4ba
BLAKE2b-256 77e5c25173106b5308fec9025a3bf75b8ad89140e99292b6a5a10daf09d7ad2d

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 20d478c3516ad8a5eac9f27f87a0963f949ffbfdf1ece7c2715f689e6222c807
MD5 089afafc30816667790664f55bd68d21
BLAKE2b-256 109ff54285aec8c1bcc6157c06eff1a05d986a16135bba1203072e0b7f3159ca

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 537fdda520509113b189cb5653b365cbfd32097f1b566334426d667157fa0da0
MD5 dc5afe8accc51c4afaa75f142e415337
BLAKE2b-256 731440f5607ba5191497c67f3446c0723e8fa68840ab7696995aa498b213bb88

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp39-cp39-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 313597a4486f2de4766e323554595c9d35b7769a44f0d1ed82bf60eeb37b0fe9
MD5 8fe51c59576b68aebe0b8773c7428827
BLAKE2b-256 ec0706f0beedbc611559faf9296b7f98784035a45ad5883d32012208681053f2

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1ea7c4090c9ba663b766b47a6d506fb511d92abb0f55a071cd402ba6da911286
MD5 6275bcf53b86c02f390ac5e9ef38a9e9
BLAKE2b-256 d47bc273390d99c88adf9da4a3c895deaa5188a133413d12c8b45a5880f41a80

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d07ead4ad72b9c3630a0cc9e833758be5a91b8d31a782bab93eae5aebf5ae00a
MD5 c4de22e43bf1e9abe2bead1608d2c111
BLAKE2b-256 06a9519f57c49d3d6713fe23164684ee765c66d3b104fd6b7644996ee2173f95

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp38-cp38-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0021608d83968aa52f52b418257a48cee3d7bef4d9411e6bcd646ea0b5911357
MD5 795476b13f0d3099c25d8bc792ac7f32
BLAKE2b-256 4c93bfee848b398ad5f90b98085f3ac9120e6134bfb00fae31e758bd4cd9c5c5

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp38-cp38-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2c8d620037e0c870ad49e73068adaab940a68b73b0abbeb11a6806472836bee2
MD5 b8d8009714f99bde8051091763f44600
BLAKE2b-256 b8051a93feeed112540834d0bae730bc00e61ed8f313b299d373c4177d5b8eec

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9fce895f7009fc20f8cf519379d03ce420a0590aaf188c7a339e946554d2d4b3
MD5 60d2649fc1a0b6e78f2d6940ffb4154a
BLAKE2b-256 5968bc44c010fc0347d01b098514a1a0db64bdbd6ce0aab01ffcf7fe0b615b41

See more details on using hashes here.

File details

Details for the file adaptive_nms-1.0.0a2-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adaptive_nms-1.0.0a2-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8a61b111637c6b851fc2d4421eafe51a6cf24e99c76af7a682fccb088013a88c
MD5 ff48a67f25dfed238ca63915e620b83f
BLAKE2b-256 f9b9f4b87f507a88ca6bc443232297823b6c68a29dc325efb3258281f5e001eb

See more details on using hashes here.

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