PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network
Packaged Version of the Pytorch implementation of PSENet text detector
Overview
PSENet is designed as a segmentation-based detector with multiple predictions for each text instance. These predictions correspond to different `kernels' produced by shrinking the original text instance into various scales. Consequently, the final detection can be conducted through our progressive scale expansion algorithm which gradually expands the kernels with minimal scales to the text instances with maximal and complete shapes.
Getting started
Installation
- Install using conda for Linux, Mac and Windows (preferred):
conda install -c fcakyon psenet-text-detector
- Install using pip for Linux and Mac:
pip install psenet-text-detector
Basic Usage
# import package
import psenet_text_detector as psenet
# set image path and export folder directory
image_path = 'figures/idcard.png'
output_dir = 'outputs/'
# apply craft text detection and export detected regions to output directory
prediction_result = psenet.detect_text(image_path, output_dir, cuda=False)
Advanced Usage
# import package
import psenet_text_detector as psenet
# set image path and export folder directory
image_path = 'figures/idcard.png'
output_dir = 'outputs/'
# read image
image = psenet.read_image(image_path)
# load model
psenet_model = psenet.load_psenet_model()
# perform prediction
prediction_result = psenet.get_prediction(image=image,
model=psenet_model,
binary_th=1.0,
kernel_num=3,
upsample_scale=1,
long_size=1280,
min_kernel_area=10.0,
min_area=300.0,
min_score=0.93,
cuda=True)
# export detected text regions
exported_file_paths = psenet.export_detected_regions(image_path,
image,
boxes=prediction_result["boxes"],
output_dir=output_dir)
# export box visualization
_ = psenet.visualize_detection(image_path,
image=image,
quads=prediction_result["boxes"],
output_dir=output_dir)
Metadata
Release files for psenet-text-detector 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| psenet-text-detector-0.1.1.tar.gz | 10.8 kB | Without provenance | Details for psenet-text-detector-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| psenet_text_detector-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for psenet_text_detector-0.1.1-py3-none-any.whl |
Total release size: 25.7 kB
Release files / psenet-text-detector-0.1.1.tar.gz
| Download URL | psenet-text-detector-0.1.1.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb60b4a470cef1e70a7605aaee2dd18ee9bf4666d5ee4c7ebeddc8db2f823e69
|
|
BLAKE2b-256 checksum How to use checksums |
6dd0b98ac60cdda6333536cee41fd07b4adb0e7206ef0bc8c54087587e3ad04c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / psenet_text_detector-0.1.1-py3-none-any.whl
| Download URL | psenet_text_detector-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e1d7a4cd7e129822ac64b4479435c9cf0d7ce062648d3c5c209e5302cbd9502
|
|
BLAKE2b-256 checksum How to use checksums |
69c834d17eb93a202ee03e9d3506c58cfd875132e505091fe02f3a5fd176266b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for psenet-text-detector 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.