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!
AI & ML
Source:https://dev.to/sergeiyvaryukhin/i-built-haralickt-20x-faster-gpu-accelerated-haralick-texture-features-glcm-in-pytorch-with-12ln
I built haralickt: > 20x faster GPU-accelerated Haralick texture features (GLCM) in PyTorch with identical precision to Mahotas
dev.to OpenSource0 views
PreviousManaging CentOS from Python: Reemote's `dnf` and `systemd` modulesNextHow to identify meeting notetakers with an open dataset
Related posts
OpenAI and Databricks: Enterprise AI on your governed data
0Databricks Blog
Any AI code review tools for GitHub PRs?
0dev.to GitHub
Half of Shoppers Don't Want an AI Agent Buying for Them
0dev.to News
The Best AI Video Generator Right Now Is Not Sora: Gemini Omni 1.2 Flash Tops the Chart
0dev.to News
A Better Website Brief for a Manufacturing or B2B Supplier
0dev.to Design
When a bug shows up, do you read the stack trace yourself or paste it to your coding agent first?
0dev.to Discuss