dptech-corp/molparser/molparser-visual-ocsr

Claude Code and agent skill by dptech-corp/molparser

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use for MolParser visual OCSR workflows that parse molecule images or PDFs into E-SMILES/SMILES with MolDet detection and MolParser recognition models.

Install

npx vskill@latest install dptech-corp/molparser/molparser-visual-ocsr

SKILL.md

MolParser Visual OCSR Skill

Use this skill when extracting molecular structures from images, PDFs, URLs, or mixed input lists with molparser.MolParser.

Workflow

  1. Use molparser/models/config.yaml defaults or pass a custom YAML path to MolParser.
  2. Prefer device="auto" unless CPU/GPU must be forced.
  3. For PIL images, image paths, or image URLs:
  • Use rec_only=True when the image is already a single molecule crop.
  • Use rec_only=False when detection is needed; this uses moldet_v2_yolo11n_640_general.pt.
  1. For PDF paths or PDF URLs:
  • rec_only is ignored; render pages with pypdfium2 at pdf_dpi=300.
  • Detect molecules with moldet_v2_yolo11n_960_doc.pt.
  1. Recognize crops with the MolParser recognition model, then normalize with postprocess_caption.
  2. Use batch defaults unless memory requires tuning: MolDet batch size is 8, MolParser OCSR batch size is 16.
  3. Multi-image inputs are batched together; PDF page detections are cropped first, then molecule crops are batched together for recognition.
  4. Use moldet.expand_px for detector box expansion and molparser.padding_px for recognition input padding; defaults are expand_px=2 and padding_px=0, and both can be overridden in parse(...).

Minimal Example

python
from molparser import MolParser
parser = MolParser(device="auto", pdf_dpi=300)
results = parser.parse(["mol.png", "paper.pdf"], rec_only=False)
for item in results:
print(item.input_index, item.page_index, item.bbox, item.esmi)

For high-throughput molecule crops:

python
parser = MolParser(device="cuda", molparser_batch_size=1024)
results = parser.parse(["mol_001.png", "mol_002.png"], rec_only=True)

Output Fields

Each result includes source, input_index, page_index, bbox, confidence, raw_caption, caption, smi, esmi, cxsmiles, markush, sru, and groups.

  • All parse methods return list[MolParserResult].
  • Single image with rec_only=True: one whole-image result; bbox, confidence, and page_index are None.
  • Image with rec_only=False: one result per detected molecule; no detections returns an empty list.
  • PDF input: one result per detected molecule on rendered PDF pages; page_index, bbox, and confidence are populated.
  • List input: flat result list; use input_index to map each result back to the original list item.

Use esmi for downstream tasks that need E-SMILES 2.0 annotations, including axial chirality; smi does not preserve every extension. For token definitions, classification flags, and index handling, read `molparser-extended-smiles/SKILL.md`. An <x> record alone does not set markush. sru is reserved for a symbolic whole-molecule repeat count, not local repeats or numeric counts/ranges.

License Notes

MolDetv2 weights are non-commercial according to their model card. The PyTorch detection path uses Ultralytics YOLO; closed-source, private, SaaS, internal business, or commercial usage may require AGPL-3.0 compliance or an Ultralytics Enterprise license.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
32
Repository forks
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dptech-corp/molparser/molparser-visual-ocsr/badge)](https://verified-skill.com/skills/dptech-corp/molparser/molparser-visual-ocsr)

Something wrong with this skill or its page? Tell us.