egohos-segmentation
БесплатноБез исполняемых скриптовНе проверенEgocentric Hand-Object Segmentation (EgoHOS) - pixel-level hand and object segmentation in egocentric videos. Outputs fine-grained segmentation masks with…
от lilinji★ 18 звёзд на GitHubОб этом скилле
EgoHOS - Egocentric Hand-Object Segmentation
Overview
Fine-grained hand-object segmentation system designed for egocentric (first-person) videos. EgoHOS provides pixel-level segmentation masks that precisely separate hands from objects and background, enabling detailed analysis of hand-object interactions. The system outputs colorful mask overlays that make hand regions visually distinct and easy to analyze.
Key advantage: Pixel-level accuracy for understanding hand-object boundaries and contact regions, surpassing bounding box or keypoint approaches for interaction understanding.
When to Use This Skill
This skill should be used when:
- Need pixel-accurate hand and object masks in egocentric videos
- Analyzing hand-object manipulation and interactions
- Studying contact regions between hands and objects
- Creating training data for segmentation models
- Applications requiring precise hand shape and outline
- Research in fine-grained activity recognition
- Building systems that need to understand hand-object contact
- Generating annotated videos with segmentation overlays
Choose this when: You need pixel-level segmentation of hands and objects, not just bounding boxes or keypoints.
Consider alternatives:
- For hand detection only: Use
victordibia-handtracking - For 3D pose estimation: Use
hands-3d-pose - For multi-view 3D tracking: Use
facebookresearch-hot3d
Core Capabilities
1. Pixel-Level Segmentation
Per-pixel classification with multiple classes:
- Hand pixels (left/right hand)
- Object pixels (manipulated objects)
- Background
- Optional: Multiple object instances
Mask format:
masks = {
'hand_mask': np.array(H, W), # Binary mask for hand
'object_mask': np.array(H, W), # Binary mask for objects
'combined_mask': np.array(H, W), # Multi-class mask
'hand_bbox': [x, y, w, h], # Hand bounding box
'object_bbox': [x, y, w, h], # Object bounding box
}
2. Video Processing with Mask Overlay
Generate annotated videos with colorful segmentation overlays:
# Clone repository
git clone https://github.com/owenzlz/EgoHOS.git
cd EgoHOS
# Install dependencies
pip install torch torchvision opencv-python numpy pillow
# Download pre-trained models
bash scripts/download_models.sh
# Run segmentation on video
python demo.py \
--video egocentric_video.mp4 \
--output_dir ./output \
--overlay_masks \
--save_video
Output features:
- Hand regions colored (e.g., blue/cyan)
- Object regions colored (e.g., red/orange)
- Semi-transparent overlay on original video
- Smooth masks across video frames
- Edge refinement for clean boundaries
3. Hand-Object Interaction Analysis
Identify contact regions between hands and objects:
- Compute overlap between hand and object masks
- Detect grasping and manipulation moments
- Track contact regions over time
- Analyze hand pose relative to objects
def analyze_contact(hand_mask, object_mask):
"""Analyze hand-object contact"""
overlap = hand_mask & object_mask
contact_area = np.sum(overlap)
# Compute contact metrics
hand_coverage = contact_area / np.sum(hand_mask)
object_coverage = contact_area / np.sum(object_mask)
return {
'contact_pixels': contact_area,
'hand_coverage': hand_coverage,
'object_coverage': object_coverage,
}
4. Batch Processing
Process multiple videos efficiently:
import os
from pathlib import Path
from egohos import EgoHOS
model = EgoHOS()
model.load_model('checkpoints/best_model.pth')
video_dir = Path('egocentric_videos')
output_dir = Path('segmentation_output')
for video_path in video_dir.glob('*.mp4'):
output_path = output_dir / f'{video_path.stem}_segmented.mp4'
model.process_video(
str(video_path),
str(output_path),
overlay=True,
save_masks=True
)
Installation and Setup
# Clone repository
git clone https://github.com/owenzlz/EgoHOS.git
cd EgoHOS
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install PyTorch
pip install torch torchvision
# Install other dependencies
pip install opencv-python numpy pillow matplotlib tqdm
# Download pre-trained models
python scripts/download_pretrained_models.py
Usage Examples
Example 1: Basic Video Segmentation
import cv2
import numpy as np
from egohos import EgoHOS
# Initialize model
model = EgoHOS()
model.load_model('checkpoints/model.pth')
# Load video
cap = cv2.VideoCapture('egocentric_video.mp4')
# Get video properties
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
# Setup output
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter('output_segmented.mp4', fourcc, fps, (width, height))
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# Seg
Установить egohos-segmentation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл egohos-segmentation?
Egocentric Hand-Object Segmentation (EgoHOS) - pixel-level hand and object segmentation in egocentric videos. Outputs fine-grained segmentation masks with hand regions highlighted. Specialized for hand-object interaction scenarios with pixel-accurate masks. Ideal for detailed interaction analysis.
Как установить скилл egohos-segmentation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл egohos-segmentation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic