summaryrefslogtreecommitdiff
path: root/cnn_v3
diff options
context:
space:
mode:
Diffstat (limited to 'cnn_v3')
-rw-r--r--cnn_v3/docs/HOW_TO_CNN.md7
-rw-r--r--cnn_v3/training/train_cnn_v3.py4
2 files changed, 11 insertions, 0 deletions
diff --git a/cnn_v3/docs/HOW_TO_CNN.md b/cnn_v3/docs/HOW_TO_CNN.md
index 4e64d23..020f79c 100644
--- a/cnn_v3/docs/HOW_TO_CNN.md
+++ b/cnn_v3/docs/HOW_TO_CNN.md
@@ -289,6 +289,13 @@ pip install torch torchvision pillow numpy opencv-python
cd cnn_v3/training
```
+**With `uv` (no pip needed):** dependencies are declared inline in `train_cnn_v3.py`
+and installed automatically on first run:
+```bash
+cd cnn_v3/training
+uv run train_cnn_v3.py --input dataset/ --epochs 1 --patch-size 32 --detector random
+```
+
### Quick-start commands
**Smoke test — 1 epoch, validates end-to-end without GPU:**
diff --git a/cnn_v3/training/train_cnn_v3.py b/cnn_v3/training/train_cnn_v3.py
index 6da9abb..083efb0 100644
--- a/cnn_v3/training/train_cnn_v3.py
+++ b/cnn_v3/training/train_cnn_v3.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python3
+# /// script
+# requires-python = ">=3.10"
+# dependencies = ["torch", "torchvision", "numpy", "pillow", "opencv-python"]
+# ///
"""CNN v3 Training Script — U-Net + FiLM
Architecture: