RGB search with numba.cuda - 10 x faster than numpy
Project description
RGB search with numba.cuda - 10 x faster than numpy
pip install locate-pixelcolor-numbacuda
from locate_pixelcolor_numbacuda import search_colors
from a_cv_imwrite_imread_plus import open_image_in_cv
import numpy as np
colors=[(66, 71, 69),(62, 67, 65),(144, 155, 153),(52, 57, 55),(127, 138, 136),(53, 58, 56),(51, 56, 54),(32, 27, 18),(24, 17, 8),]
image'https://www.pexels.com/pt-br/foto/foto-da-raposa-sentada-no-chao-2295744/'
picnp = open_image_in_cv('pexels-alex-andrews-2295744.jpg',channels_in_output=3)
coords=search_colors(pic=picnp,colors=colors,threadsperblock=(18, 18,3),dtypetouse = np.int32)
print(coords)
%timeit search_colors(pic=picnp,colors=colors,threadsperblock=(18, 18,3),dtypetouse = np.int32)
# [[[ 19 14]
# [ 19 14]
# [ 11 17]
# ...
# [6613 4524]
# [6614 4524]
# [6615 4524]]]
# 135 ms ± 3.5 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
# More benchmarks: https://github.com/hansalemaos/locate_pixelcolor_cpp
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 Distribution
Close
Hashes for locate_pixelcolor_numbacuda-0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4be17bc1996ba6dff3e21e6f9ef698411b768c75cc60149dd2d79cfaaa0f4bc1 |
|
MD5 | 6a1e70d691f1166345fb2ea20bbdac1f |
|
BLAKE2b-256 | d95c56f7f6951b5ea88ebf3add799807f5ada620639c17cb81f94b507420ad79 |
Close
Hashes for locate_pixelcolor_numbacuda-0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a544ca61fc2edb326aa301717ff536f119d4a5e6bbdb3be4225a5e847c9cc8fe |
|
MD5 | 2afd284b9d38e6828967c8db78251ace |
|
BLAKE2b-256 | b81325c3bf17022eedb479f4070a5f9cde95b8b5ccc87dc9fea2d6a21887ee90 |