mcpField
C
computer-vision-warehouse

computer-vision-warehouse

github.com/kishorkukrejaData & databases8451 installsUpdated 3w ago
Repository

About computer-vision-warehouse

A computer-vision skill for warehouse and supply chain operations, covering detection, classification, tracking, and inspection with vision models. It is intended for teams implementing package monitoring, inventory counting, quality checks, or safety observation.

Key features

  1. 01Package detection and tracking
  2. 02Defect and quality inspection
  3. 03Inventory counting with OCR
  4. 04Barcode and QR reading
  5. 05Person and PPE detection

Use cases

  1. 01Track packages in warehouse footage
  2. 02Identify defects during quality checks
  3. 03Count inventory from images
  4. 04Monitor personnel protective equipment

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill computer-vision-warehouse

After installing, type/computer-vision-warehousein Claude Code to confirm it loaded.

Details

From the project README

Computer Vision for Warehouse Operations

You are an expert in applying computer vision to warehouse and supply chain operations. Your goal is to implement object detection, classification, tracking, and inspection systems using CNNs, YOLO, and other vision models.

Applications

  1. Package Detection & Tracking: YOLO, tracking algorithms
  2. Quality Inspection: CNN classification, defect detection
  3. Inventory Counting: Object counting, OCR
  4. Barcode/QR Reading: Traditional + ML methods
  5. Safety Monitoring: Person detection, PPE detection

YOLO for Package Detection

import cv2
from ultralytics import YOLO

class PackageDetector:
    """
    Real-time package detection using YOLO
    """
    
    def __init__(self, model_path='yolov8n.pt'):
        self.model = YOLO(model_path)
    
    def detect_packages(self, image_path):
        """Detect packages in warehouse image"""
        
        results = self.model(image_path)
        
        detections = []
        for result in results:
            boxes = result.boxes
            for box in boxes:
                x1, y1, x2, y2 = box.xyxy[0]
                confidence = box.conf[0]
                class_id = box.cls[0]
                
                detections.append({
                    'bbox': (x1, y1, x2, y2),
                    'confidence': confidence,
                    'class': class_id
                })
        
        return detections

CNN for Quality Inspection

from tensorflow import keras
from tensorflow.keras import layers

class QualityInspector:
    """
    CNN for defect detection
    """
    
    def build_model(self, image_size=(224, 224), num_classes=2):
        model = keras.Sequential([
            layers.Conv2D(32, 3, activation='relu',
                         input_shape=(*image_size, 3)),
            layers.MaxPooling2D(2),
            layers.Conv2D(64, 3, activation='relu'),
            layers.MaxPooling2D(2),
            layers.Conv2D(128, 3, activation='relu'),
            layers.MaxPooling2D(2),
            layers.Flatten(),
            layers.Dense(256, activation='relu'),
            layers.Dropout(0.5),
            layers.Dense(num_classes, activation='softmax')
        ])
        
        model.compile(optimizer='adam',
                     loss='categorical_crossentropy',
                     metrics=['accuracy'])
        
        return model

Object Tracking

from sort import Sort

class PackageTracker:
    """
    Multi-object tracking for packages
    """
    
    def __init__(self):
        self.tracker = Sort()
        self.package_trajectories = {}
    
    def track(self, detections, frame_id):
        """
        Track packages across frames
        """
        
        # Convert detections to format for tracker
        dets = np.array([[d['bbox'][0], d['bbox'][1],
                         d['bbox'][2], d['bbox'][3],
                         d['confidence']] for d in detections])
        
        # Update tracker
        tracked_objects = self.tracker.update(dets)
        
        # Store trajectories
        for obj in tracked_objects:
            obj_id = int(obj[4])
            bbox = obj[:4]
            
            if obj_id not in self.package_trajectories:
                self.package_trajectories[obj_id] = []
            
            self.package_trajectories[obj_id].append({
                'frame': frame_id,
                'bbox': bbox
            })

Tools & Libraries

  • OpenCV: image processing
  • YOLOv8: object detection
  • TensorFlow/PyTorch: deep learning
  • Roboflow: dataset management
  • Detectron2: Facebook detection

Related Skills

  • ml-supply-chain: general ML
  • warehouse-automation: automation systems
  • quality-management: inspection processes

Comments

Markdown supported