惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
IT之家
IT之家
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
H
Help Net Security
V
V2EX
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 【当耐特】
月光博客
月光博客
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders
GitHub - itsperini/viscribe: Image intelligence layer for...
itsperini · 2026-06-12 · via Hacker News - Newest: "AI"

ViscribeAI

ViscribeAI

Extract structured data from images using AI models.

X @itsperini LinkedIn itsperini Discord Docs docs.viscribe.ai Python 3.10+ Node.js 20+ License MIT

Define the output schema, pass the image, pick the AI model, and get parsed structured output back instead of free-form text.

⭐ If Viscribe helps your project, please leave a star. ⭐

📦 Installation

Python:

TypeScript:

🚀 Features

  • 🖼️ AI-powered image description, extraction, classification, VQA (Visual Question Answering), and comparison
  • 🔄 Both sync and async clients
  • 📊 Structured output with Pydantic schemas
  • 🔍 Detailed logging
  • ⚡ Automatic retries

🎯 Quick Start

from viscribe.images import describe

result = describe(
    image_path="examples/venice.png",
    # image_base64="...",
    generate_tags=True,
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result)

# ImageResult(
#     data={
#         "image_description": "A scenic view of Venice...",
#         "tags": ["Venice", "canal", "gondolas"],
#     },
#     raw=<OpenAI response>,
#     usage_metadata={"input_tokens": 123, "output_tokens": 45, ...},
# )
TypeScript
import { images } from "viscribe";

const result = await images.describe({
  imagePath: "examples/venice.png",
  generateTags: true,
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result);

Note: Viscribe works with OpenAI-compatible endpoints (more support coming soon). It is recommended to load your API key from an environment variable instead of hardcoding it in your code.

📚 Image Endpoints

Method Description
describe Generate an objective image description with optional tags.
classify Classify an image into one or more allowed or free-form categories.
ask Ask a visual question and get an answer grounded in the image.
extract Extract structured data from an image using simple fields, JSON Schema, or a Pydantic model in Python.
compare Compare two images and describe their similarities and differences.

1. Describe Image

Generate a natural language description of an image, optionally with tags.

from viscribe.images import describe

result = describe(
    image_path="examples/venice.png",
    generate_tags=True,
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result.data)
TypeScript
import { images } from "viscribe";

const result = await images.describe({
  imagePath: "examples/venice.png",
  generateTags: true,
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

2. Classify Image

Classify an image into one or more categories.

from viscribe.images import classify

result = classify(
    image_path="examples/venice.png",
    classes=["canal", "city", "landmark", "interior"],
    multi_label=True,
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result.data)
TypeScript
import { images } from "viscribe";

const result = await images.classify({
  imagePath: "examples/venice.png",
  classes: ["canal", "city", "landmark", "interior"],
  multiLabel: true,
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

3. Visual Question Answering (VQA)

Ask a question about the content of an image and get an answer.

from viscribe.images import ask

result = ask(
    image_path="examples/venice.png",
    question="What kind of place is shown in this image?",
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result.data)
TypeScript
import { images } from "viscribe";

const result = await images.ask({
  imagePath: "examples/venice.png",
  question: "What kind of place is shown in this image?",
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

4. Extract Structured Data from Image

Extract structured data from an image using either a simple or more complex output schema.

Simple Schema

Use a simple schema for straightforward data extraction.

from viscribe.images import extract

result = extract(
    image_path="examples/venice.png",
    output_schema=[
        {"name": "location", "type": "text", "description": "Likely place shown"},
        {"name": "visible_elements", "type": "array_text", "description": "Objects and structures"},
        {"name": "colors", "type": "array_text", "description": "Dominant colors"},
    ],
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result.data)
TypeScript
import { images } from "viscribe";

const result = await images.extract({
  imagePath: "examples/venice.png",
  outputSchema: [
    { name: "location", type: "text", description: "Likely place shown" },
    {
      name: "visible_elements",
      type: "array_text",
      description: "Objects and structures",
    },
    { name: "colors", type: "array_text", description: "Dominant colors" },
  ],
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

Field Types:

  • text: Single text value
  • number: Single numeric value
  • array_text: Array of text values
  • array_number: Array of numeric values

More Complex Schema

Use a Pydantic model as the output_schema when you need complex or nested structures.

from pydantic import BaseModel
from viscribe.images import extract


class Scene(BaseModel):
    location: str
    visible_elements: list[str]
    specifications: dict


result = extract(
    image_path="examples/venice.png",
    output_schema=Scene,
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result.data)
TypeScript
import { images } from "viscribe";

const result = await images.extract({
  imagePath: "examples/venice.png",
  outputSchema: {
    title: "Scene",
    type: "object",
    properties: {
      location: { type: "string" },
      visible_elements: {
        type: "array",
        items: { type: "string" },
      },
      specifications: { type: "object" },
    },
    required: ["location", "visible_elements", "specifications"],
    additionalProperties: false,
  },
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

Note: output_schema can be either a simple list of field definitions or a Pydantic model.

5. Compare Images

Compare two images and get a description of their similarities and differences.

from viscribe.images import compare

result = compare(
    image1_path="examples/venice.png",
    image2_path="examples/venice.png",
    model_config={
        "model": "gpt-5-mini",
        "api_key": "sk-...",
        "temperature": 1,
    },
)

print(result.data)
TypeScript
import { images } from "viscribe";

const result = await images.compare({
  image1Path: "examples/venice.png",
  image2Path: "examples/venice.png",
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

⚡ Async Usage

All Python endpoints support async operations with direct a* helpers:

import asyncio
from viscribe.images import adescribe


async def main() -> None:
    result = await adescribe(
        image_path="examples/venice.png",
        generate_tags=True,
        model_config={
            "model": "gpt-5-mini",
            "api_key": "sk-...",
            "temperature": 1,
        },
    )

    print(result.data)


asyncio.run(main())

You can also reuse an async client:

import asyncio
from viscribe import ViscribeAI


async def main() -> None:
    client = ViscribeAI(
        model_config={
            "model": "gpt-5-mini",
            "api_key": "sk-...",
            "temperature": 1,
        }
    )

    result = await client.images.adescribe(
        image_path="examples/venice.png",
        generate_tags=True,
    )

    print(result.data)


asyncio.run(main())
TypeScript

TypeScript is async-native, so use the same methods with await:

import { images, ViscribeAI } from "viscribe";

const result = await images.describe({
  imagePath: "examples/venice.png",
  generateTags: true,
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

console.log(result.data);

const client = new ViscribeAI({
  modelConfig: {
    model: "gpt-5-mini",
    apiKey: "sk-...",
    temperature: 1,
  },
});

const clientResult = await client.images.describe({
  imagePath: "examples/venice.png",
  generateTags: true,
});

console.log(clientResult.data);

📖 Documentation

For detailed documentation, visit docs.viscribe.ai

🛠️ Development

For information about setting up the development environment and contributing to the project, see our Contributing Guide.

💬 Support & Feedback

🤝 Contributing

Feel free to contribute and join our Discord server to discuss with us improvements and give us suggestions!

Please see the contributing guidelines.

My Skills My Skills My Skills

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

⭐ If Viscribe helps your project, please leave a star. ⭐


Made with ❤️ by ViscribeAI