UNPKG

throughmark

Version:

Find and Annotate Features in Images, From Objects to Concepts

47 lines (46 loc) 1.37 kB
import type { AnalysisResponse } from "./llm/analyzer.js"; import { ImageAnalyzer } from "./llm/analyzer.js"; import { Analysis } from "./llm/analyzer.js"; import type { GridConfig } from "./types.js"; export interface AnalyzeOptions { imagePath: string; prompt?: string; contiguousRegions?: boolean; } export interface HighlightOptions { imagePath: string; analysis: AnalysisResponse; } export declare class Throughmark { private calculator; private generator; private readonly processor; analyzer: ImageAnalyzer; private readonly config; constructor(config?: GridConfig); getGridDimensions(imagePath: string): Promise<{ gridConfig: { rows: number; cols: number; }; width: number; height: number; cellWidth: number; cellHeight: number; }>; generateHTML: (imagePath: string) => Promise<string>; generateVerificationImage: (imagePath: string) => Promise<Buffer>; analyze: (options: AnalyzeOptions) => Promise<Analysis>; generateSimpleHighlight(options: HighlightOptions): Promise<Buffer>; getGridConfig: () => { rows: number; cols: number; }; private readImage; } export type { GridConfig } from "./types.js"; export declare const defaultConfig: { annotations: { type: string; }[]; };