Introduction¶
When processing large images, the official DeepSeek-v4-flash-vision-exp model compresses them to 800×800 pixels to control token consumption. This downscaling can cause loss of image detail and reduce recognition accuracy. This plugin aims to solve this problem: it splits large images into lossless 800×800 tiles, carries coordinate annotations, and directly calls the DeepSeek vision API for recognition and aggregation, ensuring no detail is lost.
Plugin Overview¶
- Name: vision-exp-tile
- Author: Nicholaskin
- Category: Model Inference
- License: MIT
This plugin is a DSH (DeepSeek Harness) plugin for handling large-image input in model inference scenarios. It supports local OCR, batch directory processing, and multiple model orchestration strategies.
Installation and Enablement¶
Plugin installation requires manually mounting it to the target DSH Profile. The steps are as follows:
- Copy/link the plugin source code to the DSH plugin directory:
~/.dsh/plugins/vision-exp-tile
This directory must contain cordis.patch.yml, dsh-plugin.json, std-facet.js, and source files.
- Modify the target Profile’s
package.jsonto add the dependency and Bundle:
"dependencies": {
"vision-exp-tile": "link:C:/Users/<你>/.dsh/plugins/vision-exp-tile"
},
"dsh": {
"profile": {
"bundles": [ ...现有项..., "vision-exp-tile" ]
}
}
- Run installation in the Profile directory and restart DSH:
pnpm install
dsh web
(DSH 0.2.0 includes a plugin manager, so it can also be loaded through the UI)
Core Features¶
- Lossless Tiling: Splits a large image into lossless 800×800 tiles (edge tiles retain their actual dimensions, with no white padding or upscaling), ensuring zero detail loss.
- Coordinate Annotation: Annotates the tile results with coordinates and generates a global layout reference image.
- Direct API Calls: Carries the tile results and coordinates directly to the DeepSeek vision API for recognition and aggregation.
- Local OCR: Supports local OCR engines (such as paddle, rapid, and Windows system OCR) in combination with visual recognition.
- Batch Processing: Supports recognizing all images in a directory, with resumable execution and failure isolation.
- Model Orchestration: Provides three strategies:
smart(intelligent orchestration),pipeline(fully automatic pipeline), andfull(full grid). - Settings Page Optimization: Version v1.0.1 groups 49 configuration items into 8 collapsible sections, adds a search box and group-header status badges, and improves the user experience.
Typical Usage¶
The plugin provides multiple tool interfaces and can be selected according to the scenario:
1. Single-Image Smart Recognition¶
vision_tile_split: Performs only the tiling, annotation, and aggregation logic.vision_tile_recognize: Performs smart image recognition, including whole-image pre-check, interest point recognition, and result summarization.
{
"file_path": "D:\\img\\大图.png",
"strategy": "smart",
"question": "这张图里有什么内容?请完整描述"
}
2. Region Crop Recognition¶
vision_region_crop: Crops interest points or text regions by proportion for recognition (maximum edge length 800).
{
"file_path": "D:\\img\\截图.png",
"rect": [x0, y0, x1, y1],
"max_edge": 800,
"recognize": true
}
3. Batch Directory Recognition¶
vision_batch_recognize: Recognizes images in a directory one by one, supporting resumable execution and report generation.
{
"input_dir": "D:\\DSH-Files-v2\\00-收件箱\\图像识别输入",
"limit": 5,
"strategy": "pipeline",
"resume": true
}
Notes¶
- Zero Dependencies: The plugin does not depend on any third-party DSH plugins (such as picturereader) and uses only official DSH services and optional open-source OCR environments.
- Billing Notes: The plugin does not track token usage or costs on your behalf. Actual billing is based on the bills from the official DeepSeek API platform.
- Compatibility: The v1.0.1 settings page redesign supports any OpenAI-compatible vision endpoint and local vision models.