with one click
mol-image-to-smiles
将分子结构图片转换为 SMILES 字符串。使用 DECIMER 和 MolNextR 模型进行图像识别。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
将分子结构图片转换为 SMILES 字符串。使用 DECIMER 和 MolNextR 模型进行图像识别。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Extract structured chemical compound characterization data from chemistry supplementary material documents (PDF/Markdown). 从化学论文补充材料(PDF/Markdown)中提取结构化化合物表征数据。 Use when Kimi needs to extract compound properties including NMR spectra, HRMS, HPLC data, melting points, optical rotation, and yield information from chemistry research papers or supplementary materials. 支持提取NMR谱图、HRMS、HPLC数据、熔点、旋光度、产率等信息。 Supports both single compound extraction and batch extraction of all compounds. 支持单个化合物提取和批量提取所有化合物。
Convert Gaussian gjf input files to XYZ format. 将Gaussian gjf输入文件转换为XYZ格式。 Use when agent needs to convert molecular structure files from Gaussian input format (.gjf) to XYZ format for visualization or use with other computational chemistry software. 当智能体需要将Gaussian输入格式(.gjf)的分子结构文件转换为XYZ格式用于可视化或其他计算化学软件时使用。
Convert PDF files to Markdown using MinerU API. 使用MinerU API将PDF文件转换为Markdown格式。 Use when Kimi needs to extract structured text, images, tables, and formulas from PDF documents while preserving document layout and formatting. 适用于需要提取结构化文本、图片、表格和公式并保留文档布局的场景。 Supports batch conversion and outputs full.md with images/, JSON metadata, and other extracted assets. 支持批量转换,输出full.md、images/目录、JSON元数据等。 Now supports large PDFs (600+ pages) by automatic splitting and merging. 现已支持大文件(600+页)自动拆分和合并处理。
Extract DFT calculation coordinates from PDF files and generate Gaussian gjf files. 从PDF文件中提取DFT计算坐标并生成Gaussian gjf输入文件。 Supports batch processing with separate output folders for each PDF. 支持批量处理,每个PDF单独生成输出文件夹。
Predict and visualize MS/MS spectra from a single SMILES using the fioRa online app. Use when the user wants a mass spectrum, MGF/MSP output, or a plotted stick spectrum from SMILES, with optional custom Name, precursor type, collision energy, and instrument settings.
Predict liquid-phase ¹H and ¹³C NMR chemical shifts from a SMILES string using NMRNet (deep learning, SE(3)-Transformer). Outputs per-atom shift values (ppm) and Lorentzian-broadened spectrum PNG files.
| name | mol-image-to-smiles |
| description | 将分子结构图片转换为 SMILES 字符串。使用 DECIMER 和 MolNextR 模型进行图像识别。 |
| trigger | ["分子图片","SMILES","图片转 SMILES","image to smiles","分子结构图","chemical image","OCR","识别分子"] |
将分子结构图片转换为 SMILES 字符串,使用 DECIMER 和 MolNextR 模型进行智能识别。
| 模型 | 来源 | 特点 | 使用方式 |
|---|---|---|---|
| DECIMER | 德国联邦材料研究与测试所 | 高精度、速度快 | 本地安装 |
| MolNextR | MolecularAI (HuggingFace) | 支持复杂结构 | API 调用 |
decimer 包把这个分子图片转成 SMILES
识别这张化学结构图
image to smiles: molecule.png
用 DECIMER 识别这个分子
# 基本转换(自动选择模型)
python3 scripts/mol_image_to_smiles.py -i molecule.png
# 指定使用 DECIMER
python3 scripts/mol_image_to_smiles.py -i molecule.png -m decimer
# 指定使用 MolNextR
python3 scripts/mol_image_to_smiles.py -i molecule.png -m molnextr
# 指定输出目录
python3 scripts/mol_image_to_smiles.py -i molecule.png -o ./results
# 批量处理
python3 scripts/mol_image_to_smiles.py -i "*.png" -o ./batch
# 安静模式(输出 JSON)
python3 scripts/mol_image_to_smiles.py -i molecule.png -q
| 参数 | 简写 | 说明 | 默认值 |
|---|---|---|---|
--input | -i | 输入图片路径 | - |
--output | -o | 输出目录 | ~/.openclaw/media/mol-image-to-smiles |
--model | -m | 模型选择:auto/decimer/molnextr | auto |
--quiet | -q | 安静模式(输出 JSON) | false |
{
"input_image": "/path/to/molecule.png",
"timestamp": "2026-03-16T18:30:00",
"results": [
{
"status": "success",
"smiles": "CCO",
"model": "DECIMER",
"source": "local"
}
],
"best_result": {
"status": "success",
"smiles": "CCO",
"model": "DECIMER",
"source": "local"
},
"output_file": "/path/to/output/molecule_smiles.json"
}
{
"input_image": "/path/to/complex.png",
"results": [
{
"status": "success",
"smiles": "CC(=O)Oc1ccccc1C(=O)O",
"model": "DECIMER",
"source": "local"
},
{
"status": "success",
"smiles": "CC(=O)Oc1ccccc1C(=O)O",
"model": "MolNextR",
"source": "huggingface"
}
],
"best_result": {
"status": "success",
"smiles": "CC(=O)Oc1ccccc1C(=O)O",
"model": "DECIMER"
}
}
{
"input_image": "/path/to/invalid.png",
"results": [
{
"status": "error",
"error": "无法识别分子结构",
"model": "DECIMER"
}
],
"best_result": {
"status": "error",
"error": "无法识别分子结构"
}
}
# 安装 DECIMER(推荐)
pip install decimer
# 安装 MolNextR 依赖
pip install huggingface_hub
# 完整安装
pip install decimer huggingface_hub rdkit
| 场景 | 推荐模型 | 原因 |
|---|---|---|
| 标准化学结构图 | DECIMER | 速度快、准确率高 |
| 复杂分子结构 | MolNextR | 支持更复杂的结构 |
| 无网络连接 | DECIMER | 本地运行 |
| DECIMER 失败时 | MolNextR | 备用方案 |
| 不确定 | auto | 自动选择最佳 |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 识别失败 | 图片质量差 | 提高图片清晰度 |
| SMILES 错误 | 结构复杂 | 尝试 MolNextR 模型 |
| 立体化学丢失 | 图片无立体信息 | 提供包含楔形键的图片 |
| 原子识别错误 | 字体不清晰 | 使用标准字体 |
重要:为了能在飞书等平台上发送生成的文件,输出目录必须在白名单内:
~/.openclaw/media/~/.openclaw/workspace/~/.openclaw/agents/本 skill 默认输出到 ~/.openclaw/media/mol-image-to-smiles/,可以直接分享!
1. mol-image-to-smiles: 从图片识别 SMILES
2. iupac-to-smiles: 从 SMILES 反推 IUPAC 名称(需要额外工具)
1. mol-image-to-smiles: 从图片提取 SMILES
2. mol-2d-viewer: 用 SMILES 生成新的 2D 结构图
1. mol-image-to-smiles: 从图片提取 SMILES
2. mol-3d-viewer: 生成 3D 分子结构
1. mol-image-to-smiles: 从图片提取 SMILES
2. mol-paper-renderer: 生成出版级分子图片
# 转换单张图片
python3 scripts/mol_image_to_smiles.py -i aspirin.png
# 查看结果
cat ~/.openclaw/media/mol-image-to-smiles/aspirin_smiles.json
# 批量处理目录中所有图片
for img in ./molecules/*.png; do
python3 scripts/mol_image_to_smiles.py -i "$img" -o ./results
done
# 合并结果
cat ./results/*_smiles.json | jq -s '.' > all_results.json
# 使用 DECIMER
python3 scripts/mol_image_to_smiles.py -i molecule.png -m decimer -o ./decimer_result
# 使用 MolNextR
python3 scripts/mol_image_to_smiles.py -i molecule.png -m molnextr -o ./molnextr_result
# 对比结果
diff ./decimer_result/*.json ./molnextr_result/*.json
DECIMER (Deep Learning for Chemical Image Recognition) 使用:
MolNextR 使用:
| 数据集 | DECIMER | MolNextR |
|---|---|---|
| 简单分子 | 95%+ | 93%+ |
| 中等复杂度 | 90%+ | 92%+ |
| 复杂分子 | 85%+ | 88%+ |
| 含立体化学 | 80%+ | 85%+ |
| 错误 | 说明 | 解决方案 |
|---|---|---|
File not found | 图片文件不存在 | 检查文件路径 |
Invalid image | 图片格式不支持 | 使用 png/jpg/jpeg |
No molecule detected | 未检测到分子结构 | 检查图片质量 |
DECIMER not installed | DECIMER 未安装 | pip install decimer |
API error | HuggingFace API 错误 | 检查网络连接 |
| 特性 | iupac-to-smiles | mol-image-to-smiles |
|---|---|---|
| 输入 | IUPAC 名称 | 分子图片 |
| 输出 | SMILES | SMILES |
| 核心模型 | OPSIN API | DECIMER/MolNextR |
| 需要网络 | 是 | 可选 |
| 识别对象 | 文本 | 图像 |