Install
openclaw skills install ocsrPatSight MolVision molecular image recognition: calls Patent Extractor API on 1-N structure images, returns SMILES/SDF and compute properties by rdkit. First...
openclaw skills install ocsrUses PatSight MolVision to perform optical chemical structure recognition (OCSR) on molecular structure images, extract SMILES/SDF, compute molecular properties by RDKit, and generate visualization dashboard image.
This skill calls the PatSight Patent Extractor API and requires patsight account and password.
First-time users: Register at PatSight.
Add to your OpenClaw config:
{
"skills": {
"entries": {
"ocsr": {
"enabled": true,
"env": {
"PATSIGHT_ACCOUNT": "PATSIGHT_ACCOUNT",
"PATSIGHT_PASSWORD": "PATSIGHT_PASSWORD,
},
}
}
}
}
Or set environment variables:
export PATSIGHT_ACCOUNT="your_account"
export PATSIGHT_PASSWORD="your_password"
uv run python skills/ocsr/scripts/run_ocsr.py patent <image1> <image2> ...
uv run python skills/ocsr/scripts/run_ocsr.py mol1.png mol2.png --outdir ./ocsr_output
uv run python skills/ocsr/scripts/run_ocsr.py patent image.jpg --token <token>
# Basic OCSR on images (backward compatible: omit "patent" subcommand)
uv run python skills/ocsr/scripts/run_ocsr.py mol1.png mol2.png
# With output directory
uv run python skills/ocsr/scripts/run_ocsr.py patent mol1.png mol2.png --outdir ./ocsr_output
# With token
uv run python skills/ocsr/scripts/run_ocsr.py patent image.jpg --token $PATSIGHT_TOKEN
# With account credentials
uv run python skills/ocsr/scripts/run_ocsr.py patent image.png --account user --password pass
| Option | Description | Default |
|---|---|---|
--outdir <dir> | Output directory | ./ocsr_output |
--request-id <id> | Request ID for tracking | timestamp (ms) |
--base-url <url> | API base URL | PATSIGHT_BASE_URL or https://patent.xinsight-ai.com/patent/api |
--account <account> | patsight account (auto-fetch token) | PATSIGHT_ACCOUNT |
--password <password> | patsight password (auto-fetch token) | PATSIGHT_PASSWORD |
--timeout <sec> | HTTP timeout in seconds | 180 |
--panel-image-size <px> | Molecule block size in report image | 300 |
.png, .jpg, .jpeg, .webp, .bmp, .tif, .tiff
ocsr_result_<timestamp>.json: Raw API response + enriched RDKit propertiesocsr_dashboard_<timestamp>.png: Visualization reportEach result includes smiles, sdf_str, score, and RDKit-derived properties (formula, MW, LogP, TPSA, etc.).
POST {base_url}/v1/u/extractor/image/molecules?request_id=<id>
base_url: Default https://patent.xinsight-ai.com/patent/apiAuthorization: <token> headerimage: Image file(s) (one image field per file, multiple allowed)label: Fixed as molvisionAPI returns {"code":1, "data":{"data":[...], "msg":"SUCCESS", ...}}. The script converts it to {"data": [...]} for downstream processing. Each record contains smiles, sdf_str, score, idx, page_idx, rect, etc.
--token > PATSIGHT_TOKEN > --account/--password > env vars