openai-image-vision

Analyze images via OpenAI Vision API using Bash and curl.

46.4k|10.3k|Updated Aug 7, 2022
One-click install
npx skills add https://github.com/zhayujie/chatgpt-on-wechat --skill openai-image-vision
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openai-image-vision
Source: https://github.com/zhayujie/chatgpt-on-wechat/tree/main/skills/openai-image-vision
Command: npx skills add https://github.com/zhayujie/chatgpt-on-wechat --skill openai-image-vision

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, base64, sips, convert, mktemp, grep, sed, head, wc, tr, and includes scripts (resource) components.

What problem does it solve?

This skill provides a Bash-based wrapper to analyze images using OpenAI's GPT-4 Vision API, enabling quick and thorough understanding of visual content with minimal setup.

Core Features & Use Cases

  • Image analysis: Describe scenes, detect objects, colors, and text in local files or URLs.
  • OCR and extraction: Extract visible text from images for records and indexing.
  • Model flexibility: Choose among supported OpenAI Vision models and adjust base API URL as needed.

Quick Start

To use this skill, configure your OPENAI_API_KEY and run a vision query, for example:

  • bash "<base_dir>/scripts/vision.sh" "/path/to/image.jpg" "Describe this image"

Frequently Asked Questions about openai-image-vision

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze images and extract text using OpenAI Vision via Bash?

You can analyze images and extract text using OpenAI Vision via Bash by running a script that encodes local files or URLs with base64 and sends HTTP requests to the API. This allows quick scene description, object detection, and OCR.

Can I use curl to perform OCR and object detection on local image files?

Yes, you can use curl to perform OCR and object detection on local image files. The Bash wrapper encodes local images using base64 and sends them to the OpenAI Vision API, returning detected objects, colors, and extracted text.

Do I need to resize large images before sending them to the OpenAI Vision API?

Resizing large images is supported but optional. The Bash script includes optional image resizing for large files to ensure robust HTTP requests and error handling when sending base64 encoded data to the OpenAI Vision API.

What dependencies are required to run OpenAI Vision image analysis in a Bash script?

Running OpenAI Vision image analysis in a Bash script requires curl and base64 for HTTP requests and image encoding. Optional dependencies for image resizing and text processing include sips, convert, mktemp, grep, and sed.

How does OpenAI Vision handle image analysis for content creation and accessibility workflows?

OpenAI Vision handles image analysis for content creation and accessibility by describing scenes, detecting objects, and performing OCR. The Bash wrapper targets these workflows, allowing model selection and base API URL customization for data indexing.

Is it possible to customize the OpenAI Vision model and API endpoint in a Bash environment?

Yes, it is possible to customize the OpenAI Vision model and API endpoint in a Bash environment. The script supports choosing among supported OpenAI Vision models and adjusting the base API URL to fit your specific network and project requirements.