Skip to content

leelasd/Img2Mol

 
 

Repository files navigation

Img2Mol: inferring molecules from pictures

Img2Mol Welcome to Img2Mol! 👋.

Overview

Here we provide the implementation of the img2mol model using PyTorch and PyTorch Lightning for training and inference, along with an exemplary jupyter notebook.

This repository is organized as follows:

  • examples/: contains example images to apply our proposed model on
  • img2mol/: contains necessary python modules for our proposed model
  • model/: stores the trained model weights as pickled files. The download-link will be provided in future soon

Installation

Requirements

python=3.8.5
pip=20.2.4
notebook=6.4.2
pillow=8.0.1
numpy=1.19.2
rdkit=2020.03.1
cudatoolkit=11.0
torchvision=0.8.0
torchaudio=0.7.0
pytorch=1.7.0
pytorch-lightning=1.0.8

Environment

Create a new environment:

git clone [email protected]:bayer-science-for-a-better-life/Img2Mol.git
cd Img2Mol
conda env create -f environment.yml
conda activate img2mol
pip install .

Download Model Weights

You can download the trained parameters for the default model (~2.4GB) as described in our paper using the following link: https://drive.google.com/file/d/1pk21r4Zzb9ZJkszJwP9SObTlfTaRMMtF/view .
Please move the downloaded file model.ckpt into the model/ directory.

Alternatively, we provide a bash script that will download and move the file automatically.

bash download_model.sh

If you have problems downloading the file using the bash script, please manually download the file using the browser.

Examples

Check the example notebook example_inference.ipynb to see how the inference class can be used.

Reference

Please cite our manuscript if you use our model in your work.

D.-A. Clever, T. Le, R. Winter, F. Montanari, Chem. Sci., 2021, DOI: 10.1039/D1SC01839F

Img2Mol Code License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Model Parameters License

The Img2Mol parameters are made available for non-commercial use only, under the terms of the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license. You can find details at: https://creativecommons.org/licenses/by-nc/4.0/legalcode

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 91.8%
  • Python 7.8%
  • Shell 0.4%