# deadlift

A personal ML model toolkit. Plug-and-play inference for various deep learning models.

## Installation

```bash
pip install deadlift
```

Model weights are downloaded automatically from HuggingFace on first use.

## Crack Detection

```python
from deadlift.crack import CrackModel

model = CrackModel(device="auto")
result = model.predict("image.jpg")

# result["crack_mask"]   — binary mask (numpy array)
# result["crack_prob"]   — probability heatmap (numpy array)
# result["detections"]   — list of filtered detections with bboxes
# result["overlay"]      — annotated image with bounding boxes
```

### Configuration

```python
# Fast mode
model = CrackModel(device="mps", mirroring=False, tile_step=0.75)

# Max accuracy
model = CrackModel(device="cuda", mirroring=True, tile_step=0.5)

# Custom confidence threshold
result = model.predict("image.jpg", min_confidence=0.5, min_area=200)
```

### Save outputs

```python
import cv2

result = model.predict("image.jpg")
cv2.imwrite("overlay.png", result["overlay"])
cv2.imwrite("mask.png", result["crack_mask"])
```
