A Python package for manipulating thermographic data in Non-Destructive Testing (NDT) applications.
Project description
PyThermoNDT
PyThermoNDT is a Python package for manipulating thermographic data in Non-Destructive Testing (NDT) applications. It provides various methods to load, transform, visualize, and write thermographic data, making it easier and more efficient to work with thermal imaging in NDT contexts.
Features
- Multi-source Data Loading: Read thermographic data seamlessly from local files and S3 storage
- Hierarchical Data Structure: Store and access thermographic data, metadata, and ground truth in a common format
- Remote Data Caching: Optionally cache data from remote sources for improved performance
- Composable Transforms: Build custom processing pipelines with reusable transform components
- PyTorch Integration: Datasets compatible with PyTorch DataLoader for training deep learning models
Quick Example
from torch.utils.data import DataLoader
from pythermondt import LocalReader, S3Reader
from pythermondt import transforms as T
from pythermondt.dataset import ThermoDataset, container_collate
# Load data from different sources
local_reader = LocalReader("./examples/example_data/**/*.hdf5", recursive=True)
s3_reader = S3Reader("ffg-bp", "example2_writing_data", download_files=True)
# Create optimized transform pipeline (deterministic transforms first for better caching)
transform = T.Compose([
T.ApplyLUT(), # Convert raw data to temperatures
T.RemoveFlash(), # Remove flash frames
T.NonUniformSampling(64), # Resample data to 64 frames
T.CropFrames(96, 96), # Center crop the frames to 96x96
T.MinMaxNormalize() # Normalize data
])
# 1.) Access individual files using readers
container = local_reader[0]
processed = transform(container)
# 2.) Analyse processed data
processed.show_frame(frame_number=10)
processed.analyse_interactive()
# 3.) Combine sources in a dataset for training workflows
dataset = ThermoDataset([local_reader, s3_reader], transform=transform)
# 4.) Build cache for faster training (splits pipeline at first random transform)
dataset.build_cache("immediate")
# 5.) Use with PyTorch DataLoader for model training to be used in your training loop
collate_fn = container_collate('/Data/Tdata', '/GroundTruth/DefectMask')
dataloader = DataLoader(dataset, batch_size=4, shuffle=True, collate_fn=collate_fn)
for epoch in range(50):
print(f"Epoch {epoch + 1}")
for thermal_data, ground_truth in dataloader:
print(f"Thermal data shape: {thermal_data.shape}") # [4, 96, 96, 64]
print(f"Ground truth shape: {ground_truth.shape}") # [4, 96, 96]
From here?
PyThermoNDT is yours to use! You can start by exploring the examples directory for more detailed usage scenarios. The package is designed to be flexible and extensible, so feel free to modify and adapt it to your specific needs.
Installation
From PyPI (Recommended)
Install the latest stable release from PyPI:
pip install pythermondt
From GitHub
Install the latest development version from the main branch:
pip install git+https://github.com/voidsy-gmbh/pyThermoNDT.git
From Source
Clone the repository and install locally:
git clone https://github.com/voidsy-gmbh/pyThermoNDT.git
cd pyThermoNDT
pip install .
Documentation
For detailed usage examples, check out the Jupyter Notebooks in the examples directory.
Contributing
Contributions are welcome! Please see the Contributing Guidelines for details on setting up a development environment, coding standards, and the pull request process.
Funding
This project was partially funded by the Austrian Research Promotion Agency (FFG)
- under grant numbers 920062 and 901177 as part of the project 'Thermal tomography'
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythermondt-0.3.3.tar.gz.
File metadata
- Download URL: pythermondt-0.3.3.tar.gz
- Upload date:
- Size: 71.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
579a29758c63d7f719af082d6062254fc09340d99a4102c10f9dcaddc04c1194
|
|
| MD5 |
ca93e612e956bc7b7d9dcc111743a2f5
|
|
| BLAKE2b-256 |
dd858db90a694d20b3c16e64061ff1b2679cd6d1e755b0f4553ca3bbc33d4601
|
Provenance
The following attestation bundles were made for pythermondt-0.3.3.tar.gz:
Publisher:
post_release.yml on voidsy-gmbh/pyThermoNDT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythermondt-0.3.3.tar.gz -
Subject digest:
579a29758c63d7f719af082d6062254fc09340d99a4102c10f9dcaddc04c1194 - Sigstore transparency entry: 981937002
- Sigstore integration time:
-
Permalink:
voidsy-gmbh/pyThermoNDT@edf22832c02a98afe25874fdf2e3dede782d84e1 -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/voidsy-gmbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
post_release.yml@edf22832c02a98afe25874fdf2e3dede782d84e1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pythermondt-0.3.3-py3-none-any.whl.
File metadata
- Download URL: pythermondt-0.3.3-py3-none-any.whl
- Upload date:
- Size: 89.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53000e565ceaab124eeb8f9f3d17acd079ccd1d0f307955b4c4fbde2347d2318
|
|
| MD5 |
099a1e6a55d4cfdc28f664758059e5e5
|
|
| BLAKE2b-256 |
4ed5cd94179a43245e044aac83c504283798d848f44a996b91b7f760b811729a
|
Provenance
The following attestation bundles were made for pythermondt-0.3.3-py3-none-any.whl:
Publisher:
post_release.yml on voidsy-gmbh/pyThermoNDT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythermondt-0.3.3-py3-none-any.whl -
Subject digest:
53000e565ceaab124eeb8f9f3d17acd079ccd1d0f307955b4c4fbde2347d2318 - Sigstore transparency entry: 981937048
- Sigstore integration time:
-
Permalink:
voidsy-gmbh/pyThermoNDT@edf22832c02a98afe25874fdf2e3dede782d84e1 -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/voidsy-gmbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
post_release.yml@edf22832c02a98afe25874fdf2e3dede782d84e1 -
Trigger Event:
release
-
Statement type: