Skip to main content

findcrack

Deep learning crack detection package. Pixel-level segmentation on high-res images. Supports U-Net, DeepCrack, custom ONNX. Fast, robust, modular, minimal deps (ONNX mode).


What

Deep learning package. Pixel-level crack segmentation. Detects cracks in concrete images.

Why

Standardize crack detection for research, industrial, civil. Fast. Loads models dynamically. PyTorch optional.

Features

  • Pretrained model registry
  • Patch inference (sliding window)
  • Seamless ONNX/PyTorch backend
  • Gaussian/average blend (no seams)
  • Test-time augmentation (robust mask)
  • Metrics: IoU, Dice, Precision, Recall, Pixel Accuracy
  • Custom image preprocess (CLAHE)
  • Patch extraction, blending
  • Register custom model, CLI + notebook support

Install

Minimal (ONNX/NumPy)

pip install findcrack

or

uv add findcrack

Only ONNX, NumPy. No PyTorch.

Standard (PyTorch model/training):

pip install "findcrack[standard]"

or

uv add findcrack --extra standard

Virtual Env

python -m venv .venv
source .venv/bin/activate     # Linux/mac
.venv\Scripts\activate.bat    # Windows

Or uv venv


Usage

Basic Inference

from findcrack import CrackInferencePipeline, load_model

model = load_model("Det_YOLOv26n-seg_crack-dataset_v1", device="cpu")
pipeline = CrackInferencePipeline(
    model=model, device="cpu", patch_size=512, overlap_ratio=0.2, confidence_threshold=0.5, use_tta=True
)
results = pipeline.predict("path/to/image.jpg")
# results: dict with images, masks, overlay, bounding boxes, contours, etc.

Visualize

result keys:

  • binary_mask - segmentation mask
  • overlay - cracks overlay
  • visualization - boxes and contours

Save e.g. cv2.imwrite('out.png', results["overlay"])

Custom Model

from findcrack import load_model, UNet
model = load_model(variant="/path/to/.pth", architecture=UNet, device="cpu")

Register custom model:

from findcrack import register_model
register_model(name, url, architecture=UNet, kwargs={...}, backend="pytorch")

List models:

from findcrack import list_models
print(list_models())

Pipeline

  • Sliding window patch infer
  • Overlap, blend
  • TTA: flips + rotation
  • CLAHE (contrast)

Directory Structure

  • demo/ - CLIs, mock, runner
  • src/findcrack/
    • models/ - U-Net, DeepCrack, ONNX, registry
    • inference/ - pipeline, TTA
    • evaluation/ - metrics
    • preprocess/ - CLAHE, patch, transforms
    • postprocess/ - blending

API Entry

From __init__.py:

  • CrackInferencePipeline
  • load_model, UNet
  • calculate_metrics
  • apply_lab_clahe, get_inference_transform
  • Preprocessor, PatchExtractor, ImageScaler
  • PatchBlender
  • list_models, register_model, get_model_status_map

Script Usage

Batch CLAHE preprocess CLI:

python -m findcrack.preprocess input.jpg output.jpg --clip-limit 2.0 --tile-grid-size 8 8

Demo

Run demo pipeline with model, image:

uv run python demo/demo.py --model Det_YOLOv26n-seg_crack-dataset_v1 --image path/to/image.jpg

Look for results in output/.


Advanced

Manual patch extraction, blending—see readme + src for more.


Requirements

  • Python >=3.11
  • Core: albumentations, onnxruntime, opencv-python, pillow, numpy, matplotlib, scikit-image, scipy, pandas, seaborn, scikit-learn, tqdm, ipykernel
  • standard/torch extra: torch, torchaudio, torchvision, segmentation-models-pytorch

Dev Setup

  • install uv
  • uv pip install -e .[standard]

Common Errors

  • Incorrect path: FileNotFoundError
  • No PyTorch (for .pth): must install with [standard]
  • CUDA/MPS unavailable: use device="cpu"
  • Image must be RGB, high-res
  • Out of memory: lower patch_size

License

MIT

Metadata

Release files for findcrack 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for findcrack 0.1.8
File Size Uploaded Provenance Actions
findcrack-0.1.8.tar.gz 33.3 kB With provenance Details for findcrack-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for findcrack 0.1.8
File Interpreter ABI Platform Actions
findcrack-0.1.8-py3-none-any.whl Python 3 none any Details for findcrack-0.1.8-py3-none-any.whl

Total release size: 64.2 kB

Release files / findcrack-0.1.8.tar.gz

Download URL findcrack-0.1.8.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
98ab53060cdb7fabf5b384f6e098e16352e5d75ba1301dbef4cc4913143e838c
BLAKE2b-256 checksum
How to use checksums
dcee1a949ddc2875e9dbb15c07f10ca90a50334d3dd91bc52ad8a35179129150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / findcrack-0.1.8-py3-none-any.whl

Download URL findcrack-0.1.8-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d4b5198aecf7cc674ecd0f977a6d37fe458aea7e056a858cbb05740c3cbf6f9
BLAKE2b-256 checksum
How to use checksums
390f04deaa43cd4f83f576774453f19496eb5167da3bdc5b646786238305e96a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Security for findcrack 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for findcrack-0.1.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page