progress-photo-analyzer
Analyze construction site photos to track progress, detect safety issues, and compare against BIM models using computer vision.
What this skill does
# Progress Photo Analyzer
## Business Case
### Problem Statement
Site photos are underutilized for progress tracking:
- Manual review is time-consuming
- Subjective progress assessment
- No systematic comparison to plans
- Safety issues may be missed
### Solution
AI-powered photo analysis system that extracts progress information, detects safety concerns, and compares site conditions to BIM models.
### Business Value
- **Automation** - Reduce manual photo review
- **Accuracy** - Objective progress measurement
- **Safety** - Automatic hazard detection
- **Documentation** - Structured photo records
## Technical Implementation
```python
import pandas as pd
from datetime import datetime, date
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
import base64
class PhotoType(Enum):
"""Types of construction photos."""
PROGRESS = "progress"
SAFETY = "safety"
QUALITY = "quality"
GENERAL = "general"
DELIVERY = "delivery"
class AnalysisStatus(Enum):
"""Analysis status."""
PENDING = "pending"
ANALYZING = "analyzing"
COMPLETED = "completed"
FAILED = "failed"
class SafetyIssue(Enum):
"""Detected safety issues."""
MISSING_PPE = "missing_ppe"
FALL_HAZARD = "fall_hazard"
HOUSEKEEPING = "housekeeping"
SCAFFOLDING = "scaffolding"
ELECTRICAL = "electrical"
EXCAVATION = "excavation"
NONE = "none"
class WorkActivity(Enum):
"""Detected work activities."""
EXCAVATION = "excavation"
FOUNDATION = "foundation"
CONCRETE_POUR = "concrete_pour"
STEEL_ERECTION = "steel_erection"
FRAMING = "framing"
ROOFING = "roofing"
MEP_ROUGH = "mep_rough"
DRYWALL = "drywall"
FINISHES = "finishes"
EXTERIOR = "exterior"
UNKNOWN = "unknown"
@dataclass
class PhotoMetadata:
"""Photo metadata."""
photo_id: str
filename: str
capture_date: datetime
location: str
level: str
zone: str
photo_type: PhotoType
photographer: str = ""
gps_coordinates: Optional[Tuple[float, float]] = None
file_path: str = ""
@dataclass
class ProgressDetection:
"""Detected progress information."""
work_activity: WorkActivity
confidence: float
description: str
completion_estimate: float # 0-100%
elements_visible: List[str] = field(default_factory=list)
@dataclass
class SafetyDetection:
"""Detected safety information."""
issue_type: SafetyIssue
confidence: float
description: str
severity: str # low, medium, high
location_in_image: Optional[Tuple[int, int, int, int]] = None # bounding box
@dataclass
class PhotoAnalysisResult:
"""Complete photo analysis result."""
photo_id: str
metadata: PhotoMetadata
analysis_date: datetime
status: AnalysisStatus
progress_detections: List[ProgressDetection]
safety_detections: List[SafetyDetection]
weather_conditions: str
worker_count: int
equipment_visible: List[str]
quality_issues: List[str]
notes: str = ""
bim_comparison: Optional[Dict[str, Any]] = None
class ProgressPhotoAnalyzer:
"""Analyze construction site photos."""
def __init__(self, project_name: str):
self.project_name = project_name
self.photos: Dict[str, PhotoMetadata] = {}
self.results: Dict[str, PhotoAnalysisResult] = {}
self._photo_counter = 0
def register_photo(self,
filename: str,
capture_date: datetime,
location: str,
level: str = "",
zone: str = "",
photo_type: PhotoType = PhotoType.PROGRESS,
photographer: str = "",
file_path: str = "") -> PhotoMetadata:
"""Register a photo for analysis."""
self._photo_counter += 1
photo_id = f"PH-{self._photo_counter:05d}"
metadata = PhotoMetadata(
photo_id=photo_id,
filename=filename,
capture_date=capture_date,
location=location,
level=level,
zone=zone,
photo_type=photo_type,
photographer=photographer,
file_path=file_path
)
self.photos[photo_id] = metadata
return metadata
def analyze_photo(self, photo_id: str,
image_data: bytes = None) -> PhotoAnalysisResult:
"""Analyze a registered photo."""
if photo_id not in self.photos:
raise ValueError(f"Photo {photo_id} not registered")
metadata = self.photos[photo_id]
# Perform analysis (simulated - would use CV/AI models)
progress_detections = self._detect_progress(metadata, image_data)
safety_detections = self._detect_safety(metadata, image_data)
weather = self._detect_weather(metadata, image_data)
worker_count = self._count_workers(image_data)
equipment = self._detect_equipment(image_data)
result = PhotoAnalysisResult(
photo_id=photo_id,
metadata=metadata,
analysis_date=datetime.now(),
status=AnalysisStatus.COMPLETED,
progress_detections=progress_detections,
safety_detections=safety_detections,
weather_conditions=weather,
worker_count=worker_count,
equipment_visible=equipment,
quality_issues=[]
)
self.results[photo_id] = result
return result
def _detect_progress(self, metadata: PhotoMetadata,
image_data: bytes = None) -> List[ProgressDetection]:
"""Detect work progress in photo."""
# Simulated detection based on metadata
detections = []
# In real implementation, this would use computer vision
location_lower = metadata.location.lower()
if 'foundation' in location_lower or 'basement' in location_lower:
detections.append(ProgressDetection(
work_activity=WorkActivity.FOUNDATION,
confidence=0.85,
description="Foundation work visible",
completion_estimate=60.0
))
elif 'steel' in location_lower or 'structure' in location_lower:
detections.append(ProgressDetection(
work_activity=WorkActivity.STEEL_ERECTION,
confidence=0.90,
description="Structural steel installation",
completion_estimate=45.0
))
elif 'roof' in location_lower:
detections.append(ProgressDetection(
work_activity=WorkActivity.ROOFING,
confidence=0.80,
description="Roofing work in progress",
completion_estimate=30.0
))
else:
detections.append(ProgressDetection(
work_activity=WorkActivity.UNKNOWN,
confidence=0.50,
description="General construction activity",
completion_estimate=0.0
))
return detections
def _detect_safety(self, metadata: PhotoMetadata,
image_data: bytes = None) -> List[SafetyDetection]:
"""Detect safety issues in photo."""
# Simulated detection - real implementation would use AI models
detections = []
# In production, this would analyze the actual image
if metadata.photo_type == PhotoType.SAFETY:
# Return empty for demonstration
pass
return detections
def _detect_weather(self, metadata: PhotoMetadata,
image_data: bytes = None) -> str:
"""Detect weather conditions from photo."""
# Simulated - would use image analysis
return "clear"
def _count_workers(self, image_data: bytes = None) -> int:
"""Count workers visible in photo."""
# Simulated Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.