Detection and Segmentation Pipelines

Build detection and segmentation pipelines with reliable data splits, task-specific evaluation, and practical deployment checks.

Development / Data & MLcomputer-visionobject-detection
by AgentVoltv1.0.0
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

Prompt“Build an object detector for product images in an e-commerce catalog”
Beforegeneric AI agent
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?
Afterwith Detection and Segmentation Pipelines
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

SKILL.md
---
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)
Sign up to view, copy, and install the full skill

More development skills

View all Development skills →