Token导航 LogoToken导航TokenDH.com
待分类权限需确认github未标认证来源可访问许可证需确认审计通过

progress-photo-analyzer进度照片分析仪

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

388

周安装

16

GitHub Stars

113

下载量

127
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:progress-photo-analyzer(进度照片分析仪)
来源仓库:https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction
仓库路径:skills/progress-photo-analyzer
安装命令:
npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction --skill progress-photo-analyzer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction --skill progress-photo-analyzer

简介

用于辅助图像生成、图片编辑或视觉素材处理,适合根据文本生成图片或调用相关图像工具。

  • 可处理背景、整理视觉提示词,但需注意输入图片版权和输出格式限制。
  • 通过 npx 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 安装前建议核实权限范围、维护状态及是否涉及人物、品牌或公开展示素材的合规性。
  • progress-photo-analyzer 属于待分类类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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

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 - would use person detection
        return 0

    def _detect_equipment(self, image_data: bytes = None) -> List[str]:
        """Detect equipment visible in photo."""
        # Simulated - would use object detection
        return []

    def compare_to_bim(self, photo_id: str,
                      bim_render: bytes = None) -> Dict[str, Any]:
        """Compare photo to BIM model render."""
        if photo_id not in self.results:
            return {'error': 'Photo not analyzed'}

        # Simulated comparison
        comparison = {
            'similarity_score': 0.75,
            'alignment_quality': 'good',
            'discrepancies': [],
            'notes': 'Photo roughly matches BIM model'
        }

        self.results[photo_id].bim_comparison = comparison
        return comparison

    def get_progress_summary(self,
                            from_date: date = None,
                            to_date: date = None) -> Dict[str, Any]:
        """Generate progress summary from analyzed photos."""
        filtered_results = list(self.results.values())

        if from_date:
            filtered_results = [r for r in filtered_results
                              if r.metadata.capture_date.date() >= from_date]
        if to_date:
            filtered_results = [r for r in filtered_results
                              if r.metadata.capture_date.date() <= to_date]

        # Aggregate by activity
        by_activity = {}
        for result in filtered_results:
            for detection in result.progress_detections:
                activity = detection.work_activity.value
                if activity not in by_activity:
                    by_activity[activity] = {
                        'count': 0,
                        'avg_completion': 0,
                        'photos': []
                    }
                by_activity[activity]['count'] += 1
                by_activity[activity]['avg_completion'] += detection.completion_estimate
                by_activity[activity]['photos'].append(result.photo_id)

        # Calculate averages
        for activity in by_activity:
            count = by_activity[activity]['count']
            if count > 0:
                by_activity[activity]['avg_completion'] /= count

        # Safety summary
        total_safety_issues = sum(len(r.safety_detections) for r in filtered_results)

        return {
            'total_photos': len(filtered_results),
            'date_range': {
                'from': from_date.isoformat() if from_date else None,
                'to': to_date.isoformat() if to_date else None
            },
            'by_activity': by_activity,
            'safety_issues_detected': total_safety_issues,
            'average_worker_count': sum(r.worker_count for r in filtered_results) / len(filtered_results) if filtered_results else 0
        }

    def export_report(self, output_path: str):
        """Export analysis results to Excel."""
        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
            # Photos list
            photos_data = []
            for result in self.results.values():
                photos_data.append({
                    'Photo ID': result.photo_id,
                    'Filename': result.metadata.filename,
                    'Date': result.metadata.capture_date,
                    'Location': result.metadata.location,
                    'Level': result.metadata.level,
                    'Type': result.metadata.photo_type.value,
                    'Status': result.status.value,
                    'Worker Count': result.worker_count,
                    'Weather': result.weather_conditions
                })

            pd.DataFrame(photos_data).to_excel(writer, sheet_name='Photos', index=False)

            # Progress detections
            progress_data = []
            for result in self.results.values():
                for detection in result.progress_detections:
                    progress_data.append({
                        'Photo ID': result.photo_id,
                        'Activity': detection.work_activity.value,
                        'Confidence': detection.confidence,
                        'Completion %': detection.completion_estimate,
                        'Description': detection.description
                    })

            if progress_data:
                pd.DataFrame(progress_data).to_excel(writer, sheet_name='Progress', index=False)

            # Safety detections
            safety_data = []
            for result in self.results.values():
                for detection in result.safety_detections:
                    safety_data.append({
                        'Photo ID': result.photo_id,
                        'Issue': detection.issue_type.value,
                        'Severity': detection.severity,
                        'Confidence': detection.confidence,
                        'Description': detection.description
                    })

            if safety_data:
                pd.DataFrame(safety_data).to_excel(writer, sheet_name='Safety', index=False)

        return output_path

def analyze_site_photos(photo_files: List[str],
                       project_name: str,
                       output_path: str = None) -> Dict[str, Any]:
    """Quick function to analyze multiple photos."""
    analyzer = ProgressPhotoAnalyzer(project_name)

    for file_path in photo_files:
        path = Path(file_path)
        metadata = analyzer.register_photo(
            filename=path.name,
            capture_date=datetime.now(),
            location="Site",
            photo_type=PhotoType.PROGRESS,
            file_path=file_path
        )
        analyzer.analyze_photo(metadata.photo_id)

    summary = analyzer.get_progress_summary()

    if output_path:
        analyzer.export_report(output_path)

    return summary

Quick Start

# Initialize analyzer
analyzer = ProgressPhotoAnalyzer("Office Tower Project")

# Register and analyze photos
metadata = analyzer.register_photo(
    filename="site_photo_001.jpg",
    capture_date=datetime.now(),
    location="Level 3 - Core",
    level="Level 3",
    zone="Zone A",
    photo_type=PhotoType.PROGRESS,
    photographer="John Smith"
)

result = analyzer.analyze_photo(metadata.photo_id)
print(f"Detected activity: {result.progress_detections[0].work_activity.value}")
print(f"Completion estimate: {result.progress_detections[0].completion_estimate}%")

Common Use Cases

1. Daily Progress Report

from datetime import date

summary = analyzer.get_progress_summary(
    from_date=date.today(),
    to_date=date.today()
)
print(f"Photos analyzed today: {summary['total_photos']}")

2. Safety Monitoring

safety_photos = [r for r in analyzer.results.values() if r.safety_detections]
for result in safety_photos:
    for issue in result.safety_detections:
        print(f"Safety issue: {issue.issue_type.value} - {issue.severity}")

3. Export Analysis

analyzer.export_report("photo_analysis_report.xlsx")

Resources

  • DDC Book: Chapter 4.1 - Site Data Collection
  • Reference: Computer Vision for Construction

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.66%
按下载量换算47

Claude

30.09%
按下载量换算38

Cursor

20.46%
按下载量换算26

Gemini CLI

9.68%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills