Tools · Cheminformatics & Structure
Image to Structure (OCSR)
Read chemical structures and reaction schemes from images of papers, slides and whiteboards as SMILES, with each reading checked by a second model
On this page
Prices, workflows, and method papersOpen in the app
Run it from the API
Submit with Submit a job and the job_type below. Price it first with Estimate job reservation cost: submitting reserves that amount from your wallet, and the charge settles at the actual runtime.
Image to Structure (OCSR) image-to-structure
- Job type
image-to-structure- Hardware
cput4(default)- Typical runtime
- 10 min on Nvidia T4
Payload
| Field | Type | Description |
|---|---|---|
imagerequired | imageFile | artifactRef | One PNG or JPEG, at most 10 MB and 25 megapixels. |
reactions | boolean | Also parse reaction schemes into reaction SMILES. Default: |
max_structures | integer | Most structures to read from the image. Default: |
Example
from cognichem_client import CogniChem
client = CogniChem.from_env() # reads COGNICHEM_API_KEY
payload = {
"image": {"name": "scheme.png", "content_b64": "<file contents, base64>"},
"reactions": True,
"max_structures": 10,
}
estimate = client.jobs.estimate(job_type="image-to-structure", payload=payload, resource="t4")
print(f"Reserves ${estimate.cost:.2f}")
job = client.jobs.submit(
job_name="my-image-to-structure-run",
job_type="image-to-structure",
payload=payload,
resource="t4",
)
status = client.jobs.wait(job.process_id)
if status.status == "completed":
client.jobs.result(job.process_id, save_path=".")curl -X POST "https://api.cognichem.com/api/v1/jobs/submit" \
-H "X-Api-Key: $COGNICHEM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"job_name": "my-image-to-structure-run",
"job_type": "image-to-structure",
"payload": {
"image": {
"name": "scheme.png",
"content_b64": "<file contents, base64>"
},
"reactions": true,
"max_structures": 10
},
"resource": "t4"
}'{
"image": {
"name": "scheme.png",
"content_b64": "<file contents, base64>"
},
"reactions": true,
"max_structures": 10
}Sample data from the job catalog; long values are shortened here. Each job_name must be unique among your jobs.
Workflow inputs
- ImagePNG, JPEG
Workflow outputs
- ArchiveZIP
- ImagePNG
- MoleculesSMILES
- TableCSV
- TableCSV