Skip to main content

GPU-accelerated image processing in python using OpenCL

Project description

py-clesperanto

Image.sc Forum Conda Version PyPI License Development Status Build codecov Python Version Code style: black GitHub stars GitHub forks DOI

pyclesperanto is the python package of clEsperanto - a multi-language framework for GPU-accelerated image processing. It relies on a familly of OpenCL kernels originated from CLIJ. This package is developped in python and C++ wrapped using PyBind11, and uses the C++ CLIc library as a processing backend.

Reference and examples

An in-depth API reference and package documentation can be found here, and several demonstration notebook on how to use the library and major functionnality are available in the demos folder

Installation

  • Get a conda/python environment, e.g. via mamba-forge.
    • If you never used python/conda environments before, please follow these instructions first.
  • Create a new environment and activate it:
mamba create --name cle
mamba activate cle
mamba install -c conda-forge pyclesperanto

[!WARNING]

  • MacOS users may need to install the following package:
    • mamba install -c conda-forge ocl_icd_wrapper_apple
  • Linux users may need to install the following package:
    • mamba install -c conda-forge ocl-icd-system

[!NOTE] pyclesperanto package is also available on PyPI and can be install with the command:

  • pip install pyclesperanto

Troubleshooting: Graphics cards drivers

In case you encounter one of the following error messages indicate a wrong OpenCL setup on your system:

  • "clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR"
  • "No backend available. Please install either OpenCL or CUDA on your system."

Please install recent drivers for your graphics card and/or OpenCL device. Select the right driver source depending on your hardware from this list:

And make sure that your OpenCL library are accessible in you PATH.

[!TIP] Linux users may install packages such as intel-opencl-icd or rocm-opencl-runtime depending on their GPU.

Code Example

import pyclesperanto as cle
from skimage.io import imread, imsave

# initialize GPU
device = cle.select_device()
print("Used GPU: ", device)

image = imread("https://samples.fiji.sc/blobs.png?raw=true")

# push image to device memory
input_image = cle.push(image)

# process the image
inverted = cle.subtract_image_from_scalar(input_image, scalar=255)
blurred = cle.gaussian_blur(inverted, sigma_x=1, sigma_y=1)
binary = cle.threshold_otsu(blurred)
labeled = cle.connected_components_labeling(binary)

# The maxmium intensity in a label image corresponds to the number of objects
num_labels = cle.maximum_of_all_pixels(labeled)

# print out result
print("Num objects in the image: " + str(num_labels))

# read image from device memory
output_image = cle.pull(labeled)
imsave("result.tif", output_image)

Examples & Demos

More usage and example can be found as notebooks in the demos folder. As well as in the documentation.

Contributing and Feedback

clEsperanto is developed in the open because we believe in the [open source community]. Feel free to drop feedback as github issue or via image.sc forum. Contribution are also very welcome. Please read our community guidelines before you start and get in touch with us so that we can help you get started. If you liked our work, star the repository, share it with your friends, and use it to make cool stuff!

Acknowledgements

We acknowledge support by the Deutsche Forschungsgemeinschaft under Germany’s Excellence Strategy (EXC2068) Cluster of Excellence Physics of Life of TU Dresden and by the Institut Pasteur, Paris. This project has been made possible in part by grant number 2021-237734 (GPU-accelerating Fiji and friends using distributed CLIJ, NEUBIAS-style, EOSS4) from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation, and by support from the French National Research Agency via the France BioImaging research infrastructure (ANR-24-INBS-0005 FBI BIOGEN).

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

pyclesperanto-0.19.0.tar.gz (48.1 MB view details)

Uploaded Source

Built Distributions

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

pyclesperanto-0.19.0-cp313-cp313-win_amd64.whl (802.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pyclesperanto-0.19.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

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

pyclesperanto-0.19.0-cp313-cp313-macosx_11_0_arm64.whl (759.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyclesperanto-0.19.0-cp313-cp313-macosx_10_14_x86_64.whl (820.3 kB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

pyclesperanto-0.19.0-cp312-cp312-win_amd64.whl (802.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pyclesperanto-0.19.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

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

pyclesperanto-0.19.0-cp312-cp312-macosx_11_0_arm64.whl (759.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyclesperanto-0.19.0-cp312-cp312-macosx_10_14_x86_64.whl (820.3 kB view details)

Uploaded CPython 3.12macOS 10.14+ x86-64

pyclesperanto-0.19.0-cp311-cp311-win_amd64.whl (801.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pyclesperanto-0.19.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

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

pyclesperanto-0.19.0-cp311-cp311-macosx_11_0_arm64.whl (757.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyclesperanto-0.19.0-cp311-cp311-macosx_10_14_x86_64.whl (816.4 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

pyclesperanto-0.19.0-cp310-cp310-win_amd64.whl (800.6 kB view details)

Uploaded CPython 3.10Windows x86-64

pyclesperanto-0.19.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

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

pyclesperanto-0.19.0-cp310-cp310-macosx_11_0_arm64.whl (755.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyclesperanto-0.19.0-cp310-cp310-macosx_10_14_x86_64.whl (815.2 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

pyclesperanto-0.19.0-cp39-cp39-win_amd64.whl (825.1 kB view details)

Uploaded CPython 3.9Windows x86-64

pyclesperanto-0.19.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

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

pyclesperanto-0.19.0-cp39-cp39-macosx_11_0_arm64.whl (755.8 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyclesperanto-0.19.0-cp39-cp39-macosx_10_14_x86_64.whl (815.3 kB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

pyclesperanto-0.19.0-cp38-cp38-win_amd64.whl (800.4 kB view details)

Uploaded CPython 3.8Windows x86-64

pyclesperanto-0.19.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

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

pyclesperanto-0.19.0-cp38-cp38-macosx_11_0_arm64.whl (755.7 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyclesperanto-0.19.0-cp38-cp38-macosx_10_14_x86_64.whl (815.0 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

File details

Details for the file pyclesperanto-0.19.0.tar.gz.

File metadata

  • Download URL: pyclesperanto-0.19.0.tar.gz
  • Upload date:
  • Size: 48.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyclesperanto-0.19.0.tar.gz
Algorithm Hash digest
SHA256 5485984cdc981c518430af8245ddbdc4760d2af3763ff43b979883728d3a476d
MD5 ccd998d8b1cf9b8d4378a7861e581b73
BLAKE2b-256 77685ab6fe6f3b2c40d90e18ebf5de1aa89a1646eb0c0301c739373427b6fdf0

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 80665ffaa172ac7bbc2c7b8488e2f33c4eb9360da547ef1010c910cf25ce193c
MD5 26bf38abea01027ee549b4ed707ae312
BLAKE2b-256 ba3ef53cd150f1c37791b24de8efae722e5bbee0fc0b641091d84d5d81d8c375

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eeb8ffca1c8536a8238cfb7a786f5ab8b38f29f1adf746c06a0b7b35416c32e3
MD5 bb59260307f9ad7616c4227921749b65
BLAKE2b-256 3bc2aa066f4f817f8f66246b1bb99392595291b644c9ec94b1effacaf8a32589

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71ffa9b1d2e1b8f109a305d4bf4a0956b1a33edb97cee433039f2c04df1447ed
MD5 cc98c23fbc70bfb58f82b2f919bcd990
BLAKE2b-256 c055d2855db356beb886a11e94cb98f5133f2715ffc3a5f9dad1a6a3e5a7af77

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp313-cp313-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0b0642ac1a8fe1754929ad8e4a3c17ffce7d2fdc5bcc5d61d0371534f0aee475
MD5 a4a7b30f25c5d5b07363daba139dff08
BLAKE2b-256 0ddde890f977ab15ef82dea3af8f09c2c1914a1278acd98d06e144f9910872b0

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cc15fd7777a4b4256cb579586e83f19dfaf8a626f29b1f48bd837f0f88a42b6c
MD5 a3607e3e45c65768284e7d7fc12b2dac
BLAKE2b-256 b10ffb4deddd281f5c5708c57db731b9a08596ca451ec55dcced8b8c7aa5e1b5

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e0dee15b473848884c301269bcf9405890ac2f8d15531f4ab6f5c0b4eb1799b2
MD5 2125d59ba8dcc9143088f698fcbb502f
BLAKE2b-256 1b0cf01cd5f7bec30f07b8a934bc620bf19d57a46ab198e2330acd7300d6d4c7

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afb61e4c8ac17c52be0c45bf61a6b1984d413557eacb8100c9b37ef08a6dcf24
MD5 06466cec6c964453c772d1f9204ded6c
BLAKE2b-256 cd9d7d2b02f8649657f57e36a096425c332d94bb17496fecb47192c39f25a242

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp312-cp312-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 33ff0e88529cb9fb6892f2baec441eb638c0f1913154ed2bb3c484d877243a2e
MD5 8bbff9dc8a9759466d71365f8e42baed
BLAKE2b-256 12f646c4aba10ae59990dcf736c01986b23191d9f27fef0de69542d525b9fd1c

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 17354854727596708ff4b9ce6f7b64d7f096545740d00ad3f5a4ec9d169da468
MD5 6e92617874cd958175b66f9ae43880bd
BLAKE2b-256 0e4a128fa955a12b82a08f67447a4f54c1e883d9c4f3f68dc7c74d69ec979fc8

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 846aa24231dd8874db42fc67fbf5c715f0924b704820f2d26daa7506aae7529c
MD5 4ecf65a6c945294872b42ca567773d68
BLAKE2b-256 660f2505790d4d0333b6837c7935b8a16ee3c06567fdd3a50b27a8e99d00a840

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c21eaa29ce328af7c3899fae3d0bcd432691ab4af51934f6cd50ea2f975e9f9
MD5 0798d339399f7ada43904621b65c4e66
BLAKE2b-256 e4ee86f2164dcf995ab10c3e78485e87f205c89df8b067170499e5bd84d6b1c3

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c40c5ec3306d9306a1761179b04c262c8f61d1568fa475d9c74f19358ab2b1cf
MD5 4836f1cca1fa47f84c65b3635d31cfb0
BLAKE2b-256 24bf2fbc7cabc11bee33fef793bd8fdc4e215c342a36b6e66eeaabb826fa60c9

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c731700013511574a649b7950e91567e962a5f61fcbc429b8845822e8672b667
MD5 c476f6c73d01ad212225b5610a70cd44
BLAKE2b-256 7d195aad3e7e92a9a03743c31d4b9b485d86778dc41b601bcabc304e7a2e2ab8

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a27c52734413717e70268d71474a3d3a9074fd5ec19b96e99e871602fdbc9d32
MD5 4f805eafdc946cc33fefe0481f98ab13
BLAKE2b-256 9c2f63d21ea5d2d131460e67d856b741e845563a5cee06e990a87f0793423a9b

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b37a888569d60191f79c040291c3bcd08a174ead1e566769a7901f7d613cacb0
MD5 9c560c02c407c8929e8afa1e1c199450
BLAKE2b-256 7747a5ec69586b96c3557c722f3a7ccc54d138493d01a3a5da66fd58387bcacf

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3f0de332709a0a589313fa4d6b37cda2edf260930b30229b48add487b0b0bc00
MD5 726f14822ee17dc43d4f2594317c3f02
BLAKE2b-256 7b49c0603ed173a76a420bc19b1ba57c4d3e0fb916fce9767be78f68b1ec606b

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5a16375e91f6e200cb3d3ce797f9e47e9472be8e17cef73a07fae8703d86ada2
MD5 5882d6914a97504f7dcb79bd2c2d8cea
BLAKE2b-256 1ecf272ef62d884aa52776a4ed9910d284aa128addb97d83ede8a57db98fe419

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b4e446e43860c9c97bb8dc8fe25afbe74ff578071d8babfec12cacdc65de0a4c
MD5 cf61ee52403d12878fe3581686ec6a31
BLAKE2b-256 3df47d326b3ddd0e72c043d358684d2f8953ba38b85d28910040b8c8dbf7b68d

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d1d7615bfe63910ef64ab6cdf3db1d07356292b1acc9d12b25ff0177ff185b4
MD5 0fb9282c9fb4ee2f4d916fbb99834f34
BLAKE2b-256 f36577b1a1c12c4eba889987066417ed226010207b61f259efc2a2b293aef80b

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d0f3c1e3fff9df6fda0ba56c48d10ef5f30d2b04423e7e4df5f08b2d89d82768
MD5 af7ca2d8ef27afb7d5a6f0a86c1a3a74
BLAKE2b-256 c2480e17573d48b1c25ef956809301a05e02968d445c0e59c8d8e3ed163ff833

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 11020b945cf58269e6d3de455c923ee0d25331eb34ce6a7f1295c5a6ee2ab6b8
MD5 09d982829093313204f80beb0b469ecd
BLAKE2b-256 83aa068dea6fff6c15bdd3f9f5fd28327b6ea1302d1e2ea75bb5e65081c1a580

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b45bb2d235a5d918a05b6de7a5496293cc508ec53bb22de69c1ada361e1f8c6
MD5 0fe233c3d7a25c3e89143debd6f9f4ed
BLAKE2b-256 e5c6f30bfcf969a93d04fca8e30ba317e371f7c1bdf680a1b279f96aa97d7672

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c58a83923f9110e215734a11ec1b416aca732dd6fce85578c658e20145ce8b25
MD5 9b33bbc95c39e2d33833eb561610483d
BLAKE2b-256 cf135dbcaa5ee3fded76d193429a75495f58af62acfd6a0aea7f1625b2c965c0

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.19.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.19.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 bdccc7303eb1295dfe5b40a76e75b8cff7dc582d4d0e2af4082ad18223020671
MD5 42841ca47c87c3669fd9b606623cf79f
BLAKE2b-256 43661d3ac3117f879ff549339a7d9ff0f4857307d7a4e3e9a15d2a2cb6a2f05f

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