Skip to main content

fastLBP: parallelised and GPU-powered multi-radii Local Binary Patterns computation

Project description

License: GPL v3 PyPI - Python Version PyPI - Status GitHub release PyPI

fastLBP

Highly parallel LBP implementation

Important pre-release warning: If aborted mid-execution, this software sometimes create a lot of orphan processes that needs to be killed manually. Please, note down the name of your python script, search for Python in your task manager and look for the processes that correspond to your python script.

Requirements

FastLBP is tested with Python 3.11 on Windows 10, Debian 11, and Ubuntu 22.04

Python requirements are:

  • numpy >= 1.26.0
  • Cython (to build the binary modules, will be optional in the future)
  • scikit-image >= 0.22.0 (mostly for testing, we plan making this requirement optional in the future)
  • pandas >= 2.1.1
  • psutil

Installation

  • Activate or create a Python 3.11 environment (e.g. using conda create -y -n p11 python=3.11 && conda activate p11)
  • Verify you are using the right env
    • python --version and pip --version
  • Install a stable version from PyPI
    pip install fastlbp
  • Or build the latest version from sources
    git clone git@github.com:imbg-ua/fastLBP.git
    cd fastLBP
    # git checkout <branchname> # if you need a specific branch
    pip install . # this will install the fastlbp package in the current env
    
  • You can use import fastlbp as fastlbp now

GPU (CUDA) optional install

  • CPU-only install (default):
    pip install fastlbp
    
  • GPU build (opt-in): ensure CUDA is discoverable by setting CUDA_HOME (or having nvcc on PATH) and install the extra:
    export CUDA_HOME=/usr/local/cuda  # adjust to your CUDA install
    pip install fastlbp
    
  • To hard-require CUDA and fail if not found, set:
    FORCE_CUDA=1 pip install fastlbp
    

If CUDA isn’t detected, the build will proceed with CPU-only features. At runtime, you can check availability:

import fastlbp
fastlbp.fastlbp.is_cuda_available()  # -> True/False

Testing

# in repo root
conda activate fastlbp
pip install -e .
python -m unittest

Bug reporting

You can report a bug or suggest an improvement using our github issues

Implemented modules

run_fastlbp

Computes multiradial LBP of a single multichannel image in a parallel fashion.

Features:

  • Powered by fastlbp.lbp, our implementation of skimage.feature.local_binary_pattern
  • Concurrency is managed by Python's multiprocessing module
  • Parallel computation via multiprocessing.Pool of size ncpus
  • Efficient memory usage via multiprocessing.shared_memory to make sure processes do not create redundant copies of data
  • If save_intermediate_results=False then computes everything in RAM, no filesystem usage

TODO:

  • Use max_ram parameter to estimate optimal number of sub-processes and collect memory stats. Now max_ram is ignored.

Planned modules

run_chunked_skimage

Similar to 1. run_fastlbp, but each subprocess should compute LBP for its image chunk, not the whole image.

run_dask and run_chunked_dask

Similar to 1. run_fastlbp, but use Dask and dask.array.map_overlap for parallelisation instead of multiprocessing and manual data wrangling

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.

fastlbp-0.3.4-cp313-cp313-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

fastlbp-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

fastlbp-0.3.4-cp312-cp312-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

fastlbp-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

fastlbp-0.3.4-cp311-cp311-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

fastlbp-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file fastlbp-0.3.4-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for fastlbp-0.3.4-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f38c6395dc45e0fa9e3b5fa260ff94c53ead40a0db2483e081121c68b7b1024a
MD5 423ec91cd80fed5ac34182edd8ff2015
BLAKE2b-256 6fc6d38bf3ee064ead3255d257d9484fb6974c70755ef0920d7354593299e173

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastlbp-0.3.4-cp313-cp313-manylinux_2_39_x86_64.whl:

Publisher: publish-to-pypi.yaml on imbg-ua/fastLBP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastlbp-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastlbp-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 46be77dfa36eae823aa19d38383ee55a40bf5338e46977f7aa4f0f803a69d7a3
MD5 11bff7872d2bb69f04ccd1cc16d4359b
BLAKE2b-256 dfc82fb849c44148b84d892e6c4c207efed05b718d83c86840c0f413984664a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastlbp-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: publish-to-pypi.yaml on imbg-ua/fastLBP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastlbp-0.3.4-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for fastlbp-0.3.4-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d8f8ee3f6cb6f46f8ae227702cb7a594501c3e038f08403375c012400fefe887
MD5 d60d4835878bf443e8a95078f08f2002
BLAKE2b-256 5c54f433981852470f653bb963883cefead99dc2ef4918d0616e1695c1ed0e58

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastlbp-0.3.4-cp312-cp312-manylinux_2_39_x86_64.whl:

Publisher: publish-to-pypi.yaml on imbg-ua/fastLBP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastlbp-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastlbp-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0bc84d02e2e38deb16faff0f5aeb4fc794b24187da3c3abf2152ccaf707d8128
MD5 2aa79b068c8cd66055c037a4e6e178f9
BLAKE2b-256 77348d5e955596840da858b9c85280cc0f6a84134f3d3d088cc06d8c40da7bec

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastlbp-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: publish-to-pypi.yaml on imbg-ua/fastLBP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastlbp-0.3.4-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for fastlbp-0.3.4-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 756dcaf38b67915c8ec4c27b789712d58afbfd545848644e1d1a1bbf2a8b9c1b
MD5 19b670e61bf374e41530e1b63c35cb4e
BLAKE2b-256 35e5dc4bafada82a113a1f4c46a6143e1c49ca73c394d643c34f6db4ee0362ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastlbp-0.3.4-cp311-cp311-manylinux_2_39_x86_64.whl:

Publisher: publish-to-pypi.yaml on imbg-ua/fastLBP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastlbp-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastlbp-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 cd3a60d545fd40646cf4b529dd568c5d31dbef9a104e6e1f191717a0068216e1
MD5 6c70ef7fff2105c232f753a004a4b6e2
BLAKE2b-256 b79f89c2458beb5bb3060b2422251e9dc53ba03cdb1167f6b663a888c389c5f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastlbp-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: publish-to-pypi.yaml on imbg-ua/fastLBP

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