| name | cv-pipeline-builder |
| description | Computer vision ML pipelines for image classification, object detection, semantic segmentation, and image generation. Activates for "computer vision", "image classification", "object detection", "CNN", "ResNet", "YOLO", "image segmentation", "image preprocessing", "data augmentation". Builds end-to-end CV pipelines with PyTorch/TensorFlow, integrated with SpecWeave increments.
|
Computer Vision Pipeline Builder
Overview
Specialized ML pipelines for computer vision tasks. Handles image preprocessing, data augmentation, CNN architectures, transfer learning, and deployment for production CV systems.
CV Tasks Supported
1. Image Classification
from specweave import CVPipeline
pipeline = CVPipeline(
task="classification",
num_classes=10,
increment="0042"
)
pipeline.fit(train_images, train_labels)
2. Object Detection
pipeline = CVPipeline(
task="object_detection",
classes=["person", "car", "dog", "cat"],
increment="0042"
)
3. Semantic Segmentation
pipeline = CVPipeline(
task="segmentation",
num_classes=21,
increment="0042"
)
Best Practices for CV
Data Augmentation
from specweave import ImageAugmentation
aug = ImageAugmentation(increment="0042")
aug.add_transforms([
"random_rotation",
"random_flip_horizontal",
"random_brightness",
"random_contrast",
"random_crop"
])
aug.add_advanced([
"mixup",
"cutout",
"autoaugment"
])
Transfer Learning
pipeline = CVPipeline(task="classification")
pipeline.use_pretrained(
model="resnet50",
freeze_backbone=True
)
pipeline.use_pretrained(
model="resnet50",
freeze_backbone=False,
fine_tune_after_epoch=3
)
Model Selection
Image Classification:
- Small datasets (<10K): ResNet18, MobileNetV2
- Medium datasets (10K-100K): ResNet50, EfficientNet-B0
- Large datasets (>100K): EfficientNet-B3, Vision Transformer
Object Detection:
- Real-time (>30 FPS): YOLOv8, SSDLite
- High accuracy: Faster R-CNN, RetinaNet
Segmentation:
- Medical imaging: U-Net
- Scene segmentation: DeepLabV3, SegFormer
Integration with SpecWeave
.specweave/increments/0042-image-classifier/
├── spec.md
├── data/
│ ├── train/
│ ├── val/
│ └── test/
├── models/
│ ├── model-v1.pth
│ └── model-v2.pth
├── experiments/
│ ├── baseline-resnet18/
│ ├── resnet50-augmented/
│ └── efficientnet-b0/
└── deployment/
├── onnx_model.onnx
└── inference.py
Commands
/ml:cv-pipeline --task classification --model resnet50
/ml:cv-evaluate 0042
/ml:cv-deploy 0042
Quick setup for CV projects with production-ready pipelines.