DEV Community

Sergeiy Varyukhin
Sergeiy Varyukhin

Posted on Edited on

I built haralickt: > 20x faster GPU-accelerated Haralick texture features (GLCM) in PyTorch with identical precision to Mahotas

Hi everyone!
If you work with texture analysis (medical imaging, satellite data, or industrial defect detection), you've likely noticed that classic libraries like mahotas and scikit-image compute Gray-Level Co-occurrence Matrices (GLCM) and Haralick features strictly on the CPU. On large datasets, this quickly becomes a major pipeline bottleneck.
To solve this, I wrote and open-sourced haralickt — a library that offloads these computations to the GPU using vectorized matrix operations in PyTorch and CUDA.
Key highlights:
• > 20x faster than traditional CPU implementations on high-resolution images and batches.
• Identical numerical precision to classic implementations (verified against mahotas).
• PyTorch-native: works seamlessly with torch.Tensor on GPU without costly CPU-GPU data transfers.
• Open Source (MPL 2.0): free to use in research and commercial projects.
Quick installation:
bash
pip install haralickt
Используйте код с осторожностью.
GitHub repository & benchmarks: [https://github.com/SergeiyVaryukhin/haralickt-1.0.0]
This is my first public release (v1.0.0), so I would really appreciate any feedback, bug reports, or ideas for new features. If you find it useful for your projects, a star on GitHub would mean a lot!

Top comments (1)

Collapse
 
sergeiyvaryukhin profile image
Sergeiy Varyukhin •