Skip to main content

lanms-contrib is a python binding for LANMS - Locality-Aware Non-Max Suppression

Project description

Locality-Aware Non-Maximum Suppression (LANMS) Contrib version

This is a python binding for LANMS as described by Zhout et al. in their paper "EAST: An Efficient and Accurate Scene Text Detector", CVPR 2017. The C++ code is taken from the implementation available on: https://github.com/argman/EAST

Installation

pip install lanms-contrib

Usage example

import numpy as np
import lanms

## DEFAULT FOR DENSE ROTATED BOUDNDBOXING
boxes = np.array([
     [137.0, 113.6, 162.3, 113.3, 162.4, 122.2, 137.2, 122.6, 0.75],
     [137.2, 113.8, 163.2, 114.6, 163.0, 122.6, 137.0, 121.9, 0.97],
     [136.8, 113.4, 163.2, 114.5, 162.9, 122.7, 136.5, 121.6, 0.15],
     [136.6, 112.9, 163.3, 114.5, 162.8, 122.9, 136.1, 121.3, 0.95],
     [136.4, 112.6, 163.4, 114.5, 162.8, 123.0, 135.8, 121.2, 0.96],
     [131.4, 89.2,  137.8, 89.0,  138.2, 98.5,  131.8,  98.7, 0.98],
     [131.6, 89.2,  137.8, 89.1,  138.1, 98.6,  131.8,  98.8, 0.32],
     [131.5, 89.2,  137.9, 89.1,  138.0, 98.6,  131.6,  98.7, 0.99],
     [131.5, 89.2,  138.0, 89.1,  138.1, 98.5,  131.6,  98.5, 0.87],
     [131.5, 89.3,  137.8, 89.0,  138.2, 98.4,  132.0,  98.7, 0.97]
], dtype=np.float32)

boxes = lanms.merge_quadrangle_n9(boxes, nms_thresh=0.5)
print(boxes)

## FOR NON-DENSE ROTATED BOUDNDBOXING, NO LOCAL MERGE STAGE BEFORE STANDARD NMS

boxes = np.array([
     [137.0, 113.6, 162.3, 113.3, 162.4, 122.2, 137.2, 122.6],
     [137.2, 113.8, 163.2, 114.6, 163.0, 122.6, 137.0, 121.9],
     [136.8, 113.4, 163.2, 114.5, 162.9, 122.7, 136.5, 121.6],
], dtype=np.float32)
scores = np.array([0.75, 0.97, 0.15])

keep_idx = lanms.merge_quadrangle_standard(boxes, scores, nms_thresh=0.2)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

lanms_contrib-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lanms_contrib-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lanms_contrib-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

lanms_contrib-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

lanms_contrib-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file lanms_contrib-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lanms_contrib-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26463556066621dc9451da1f37f8bbc5397429290b0dd8dc840370c543aa24a6
MD5 c13b3f02dc68d0a359cf085d949ac166
BLAKE2b-256 ce5a91dd638187d6d00367816c2848a4c2d4b00d5570f1f127e4a7835bddd874

See more details on using hashes here.

File details

Details for the file lanms_contrib-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lanms_contrib-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5ea776bfd7a73ae253f930f9a69bee8d7c7a1e4019da317e4329d4b2cbca9cd
MD5 adf519632a7fb0d7dd00dcc287fe4c44
BLAKE2b-256 903d07d932b97042914436350270ba9bc957e4f99d4d52294b3427add0ac9c7c

See more details on using hashes here.

File details

Details for the file lanms_contrib-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lanms_contrib-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9bee59f5a0614e77e3f9e082ca0aabd140a568c17e151502c4b9d206046913b7
MD5 b2b3754e63e7d6ff62dd9010c5e27185
BLAKE2b-256 8653f32526c331d2e4665609a6e72d62a6a948b51085b4655779b84e126d16a2

See more details on using hashes here.

File details

Details for the file lanms_contrib-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lanms_contrib-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 68e0cd054fc6767e510689dff3bf48b86031c5192f7be078f02273ee83ac6772
MD5 cc5e7fbc341b25245f58d4cef0b1c992
BLAKE2b-256 994c459ec166ab5cce24339dcdc2b5774fa81dfba7d90a5d814f84e465731817

See more details on using hashes here.

File details

Details for the file lanms_contrib-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lanms_contrib-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f51e071474cde68fa36af3552977b1663ea6836e2e00cb90c3e7638a6f17e334
MD5 0b9f5986064d8ab611eafc432c58efe6
BLAKE2b-256 4d53568bec87dc4dbfdeaba9a7cd29a86ac511ebe4ae2d24d3f7396fbeb94102

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