Doriandarko/Claude-Vision-Object-Detection
关于
A powerful Python tool that leverages Claude 3.5 Sonnet Vision API to detect and visualize objects in images. The script automatically draws bounding boxes around detected objects, labels them, and displays confidence scores.
设计与媒体可以做什么
- 🖼️ Process single images or entire directories
- 📦 Automatic object detection with bounding boxes
- 🎯 High-precision confidence scores
- 🎨 Vibrant, distinct colors for each detected object
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Claude Vision Object Detection
A powerful Python tool that leverages Claude 3.5 Sonnet Vision API to detect and visualize objects in images. The script automatically draws bounding boxes around detected objects, labels them, and displays confidence scores.

Features
- 🖼️ Process single images or entire directories
- 📦 Automatic object detection with bounding boxes
- 🎯 High-precision confidence scores
- 🎨 Vibrant, distinct colors for each detected object
- 💾 Saves annotated images with detection results
Requirements
- Python 3.7+
- Anthropic API key
- Required Python packages (see
requirements.txt)
Installation
- Clone the repository:
git clone https://github.com/doriandarko/claude-vision-object-detection.git
cd claude-vision-detection
- Install required packages:
pip install -r requirements.txt
- Create a
.envfile in the project root and add your Anthropic API key:
ANTHROPIC_API_KEY=your_api_key_here
Usage
- Run the script:
python main.py
When prompted, enter either:
- Path to a single image file
- Path to a directory containing multiple images
The script will:
- Process each image using Claude Vision API
- Draw bounding boxes around detected objects
- Add labels with confidence scores
- Save annotated images in an
outputdirectory
Supported Image Formats
- JPEG (.jpg, .jpeg)
- PNG (.png)
- GIF (.gif)
- WebP (.webp)
Output
The script creates an output directory in the current working directory. Processed images are saved with the prefix detected_ followed by the original filename.
Error Handling
The script includes comprehensive error handling for:
- Invalid image paths
- Unsupported file formats
- API communication issues
- Image processing errors
Contributing
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.
License
Copyright (c) 2024 Pietro Schirano
This project is licensed under a modified MIT License with attribution requirements. See the LICENSE file for details.
Attribution Requirements
When using this software or its derivatives, you must include:
- The name of the original project (Claude Vision Object Detection)
- A link to the original repository
- The name of the original author
Acknowledgments
- Built using the Claude 3.5 Sonnet Vision API by Anthropic
- Uses PIL (Python Imaging Library) for image processing
- Implements the golden ratio for color generation
Support
For issues, questions, or contributions, please:
- Check existing GitHub issues
- Create a new issue with a detailed description
- Include sample images if relevant (without sensitive data)
Note: This tool relies on the Claude Vision API, which requires an API key from Anthropic. Make sure you have appropriate access and credits before using.
探索相关项目
加载中…