Image ocr

From aipoch/medical-research-skills · View interactive version

Image ocr is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Extract text from images with Tesseract OCR; use it when you need to recognize text from PNG/JPEG/TIFF/BMP images, select a language model, or run OCR via natural-language requests (e.g., "Interpret the image at C:\path\image.png").

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

When to Use

Key Features

Dependencies

Example Usage

  1. Install dependencies (example):
pip install pytesseract Pillow
  1. Install Tesseract OCR (system-level) and ensure it is accessible.
  1. Create or edit scripts/ocr_config.json:

Option A: Direct image path

{
  "image_path": "C:\\Users\\xuw\\Desktop\\test_image.png",
  "request": "",
  "lang": "chi_sim",
  "tesseract_cmd": "tesseract"
}

Option B: Natural-language request (image path embedded)

{
  "request": "Interpret the image at C:\\Users\\xuw\\Desktop\\test_image.png",
  "lang": "chi_sim",
  "tesseract_cmd": "tesseract"
}
  1. Run:
python scripts/image_ocr.py

Implementation Details

1. Load scripts/ocr_config.json.

2. Determine the target image path:

3. Load the image via Pillow.

4. Run OCR via pytesseract with the configured lang.

5. Output the extracted text (script-defined output behavior).

When Not to Use

Required Inputs

Recommended Workflow

  1. Validate the request against the skill boundary and confirm all required inputs are present.
  2. Select the documented execution path and prefer the simplest supported command or procedure.
  3. Produce the expected output using the documented file format, schema, or narrative structure.
  4. Run a final validation pass for completeness, consistency, and safety before returning the result.

Deterministic Output Rules

Output Contract

Validation and Safety Rules

Failure Handling

Completion Checklist

Quick Validation

Run this minimal verification path before full execution when possible:

python scripts/image_ocr.py --help

Expected output format:

Result file: image_ocr_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any

Scope Reminder

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.