Kohulan / DECIMER-Image_Transformer

DECIMER Image Transformer is a deep-learning-based tool designed for automated recognition of chemical structure images. Leveraging transformer architectures, the model converts chemical images into SMILES strings, enabling the digitization of chemical data from scanned documents, literature, and patents.
MIT License
217 stars 52 forks source link

How can the decimer code be used from Python? #8

Closed cthoyt closed 3 years ago

cthoyt commented 3 years ago

Currently, the package gives a command line tool. There should also be an example in the README on how to import the code from inside your own python script and use it (this will make more sense after #2)

pythonnewbie3 commented 3 years ago

@cthoyt Could you share on how to use it from python?

Kohulan commented 3 years ago

@pythonnewbie3

Clone the Repository to your local storage and then, inside python

import src.decimer.DECIMER as decimer
model_name = “Isomeric"
img_path = “caffeine.png”
caffeine_smiles = decimer.predict_SMILES(img_path,model_name)
print(caffeine_smiles)

Hope this helps for now.