GPU-accelerated image processing in python using OpenCL
Project description
py-clesperanto
pyclesperanto is the python package of clEsperanto - a multi-language framework for GPU-accelerated image processing. clEsperanto uses OpenCL kernels from CLIJ. This package relies on the CLIc back-end for processing.
Installation
Get a conda/python environment, e.b. via mini-conda. If you never used python/conda environments before, please follow the instructions here first.
conda create --name my_env python=3.10
conda activate my_env
Install pyclesperanto package using conda: (WIP, please use pip instead)
conda install -c conda-forge pyclesperanto
OR using pip:
pip install pyclesperanto
Code Example
Note: This project is under heavy development. General API, functions, and parameters are subject to change.
import pyclesperanto as cle
from skimage.io import imread, imsave
# initialize GPU
device = cle.select_device()
print("Used GPU: ", device)
image = imread("https://imagej.nih.gov/ij/images/blobs.gif")
# 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_box(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)
Example gallery
More usage and example can be found as notebooks in the demos folder
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pyclesperanto-0.6.7-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a557ff743d3f08c3ecf63c984453efbe5638ede9145fded127508dcab043bfdb |
|
MD5 | 440f11fc42685179cba66245fbb69836 |
|
BLAKE2b-256 | c3948b0c52b3ad129bd6ede3b080125caca3ba18b4da2842b67771a1a34ebca8 |
Hashes for pyclesperanto-0.6.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b97b17fbf922b1fe7d9d78a4bf8b7b3daedf902bcef2dc70903b17883edf700 |
|
MD5 | 3e66566f8eb6a7cd4e6035e09c45295e |
|
BLAKE2b-256 | a94ed4dade4efa5bb918a32c9daa538db3758df8da5cab0233969fc11fe9013c |
Hashes for pyclesperanto-0.6.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1580ad3795a685fa272f47ac154b1243f1da72e7f51949db7e66d64600d0c5c |
|
MD5 | d812fa898bd61d186f0acf252b277360 |
|
BLAKE2b-256 | 295cdcbb5a2947a1b08eb344d0c2bfd036d1eb90341f6c4e07a02b2b8413601b |
Hashes for pyclesperanto-0.6.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87d46be96b424c3cc8a2fdf43487f411b068bb4a9dc5dd7c8ab6cfb108b1397e |
|
MD5 | 531fd75b3ac965523a893e7466ddf166 |
|
BLAKE2b-256 | 43e7c91bf293695000ca8281201cd3fdf5f051ce2c83605db2748401bb9da110 |
Hashes for pyclesperanto-0.6.7-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09e5ca7b2575c67f958a7d7caab22f843f77e41616092d868725ecd22d59548a |
|
MD5 | a1668a8a09235cdaa098cfcd59cf1bd1 |
|
BLAKE2b-256 | c80bc7c321e131ccb2eaf9633114d8573a11c5b846139944d53e8f7dcf928e88 |
Hashes for pyclesperanto-0.6.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4976ceb524d71f8183af2df31c4d278a1abe4ee8fc519665b6d452ad6b63bcc2 |
|
MD5 | 884f91a9cc48272e9413b1704b948e91 |
|
BLAKE2b-256 | ce6aef2d8f96747835c1ee665f3986f72193f42092a4afc0fabcdc3c874106a4 |
Hashes for pyclesperanto-0.6.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddf5cd01013481fee41fe41f95617db3f6f46179cabd814d2d3a6c82dc8c3019 |
|
MD5 | fb898efa71d5ba97a153085c0d876aba |
|
BLAKE2b-256 | e370c1979bdece987dcd7991e750fa937f43793a1f54d8c0f6e7aebdcb150e31 |
Hashes for pyclesperanto-0.6.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0057f08122b2fbd3b1dfd346c1e8a7d476395fcec50dc1a8f1ddfbabc32a59b |
|
MD5 | db39bde6f7ea1f7b336a568b29abf6da |
|
BLAKE2b-256 | aaca4188c2959451f3fc0c252eb8faba71a4f887134df733ebf6f4b732336717 |
Hashes for pyclesperanto-0.6.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4731a25a162023e92463375b610a5617daf78ba52dbaeb3e4351f48ab1c55585 |
|
MD5 | 3764b83bfc3967af0eaea54df44d4e13 |
|
BLAKE2b-256 | 05258ea348fe859633a21b12f7d0339ac734db866ad04b21332e8cc0eb892bff |
Hashes for pyclesperanto-0.6.7-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cc8d3f63307c0961b6e7caaca972db0a5079e8bae4bbf6ab528c2f9ab2c359e |
|
MD5 | 82b6c04340616c849f56e12d84eca831 |
|
BLAKE2b-256 | dd1329713201655fda6d85f87342f733180e4231f4634e20ce70f5db6daab0cc |
Hashes for pyclesperanto-0.6.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95a629eae504c8b9867a8b835a8e4f3abd5583ad04dbf75b884a7e4eb2d4406a |
|
MD5 | 76d562efbbb8cb0485a273a5dac4aedb |
|
BLAKE2b-256 | 58a8fc138fc50470df13456f7fe7490038a30d9745f29a3744cfdf107b130da4 |
Hashes for pyclesperanto-0.6.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b71ef49f591a22ca9593b91f4c42b5bf433b934d1ba9e10a68d352682029295 |
|
MD5 | 6b7834e17ea760300f6da40daab7f9af |
|
BLAKE2b-256 | bb959aaed158a54d58990d523b4984b2b3956bac7d7656fc915503b4900f6339 |
Hashes for pyclesperanto-0.6.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adece7ff29c0c766ee65976c43cebd09e3c08227a510d1f55fa14039a8e9ed54 |
|
MD5 | f2b60d6a0330c1d683b06b608aa10842 |
|
BLAKE2b-256 | b2c787a127a97e529167033b37fd85e10385bb45365ececea06591482b52ca14 |
Hashes for pyclesperanto-0.6.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7deda03624eff58980e44e2a3a28243f9949a36012813895e021473137804eb5 |
|
MD5 | dde5091bbcc0d4e494d1aabeaea9be98 |
|
BLAKE2b-256 | 39085be1242802dd8fe855464b7a333258ad168af4b93ed41ed1f78b26c37862 |
Hashes for pyclesperanto-0.6.7-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e673c3c85e698c030898fa0a7881b6140a2a1753f361d49e7cf9181b84ce46ab |
|
MD5 | ff58b6af1c0d6e51e6d076d869836791 |
|
BLAKE2b-256 | a7417aa209fa88451d5a997284a72172e0733a52b8d4445afc389eb1f70f8dbd |
Hashes for pyclesperanto-0.6.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dea62a0e3f2b48e0762a70f6c744062c4fdaf7e3a9849a66494c7f7660a3fee |
|
MD5 | 0b53780010fd2999d5fcd283df654344 |
|
BLAKE2b-256 | d7d5d85fbd70e15f8bbf0325bc6a09e6b0ed7fa30341af1c660bcd30bfad3eb3 |
Hashes for pyclesperanto-0.6.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78f034750793a2e1f8c8670a414e37086a48d48a1b7d8585f85fe86ab167b5ac |
|
MD5 | 79027d5392ea76c295d8fff9d91ada5f |
|
BLAKE2b-256 | b6fb46ab5666fda2cdb8d8b0aa27f451e8c60b39534686609267b30c5f4ea101 |
Hashes for pyclesperanto-0.6.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948f0fc5c9b0854a819844e91a313cd2456da847c19528f6da7866488f7bac74 |
|
MD5 | 8f138c1fa4cad39fcab14585403a6e0a |
|
BLAKE2b-256 | 06abec3f695ef5ae343018f1812a923b875e37b44a22599154f5eca3af1bbdd9 |
Hashes for pyclesperanto-0.6.7-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 402791696a0eb9fdad24165b6f862cef584556edb5bb9a6374da20629079f73c |
|
MD5 | 685532eb6b42eb1c769c90e979a60fa5 |
|
BLAKE2b-256 | 9e298bf439798e1da1353b53828629a1cbe7fce7beb62d44adc65723c46ee60b |
Hashes for pyclesperanto-0.6.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d6da2345ad1c49031e8a2147386adee97d54147b063c28afc75c321688af5f5 |
|
MD5 | 6b2f2f33555ee4ac5bdc93d453340faf |
|
BLAKE2b-256 | 9c8e289ba4b321dfb9130b7908f72881fc629aaadf1b8a9354026c309642f5bd |