Detection and Segmentation Pipelines
Build detection and segmentation pipelines with reliable data splits, task-specific evaluation, and practical deployment checks.
Before & after
Same prompt, same agent — the only difference is the skill.
Object detection is a solid use case for computer vision. There are several approaches you could take. Deep learning frameworks like PyTorch are popular. You might want to look at using pre-trained models since training from scratch can be expensive. YOLO is a common choice, and there are also models like Faster R-CNN. For your product images, you could fine-tune an existing model. This typically involves getting labeled data, setting up a training pipeline, and then evaluating performance. Would you like help thinking through the setup process?
ARCHITECTURE RECOMMENDATION MODEL SELECTION • Framework: PyTorch + Ultralytics (YOLO v8) • Reasoning: Real-time inference (60+ fps), accurate for product shapes, lower compute cost than Faster R-CNN • Alternative: Faster R-CNN if accuracy over speed matters more TRAINING PIPELINE OUTLINE 1. Prepare dataset (minimum 1000 labeled product images) - Use Roboflow or similar for annotation if raw data unlabeled - Split: 70% train, 15% val, 15% test 2. Fine-tune YOLO v8 on products (starting from COCO-pretrained weights) - Epochs: 50 (with early stopping) - Batch size: 16 - Data augmentation: rotation, brightness, slight scaling 3. Evaluate: mAP50 target minimum 0.85 for production PRODUCTION DEPLOYMENT • Docker container with PyTorch ONNX-optimized model • API endpoint (FastAPI): POST image → JSON bounding boxes • Latency target: 100-200ms per image • GPU: single A100 or 2x A10 handles typical e-commerce throughput COMON PITFALLS • Poor lighting consistency between training and catalog = accuracy drop • Class imbalance (many T-shirts, few rare items) → use weighted sampling • Small products lose detail → increase input resolution to 1024x1024
About this skill
Your detector looks accurate in a notebook, then misses small defects on the live camera. Your exported model runs faster, but its boxes or masks shift. This skill helps build detection and segmentation pipelines whose data, evaluation, and deployed behavior agree.
What it does
- Chooses detection, semantic segmentation, instance segmentation, or prompted segmentation from the actual decision the system must make.
- Defines annotation rules and splits camera, video, subject, or production-run data without near-duplicate leakage.
- Selects practical baselines across YOLO, Faster R-CNN, DETR, Mask R-CNN, and SAM without assuming one family is always best.
- Diagnoses missed small objects, class imbalance, background false positives, and preprocessing errors before recommending larger models.
- Designs threshold selection and evaluation around missed objects, false alarms, mask boundaries, and operational constraints.
- Plans PyTorch-to-ONNX/TensorRT deployment with numerical parity checks, realistic latency measurements, and bounded quantization experiments.
What you get
A request-sized engineering deliverable: a pipeline design, targeted diagnosis, training or inference implementation, or deployment validation plan. Recommendations distinguish measured evidence, assumptions, and checks still needed.
Best for
Engineers building custom visual inspection, camera analytics, object detection, or segmentation systems in PyTorch and related frameworks, especially when notebook results must survive production deployment.
SKILL.md preview
---
name: detection-and-segmentation-pipelines
description: Build, debug, train, and deploy computer vision detection and segmentation pipelines by checking annotation contracts, split leakage, image geometry, operating thresholds, and export parity before optimizing inference. Use when the user says "build a custom object detector", "segment these defects", "my detector keeps missing small objects", "validation is great but the camera feed fails", "choose between YOLO and DETR", "my ONNX boxes are shifted", "speed up inference with TensorRT", or "review my vision training pipeline".
---
# Detection and Segmentation Pipelines
… (sign up to view the full skill)More development skills
View all Development skills →Pandas Data Wrangling Without Silent Errors
Correct, fast pandas code for merging, cleaning, groupby, reshaping, and time series, with checks that catch silent row loss.
Apache Spark Job Tuning and Debugging
Finds why a Spark job is slow or failing from the plan and UI metrics, then gives the code and config fix plus how to verify it.
Reliable Data Pipelines and Analytics Models
Build and repair ETL/ELT pipelines with replay-safe writes, explicit data contracts, and actionable quality checks.
Statistical Tests, Power & A/B Readouts
Get hypothesis tests, effect sizes, confidence intervals, and sample-size calculations with experiment validity checks.