返回顶部
s

scientific-drawing科研绘图

基于 AutoFigure-Edit 的科研级科学插图生成与编辑系统,能够从长篇方法描述自动生成完全可编辑的矢量图(SVG),支持参考图风格迁移和浏览器内交互式编辑

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
104
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

scientific-drawing

科学绘图技能

基于 AutoFigure-Edit 的科研级科学插图生成与编辑系统,能够从长篇方法描述自动生成完全可编辑的矢量图(SVG),支持参考图风格迁移和浏览器内交互式编辑。

核心特性

🎯 从像素到矢量的跨越

  • - 可编辑 SVG 输出: 不再生成静态PNG图片,而是完全可编辑的SVG文件
  • 结构化组件: 每个图标、模块、连接线都是独立可编辑对象
  • 矢量精度: 无限缩放不失真,完美适配学术出版要求

🎨 参考图引导的风格迁移

  • - 智能风格学习: 上传一张你喜欢的风格图,AI自动学习配色、字体、图标风格
  • 跨论文风格统一: 保持实验室或期刊的视觉一致性
  • 无需复杂Prompt: 摆脱反复调试提示词的困扰

🖥️ 内置交互式编辑器

  • - 实时编辑画布: 生成后立即进入可视化编辑界面
  • 拖拽式操作: 调整布局、修改标注、替换图标
  • 所见即所得: 所有修改实时预览,支持撤销/重做

🔧 五阶段生成流程

  1. 1. 风格条件生图: 基于文本和参考图生成初始栅格图像
  2. 分割与结构索引: 利用SAM3技术识别视觉组件并构建结构骨架
  3. 资产提取: 提取透明背景的视觉资产
  4. SVG模板生成与精炼: 生成结构化的SVG布局模板
  5. 资产注入: 将视觉资产注入模板,形成完全可编辑的SVG

🧠 推理式渲染范式

  • - 概念锚定: 从长篇方法描述提取核心实体和关系
  • 评审-精炼闭环: AI Designer与AI Critic多轮迭代优化
  • 美学渲染与擦除-修正: OCR识别模糊文字并用清晰矢量文字重新覆盖

先决条件

系统要求

  • - Python 3.10+
  • Git
  • 至少8GB RAM
  • 支持CUDA的GPU(可选,可加速处理)

API密钥需求

  • - Google Gemini API密钥 (推荐) 或 OpenRouter API密钥
  • 可选的 Bianxie API密钥
  • Hugging Face Token (用于SAM3模型下载)

安装步骤

1. 自动安装(推荐)

bash

在OpenClaw环境中,只需激活技能即可自动安装

技能会检查并安装所有依赖

2. 手动安装

bash

克隆AutoFigure-Edit仓库

git clone https://github.com/ResearAI/AutoFigure-Edit.git

进入技能目录

cd /home/davidzhao/.openclaw/workspace/skills/scientific-drawing-skill

安装Python依赖

pip install -r requirements.txt

安装额外依赖

pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 pip install transformers datasets accelerate pip install opencv-python pillow scikit-image pip install lxml svgwrite svgpathtools pip install flask flask-cors

3. 环境配置

bash

复制环境配置文件

cp .env.example .env

编辑.env文件,添加你的API密钥

GEMINIAPIKEY=yourgeminiapikeyhere

OPENROUTERAPIKEY=youropenrouterapikeyhere

HFTOKEN=yourhuggingfacetokenhere

使用方法

基础生成:从文本到可编辑SVG

bash

方法1:使用技能工具

scientificdrawinggenerate --text 论文方法描述文本 --output_dir ./output

方法2:直接调用Python脚本

python autofigure2.py --methodfile papermethod.txt --outputdir ./output --apikey $GEMINIAPIKEY

风格迁移:应用参考图风格

bash

上传参考图并生成风格化插图

scientificdrawingstyle_transfer \ --text 方法描述 \ --referenceimage stylereference.png \ --outputdir ./styledoutput

交互式编辑:浏览器内编辑SVG

bash

启动本地编辑服务器

scientificdrawingedit_server --port 8080

在浏览器中打开 http://localhost:8080

上传生成的SVG文件进行可视化编辑

批量处理:多篇论文插图生成

bash

处理目录中的所有文本文件

scientificdrawingbatch \ --input_dir ./papers \ --output_dir ./figures \ --stylereference ./labstyle.png

工具函数

scientificdrawinggenerate

从文本生成可编辑的科学插图SVG。

参数:

  • - --text: 论文方法描述文本(可直接提供或通过文件)
  • --methodfile: 包含方法描述的文本文件路径
  • --outputdir: 输出目录路径
  • --apiprovider: API提供商 (gemini, openrouter, bianxie)
  • --apikey: API密钥(如未在.env中设置)
  • --placeholdermode: 占位符模式 (none, box, label)
  • --samprompt: SAM3检测提示词,逗号分隔 (如 icon,diagram,arrow)
  • --style_reference: 风格参考图路径(可选)

示例:
bash
scientificdrawinggenerate \
--text Our method consists of three modules: feature extraction, attention fusion, and classification. The feature extractor uses ResNet-50... \
--outputdir ./figureoutput \
--placeholder_mode label \
--sam_prompt icon,module,arrow,text

scientificdrawingstyle_transfer

基于参考图进行风格迁移。

参数:

  • - --text: 方法描述文本
  • --referenceimage: 风格参考图路径
  • --outputdir: 输出目录
  • --stylestrength: 风格迁移强度 (0.0-1.0)
  • --preservecontent: 是否保持内容结构 (true/false)

示例:
bash
scientificdrawingstyle_transfer \
--method_file paper.txt \
--referenceimage naturestyle.png \
--outputdir ./naturestyle_figures \
--style_strength 0.7

scientificdrawingedit_server

启动交互式SVG编辑服务器。

参数:

  • - --port: 服务器端口 (默认: 8080)
  • --host: 绑定主机 (默认: 0.0.0.0)
  • --data_dir: SVG文件存储目录

示例:
bash
scientificdrawingedit_server --port 8080

访问 http://localhost:8080 使用编辑器

scientificdrawingbatch

批量处理多篇论文。

参数:

  • - --inputdir: 包含文本文件的输入目录
  • --outputdir: 输出目录
  • --style_reference: 统一的风格参考图(可选)
  • --threads: 并行处理线程数

配置文件

技能使用以下配置文件:

config.yaml

yaml

API配置

api: default_provider: gemini gemini: model: gemini-2.0-flash-exp temperature: 0.7 openrouter: model: openai/gpt-4o temperature: 0.7

生成参数

generation: placeholder_mode: label sam_prompt: icon,diagram,arrow,chart,module merge_threshold: 0.9 optimize_iterations: 2

风格迁移

style_transfer: default_strength: 0.8 content_preservation: true

编辑器设置

editor: port: 8080 allow_upload: true maxfilesize: 50MB

环境变量 (.env)

API密钥

GEMINIAPIKEY=yourgeminiapikeyhere OPENROUTERAPIKEY=youropenrouterapikeyhere BIANXIEAPIKEY=yourbianxieapikeyhere HFTOKEN=yourhuggingfacetokenhere

模型路径

SAM3MODELPATH=./models/sam3 RMBG2MODELPATH=./models/rmbg2

缓存设置

CACHE_DIR=./cache MAXCACHESIZE=10GB

输出文件结构

每次生成会创建以下文件:

output_dir/
├── figure.png # 初始生成的栅格图
├── samed.png # SAM3分割结果
├── boxlib.json # 检测框坐标和标签
├── template.svg # SVG模板
├── optimized_template.svg

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 scientific-drawing-skill-1-0-0-1775730066 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 scientific-drawing-skill-1-0-0-1775730066 技能

通过命令行安装

skillhub install scientific-drawing-skill-1-0-0-1775730066

下载

⬇ 下载 scientific-drawing v1.0.0(免费)

文件大小: 6.74 KB | 发布时间: 2026-4-11 23:00

v1.0.0 最新 2026-4-11 23:00
Editable SVG Output: No longer generates static PNGs; instead, produces fully editable SVG files.
Structured Components: Every icon, module, and connector is an independent, editable object.
Vector Precision: Infinitely scalable without quality loss, perfectly suited to academic publishing requirements.

Intelligent Style Transfer:
Upload a style reference image, and the AI automatically learns the color palette, typography, and icon style.
Maintains visual consistency with a laboratory or journal’s design language.

Built-in Interactive Editor:
Immediately enters a visual editing interface after generation.
Supports drag-and-drop operations to adjust layouts, modify annotations, and replace icons.
What-you-see-is-what-you-get, with undo/redo support.

Five-Stage Generation Pipeline:
Style-conditioned image generation → SAM3 segmentation and structural indexing → asset extraction → SVG template generation and refinement → asset injection

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部