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 onimg2mol/
: contains necessary python modules for our proposed modelmodel/
: stores the trained model weights as pickled files. The download-link will be provided in future soon
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
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 .
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.
Check the example notebook example_inference.ipynb
to see how the inference class can be used.
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
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.
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