decimer 2.7.0__tar.gz → 2.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/config.py +61 -18
  2. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/decimer.py +7 -6
  3. decimer-2.7.1/PKG-INFO +195 -0
  4. decimer-2.7.1/README.md +171 -0
  5. decimer-2.7.1/decimer.egg-info/PKG-INFO +195 -0
  6. {decimer-2.7.0 → decimer-2.7.1}/setup.py +1 -1
  7. decimer-2.7.0/PKG-INFO +0 -145
  8. decimer-2.7.0/README.md +0 -121
  9. decimer-2.7.0/decimer.egg-info/PKG-INFO +0 -145
  10. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/DECIMER_EfficinetNetV2_Transfomer_Trainer.py +0 -0
  11. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/Efficient_Net_encoder.py +0 -0
  12. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/Predictor_usingCheckpoints.py +0 -0
  13. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/Repack_model.py +0 -0
  14. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/Transformer_decoder.py +0 -0
  15. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/Utils/Create_TFrecord_From_pickles.py +0 -0
  16. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/Utils/Create_image_tokenizer.py +0 -0
  17. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/__init__.py +0 -0
  18. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/efficientnetv2/effnetv2_configs.py +0 -0
  19. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/efficientnetv2/effnetv2_model.py +0 -0
  20. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/efficientnetv2/hparams.py +0 -0
  21. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/efficientnetv2/utils.py +0 -0
  22. {decimer-2.7.0 → decimer-2.7.1}/DECIMER/utils.py +0 -0
  23. {decimer-2.7.0 → decimer-2.7.1}/LICENSE +0 -0
  24. {decimer-2.7.0 → decimer-2.7.1}/decimer.egg-info/SOURCES.txt +0 -0
  25. {decimer-2.7.0 → decimer-2.7.1}/decimer.egg-info/dependency_links.txt +0 -0
  26. {decimer-2.7.0 → decimer-2.7.1}/decimer.egg-info/entry_points.txt +0 -0
  27. {decimer-2.7.0 → decimer-2.7.1}/decimer.egg-info/requires.txt +0 -0
  28. {decimer-2.7.0 → decimer-2.7.1}/decimer.egg-info/top_level.txt +0 -0
  29. {decimer-2.7.0 → decimer-2.7.1}/setup.cfg +0 -0
@@ -11,6 +11,7 @@ import tensorflow as tf
11
11
  from PIL import Image
12
12
  from PIL import ImageEnhance
13
13
  from pillow_heif import register_heif_opener
14
+ from typing import Union
14
15
 
15
16
  import DECIMER.Efficient_Net_encoder as Efficient_Net_encoder
16
17
  import DECIMER.Transformer_decoder as Transformer_decoder
@@ -95,26 +96,68 @@ def HEIF_to_pillow(image_path: str):
95
96
  return heif_file
96
97
 
97
98
 
98
- def remove_transparent(image_path: str):
99
+ def remove_transparent(image: Union[str, np.ndarray]) -> Image.Image:
99
100
  """
100
- Removes the transparent layer from a PNG image with an alpha channel
101
- Args: image_path (str): path of input image
102
- Returns: PIL.Image
101
+ Removes the transparent layer from a PNG image with an alpha channel.
102
+
103
+ Args:
104
+ image (Union[str, np.ndarray]): Path of the input image or a numpy array representing the image.
105
+
106
+ Returns:
107
+ PIL.Image.Image: The image with transparency removed.
103
108
  """
104
- try:
105
- png = Image.open(image_path).convert("RGBA")
106
- except Exception as e:
107
- if type(e).__name__ == "UnidentifiedImageError":
108
- png = HEIF_to_pillow(image_path)
109
- else:
110
- print(e)
111
- raise Exception
109
+ def process_image(png: Image.Image) -> Image.Image:
110
+ """
111
+ Helper function to remove transparency from a single image.
112
+
113
+ Args:
114
+ png (PIL.Image.Image): The input PIL image with transparency.
115
+
116
+ Returns:
117
+ PIL.Image.Image: The image with transparency removed.
118
+ """
119
+ background = Image.new("RGBA", png.size, (255, 255, 255))
120
+ alpha_composite = Image.alpha_composite(background, png)
121
+ return alpha_composite
112
122
 
113
- background = Image.new("RGBA", png.size, (255, 255, 255))
123
+ def handle_image_path(image_path: str) -> Image.Image:
124
+ """
125
+ Helper function to handle image paths.
126
+
127
+ Args:
128
+ image_path (str): The path to the input image.
129
+
130
+ Returns:
131
+ PIL.Image.Image: The image with transparency removed.
132
+ """
133
+ try:
134
+ png = Image.open(image_path).convert("RGBA")
135
+ except Exception as e:
136
+ if type(e).__name__ == "UnidentifiedImageError":
137
+ png = HEIF_to_pillow(image_path)
138
+ else:
139
+ print(e)
140
+ raise Exception
141
+ return process_image(png)
142
+
143
+ def handle_numpy_array(array: np.ndarray) -> Image.Image:
144
+ """
145
+ Helper function to handle a numpy array.
146
+
147
+ Args:
148
+ array (np.ndarray): The numpy array representing the image.
149
+
150
+ Returns:
151
+ PIL.Image.Image: The image with transparency removed.
152
+ """
153
+ png = Image.fromarray(array).convert("RGBA")
154
+ return process_image(png)
114
155
 
115
- alpha_composite = Image.alpha_composite(background, png)
156
+ # Check if input is a numpy array
157
+ if isinstance(image, np.ndarray):
158
+ return handle_numpy_array(array=image)
116
159
 
117
- return alpha_composite
160
+ return handle_image_path(image_path=image)
118
161
 
119
162
 
120
163
  def get_bnw_image(image):
@@ -185,12 +228,12 @@ def increase_brightness(image):
185
228
  return image
186
229
 
187
230
 
188
- def decode_image(image_path: str):
231
+ def decode_image(image_path: Union[str, np.ndarray]):
189
232
  """Loads an image and preprocesses the input image in several steps to get
190
233
  the image ready for DECIMER input.
191
234
 
192
235
  Args:
193
- image_path (str): path of input image
236
+ image_path (Union[str, np.ndarray]): path of input image or numpy array representing the image.
194
237
 
195
238
  Returns:
196
239
  Processed image
@@ -237,7 +280,7 @@ class Config:
237
280
  backbone_fn (method): Calls Efficient-Net V2 as backbone for encoder
238
281
  image_shape (int): Shape of the input image
239
282
  do_permute (bool, optional): . Defaults to False.
240
- pretrained_weights (keras weights, optional): Use pretrainined efficient net weights or not. Defaults to None.
283
+ pretrained_weights (keras weights, optional): Use pretrained efficient net weights or not. Defaults to None.
241
284
  """
242
285
  self.encoder_config = dict(
243
286
  image_embedding_dim=image_embedding_dim,
@@ -5,6 +5,7 @@ import sys
5
5
  from typing import List
6
6
  from typing import Tuple
7
7
 
8
+ import numpy as np
8
9
  import pystow
9
10
  import tensorflow as tf
10
11
 
@@ -122,19 +123,19 @@ def detokenize_output_add_confidence(
122
123
 
123
124
 
124
125
  def predict_SMILES(
125
- image_path: str, confidence: bool = False, hand_drawn: bool = False
126
+ image_input: [str, np.ndarray], confidence: bool = False, hand_drawn: bool = False
126
127
  ) -> str:
127
128
  """Predicts SMILES representation of a molecule depicted in the given image.
128
129
 
129
130
  Args:
130
- image_path (str): Path of chemical structure depiction image
131
- confidence (bool): Flag to indicate whether to return confidence values along with SMILES prediction
132
- hand_drawn (bool): Flag to indicate whether the molecule in the image is hand-drawn
131
+ image_input (str or np.ndarray): Path of chemical structure depiction image or a numpy array representing the image.
132
+ confidence (bool): Flag to indicate whether to return confidence values along with SMILES prediction.
133
+ hand_drawn (bool): Flag to indicate whether the molecule in the image is hand-drawn.
133
134
 
134
135
  Returns:
135
- str: SMILES representation of the molecule in the input image, optionally with confidence values
136
+ str: SMILES representation of the molecule in the input image, optionally with confidence values.
136
137
  """
137
- chemical_structure = config.decode_image(image_path)
138
+ chemical_structure = config.decode_image(image_input)
138
139
 
139
140
  model = DECIMER_Hand_drawn if hand_drawn else DECIMER_V2
140
141
  predicted_tokens, confidence_values = model(tf.constant(chemical_structure))
decimer-2.7.1/PKG-INFO ADDED
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.1
2
+ Name: decimer
3
+ Version: 2.7.1
4
+ Summary: DECIMER 2.6.0: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
5
+ Home-page: https://github.com/Kohulan/DECIMER-Image_Transformer
6
+ Author: Kohulan Rajan
7
+ Author-email: kohulan.rajan@uni-jena.de
8
+ Maintainer: Kohulan Rajan, Otto Brinkhaus
9
+ Maintainer-email: kohulan.rajan@uni-jena.de, otto.brinkhaus@uni-jena.de
10
+ License: MIT
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.5
13
+ Classifier: Programming Language :: Python :: 3.6
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Requires-Python: >=3.5
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+
25
+ <div align="center">
26
+
27
+ # 🧪 DECIMER Image Transformer 🖼️
28
+
29
+ ### Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
30
+
31
+ <p align="center">
32
+ <img src="https://github.com/Kohulan/DECIMER-Image_Transformer/blob/master/DECIMER_V2.png?raw=true" alt="DECIMER Logo" width="600">
33
+ </p>
34
+
35
+ [![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
36
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/commit-activity)
37
+ [![GitHub issues](https://img.shields.io/github/issues/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/issues/)
38
+ [![GitHub contributors](https://img.shields.io/github/contributors/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/contributors/)
39
+ [![tensorflow](https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=for-the-badge&logo=tensorflow)](https://www.tensorflow.org)
40
+ [![DOI](https://zenodo.org/badge/293572361.svg)](https://zenodo.org/badge/latestdoi/293572361)
41
+ [![Documentation Status](https://readthedocs.org/projects/decimer-image-transformer/badge/?version=latest&style=for-the-badge)](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
42
+ [![GitHub release](https://img.shields.io/github/release/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/releases/)
43
+ [![PyPI version fury.io](https://badge.fury.io/py/decimer.svg?style=for-the-badge)](https://pypi.python.org/pypi/decimer/)
44
+
45
+ </div>
46
+
47
+ ---
48
+
49
+ ## 📚 Table of Contents
50
+
51
+ - [Abstract](#-abstract)
52
+ - [Method and Model Changes](#-method-and-model-changes)
53
+ - [Installation](#-installation)
54
+ - [Usage](#-usage)
55
+ - [Hand-drawn Model](#-decimer---hand-drawn-model)
56
+ - [Citation](#-citation)
57
+ - [Acknowledgements](#-acknowledgements)
58
+ - [Author](#-author-kohulan)
59
+ - [Project Website](#-project-website)
60
+ - [Research Group](#-research-group)
61
+
62
+ ---
63
+
64
+ ## 🔬 Abstract
65
+
66
+ <div style="background-color: #f0f0f0; padding: 15px; border-radius: 10px;">
67
+
68
+ The DECIMER 2.2 project tackles the OCSR (Optical Chemical Structure Recognition) challenge using cutting-edge computational intelligence methods. Our goal? To provide an automated, open-source software solution for chemical image recognition.
69
+
70
+ We've supercharged DECIMER with Google's TPU (Tensor Processing Unit) to handle datasets of over 1 million images with lightning speed!
71
+
72
+ </div>
73
+
74
+ ---
75
+
76
+ ## 🧠 Method and Model Changes
77
+
78
+ <table>
79
+ <tr>
80
+ <td width="50%">
81
+ <h3>🖼️ Image Feature Extraction</h3>
82
+ <p>Now utilizing EfficientNet-V2 for superior image analysis</p>
83
+ </td>
84
+ <td width="50%">
85
+ <h3>🔮 SMILES Prediction</h3>
86
+ <p>Employing a state-of-the-art transformer model</p>
87
+ </td>
88
+ </tr>
89
+ </table>
90
+
91
+ ### 🚀 Training Enhancements
92
+
93
+ 1. **TFRecord Files**: Lightning-fast data reading
94
+ 2. **Google Cloud Buckets**: Efficient cloud storage solution
95
+ 3. **TensorFlow Data Pipeline**: Optimized data loading
96
+ 4. **TPU Strategy**: Harnessing the power of Google's TPUs
97
+
98
+ ---
99
+
100
+ ## 💻 Installation
101
+
102
+ ```bash
103
+ # Create a conda wonderland
104
+ conda create --name DECIMER python=3.10.0 -y
105
+ conda activate DECIMER
106
+
107
+ # Equip yourself with DECIMER
108
+ pip install decimer
109
+ ```
110
+
111
+ ---
112
+
113
+ ## 🎮 Usage
114
+
115
+ ```python
116
+ from DECIMER import predict_SMILES
117
+
118
+ # Unleash the power of DECIMER
119
+ image_path = "path/to/your/chemical/masterpiece.jpg"
120
+ SMILES = predict_SMILES(image_path)
121
+ print(f"🎉 Decoded SMILES: {SMILES}")
122
+ ```
123
+
124
+ ---
125
+
126
+ ## ✍️ DECIMER - Hand-drawn Model
127
+
128
+ <div style="background-color: #e6f7ff; padding: 15px; border-radius: 10px;">
129
+
130
+ 🌟 **New Feature Alert!** 🌟
131
+
132
+ Our latest model brings the magic of AI to hand-drawn chemical structures!
133
+
134
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10781330.svg)](https://doi.org/10.5281/zenodo.10781330)
135
+
136
+ </div>
137
+
138
+ ---
139
+
140
+ ## 📜 Citation
141
+
142
+ <div style="background-color: #f9f9f9; padding: 15px; border-radius: 10px;">
143
+
144
+ If DECIMER helps your research, please cite:
145
+
146
+ 1. Rajan K, et al. "DECIMER.ai - An open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications." *Nat. Commun.* 14, 5045 (2023).
147
+ 2. Rajan, K., et al. "DECIMER 1.0: deep learning for chemical image recognition using transformers." *J Cheminform* 13, 61 (2021).
148
+ 3. Rajan, K., et al. "Advancements in hand-drawn chemical structure recognition through an enhanced DECIMER architecture," *J Cheminform* 16, 78 (2024).
149
+
150
+ </div>
151
+
152
+ ---
153
+
154
+ ## 🙏 Acknowledgements
155
+
156
+ - A big thank you to [Charles Tapley Hoyt](https://github.com/cthoyt) for his invaluable contributions!
157
+ - Powered by Google's TPU Research Cloud (TRC)
158
+
159
+ <p align="center">
160
+ <img src="https://user-images.githubusercontent.com/30716951/220350828-913e6645-6a0a-403c-bcb8-160d061d4606.png" width="300">
161
+ </p>
162
+
163
+ ---
164
+
165
+ ## 👨‍🔬 Author: [Kohulan](https://kohulanr.com)
166
+
167
+ <p align="center">
168
+ <img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/raw/master/assets/DECIMER.gif" width="300">
169
+ </p>
170
+
171
+ ---
172
+
173
+ ## 🌐 Project Website
174
+
175
+ Experience DECIMER in action at [decimer.ai](https://decimer.ai), brilliantly implemented by [Otto Brinkhaus](https://github.com/OBrink)!
176
+
177
+ ---
178
+
179
+ ## 🏫 Research Group
180
+
181
+ <p align="center">
182
+ <a href="https://cheminf.uni-jena.de">
183
+ <img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png" width="300">
184
+ </a>
185
+ </p>
186
+
187
+ ---
188
+
189
+ <div align="center">
190
+
191
+ ### 📊 Project Analytics
192
+
193
+ ![Repobeats](https://repobeats.axiom.co/api/embed/bf532b7ac0d34137bdea8fbb82986828f86de065.svg "Repobeats analytics image")
194
+
195
+ </div>
@@ -0,0 +1,171 @@
1
+ <div align="center">
2
+
3
+ # 🧪 DECIMER Image Transformer 🖼️
4
+
5
+ ### Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
6
+
7
+ <p align="center">
8
+ <img src="https://github.com/Kohulan/DECIMER-Image_Transformer/blob/master/DECIMER_V2.png?raw=true" alt="DECIMER Logo" width="600">
9
+ </p>
10
+
11
+ [![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
12
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/commit-activity)
13
+ [![GitHub issues](https://img.shields.io/github/issues/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/issues/)
14
+ [![GitHub contributors](https://img.shields.io/github/contributors/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/contributors/)
15
+ [![tensorflow](https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=for-the-badge&logo=tensorflow)](https://www.tensorflow.org)
16
+ [![DOI](https://zenodo.org/badge/293572361.svg)](https://zenodo.org/badge/latestdoi/293572361)
17
+ [![Documentation Status](https://readthedocs.org/projects/decimer-image-transformer/badge/?version=latest&style=for-the-badge)](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
18
+ [![GitHub release](https://img.shields.io/github/release/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/releases/)
19
+ [![PyPI version fury.io](https://badge.fury.io/py/decimer.svg?style=for-the-badge)](https://pypi.python.org/pypi/decimer/)
20
+
21
+ </div>
22
+
23
+ ---
24
+
25
+ ## 📚 Table of Contents
26
+
27
+ - [Abstract](#-abstract)
28
+ - [Method and Model Changes](#-method-and-model-changes)
29
+ - [Installation](#-installation)
30
+ - [Usage](#-usage)
31
+ - [Hand-drawn Model](#-decimer---hand-drawn-model)
32
+ - [Citation](#-citation)
33
+ - [Acknowledgements](#-acknowledgements)
34
+ - [Author](#-author-kohulan)
35
+ - [Project Website](#-project-website)
36
+ - [Research Group](#-research-group)
37
+
38
+ ---
39
+
40
+ ## 🔬 Abstract
41
+
42
+ <div style="background-color: #f0f0f0; padding: 15px; border-radius: 10px;">
43
+
44
+ The DECIMER 2.2 project tackles the OCSR (Optical Chemical Structure Recognition) challenge using cutting-edge computational intelligence methods. Our goal? To provide an automated, open-source software solution for chemical image recognition.
45
+
46
+ We've supercharged DECIMER with Google's TPU (Tensor Processing Unit) to handle datasets of over 1 million images with lightning speed!
47
+
48
+ </div>
49
+
50
+ ---
51
+
52
+ ## 🧠 Method and Model Changes
53
+
54
+ <table>
55
+ <tr>
56
+ <td width="50%">
57
+ <h3>🖼️ Image Feature Extraction</h3>
58
+ <p>Now utilizing EfficientNet-V2 for superior image analysis</p>
59
+ </td>
60
+ <td width="50%">
61
+ <h3>🔮 SMILES Prediction</h3>
62
+ <p>Employing a state-of-the-art transformer model</p>
63
+ </td>
64
+ </tr>
65
+ </table>
66
+
67
+ ### 🚀 Training Enhancements
68
+
69
+ 1. **TFRecord Files**: Lightning-fast data reading
70
+ 2. **Google Cloud Buckets**: Efficient cloud storage solution
71
+ 3. **TensorFlow Data Pipeline**: Optimized data loading
72
+ 4. **TPU Strategy**: Harnessing the power of Google's TPUs
73
+
74
+ ---
75
+
76
+ ## 💻 Installation
77
+
78
+ ```bash
79
+ # Create a conda wonderland
80
+ conda create --name DECIMER python=3.10.0 -y
81
+ conda activate DECIMER
82
+
83
+ # Equip yourself with DECIMER
84
+ pip install decimer
85
+ ```
86
+
87
+ ---
88
+
89
+ ## 🎮 Usage
90
+
91
+ ```python
92
+ from DECIMER import predict_SMILES
93
+
94
+ # Unleash the power of DECIMER
95
+ image_path = "path/to/your/chemical/masterpiece.jpg"
96
+ SMILES = predict_SMILES(image_path)
97
+ print(f"🎉 Decoded SMILES: {SMILES}")
98
+ ```
99
+
100
+ ---
101
+
102
+ ## ✍️ DECIMER - Hand-drawn Model
103
+
104
+ <div style="background-color: #e6f7ff; padding: 15px; border-radius: 10px;">
105
+
106
+ 🌟 **New Feature Alert!** 🌟
107
+
108
+ Our latest model brings the magic of AI to hand-drawn chemical structures!
109
+
110
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10781330.svg)](https://doi.org/10.5281/zenodo.10781330)
111
+
112
+ </div>
113
+
114
+ ---
115
+
116
+ ## 📜 Citation
117
+
118
+ <div style="background-color: #f9f9f9; padding: 15px; border-radius: 10px;">
119
+
120
+ If DECIMER helps your research, please cite:
121
+
122
+ 1. Rajan K, et al. "DECIMER.ai - An open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications." *Nat. Commun.* 14, 5045 (2023).
123
+ 2. Rajan, K., et al. "DECIMER 1.0: deep learning for chemical image recognition using transformers." *J Cheminform* 13, 61 (2021).
124
+ 3. Rajan, K., et al. "Advancements in hand-drawn chemical structure recognition through an enhanced DECIMER architecture," *J Cheminform* 16, 78 (2024).
125
+
126
+ </div>
127
+
128
+ ---
129
+
130
+ ## 🙏 Acknowledgements
131
+
132
+ - A big thank you to [Charles Tapley Hoyt](https://github.com/cthoyt) for his invaluable contributions!
133
+ - Powered by Google's TPU Research Cloud (TRC)
134
+
135
+ <p align="center">
136
+ <img src="https://user-images.githubusercontent.com/30716951/220350828-913e6645-6a0a-403c-bcb8-160d061d4606.png" width="300">
137
+ </p>
138
+
139
+ ---
140
+
141
+ ## 👨‍🔬 Author: [Kohulan](https://kohulanr.com)
142
+
143
+ <p align="center">
144
+ <img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/raw/master/assets/DECIMER.gif" width="300">
145
+ </p>
146
+
147
+ ---
148
+
149
+ ## 🌐 Project Website
150
+
151
+ Experience DECIMER in action at [decimer.ai](https://decimer.ai), brilliantly implemented by [Otto Brinkhaus](https://github.com/OBrink)!
152
+
153
+ ---
154
+
155
+ ## 🏫 Research Group
156
+
157
+ <p align="center">
158
+ <a href="https://cheminf.uni-jena.de">
159
+ <img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png" width="300">
160
+ </a>
161
+ </p>
162
+
163
+ ---
164
+
165
+ <div align="center">
166
+
167
+ ### 📊 Project Analytics
168
+
169
+ ![Repobeats](https://repobeats.axiom.co/api/embed/bf532b7ac0d34137bdea8fbb82986828f86de065.svg "Repobeats analytics image")
170
+
171
+ </div>
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.1
2
+ Name: decimer
3
+ Version: 2.7.1
4
+ Summary: DECIMER 2.6.0: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
5
+ Home-page: https://github.com/Kohulan/DECIMER-Image_Transformer
6
+ Author: Kohulan Rajan
7
+ Author-email: kohulan.rajan@uni-jena.de
8
+ Maintainer: Kohulan Rajan, Otto Brinkhaus
9
+ Maintainer-email: kohulan.rajan@uni-jena.de, otto.brinkhaus@uni-jena.de
10
+ License: MIT
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.5
13
+ Classifier: Programming Language :: Python :: 3.6
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Requires-Python: >=3.5
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+
25
+ <div align="center">
26
+
27
+ # 🧪 DECIMER Image Transformer 🖼️
28
+
29
+ ### Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
30
+
31
+ <p align="center">
32
+ <img src="https://github.com/Kohulan/DECIMER-Image_Transformer/blob/master/DECIMER_V2.png?raw=true" alt="DECIMER Logo" width="600">
33
+ </p>
34
+
35
+ [![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
36
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/commit-activity)
37
+ [![GitHub issues](https://img.shields.io/github/issues/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/issues/)
38
+ [![GitHub contributors](https://img.shields.io/github/contributors/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/contributors/)
39
+ [![tensorflow](https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=for-the-badge&logo=tensorflow)](https://www.tensorflow.org)
40
+ [![DOI](https://zenodo.org/badge/293572361.svg)](https://zenodo.org/badge/latestdoi/293572361)
41
+ [![Documentation Status](https://readthedocs.org/projects/decimer-image-transformer/badge/?version=latest&style=for-the-badge)](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
42
+ [![GitHub release](https://img.shields.io/github/release/Kohulan/DECIMER-Image_Transformer.svg?style=for-the-badge)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/releases/)
43
+ [![PyPI version fury.io](https://badge.fury.io/py/decimer.svg?style=for-the-badge)](https://pypi.python.org/pypi/decimer/)
44
+
45
+ </div>
46
+
47
+ ---
48
+
49
+ ## 📚 Table of Contents
50
+
51
+ - [Abstract](#-abstract)
52
+ - [Method and Model Changes](#-method-and-model-changes)
53
+ - [Installation](#-installation)
54
+ - [Usage](#-usage)
55
+ - [Hand-drawn Model](#-decimer---hand-drawn-model)
56
+ - [Citation](#-citation)
57
+ - [Acknowledgements](#-acknowledgements)
58
+ - [Author](#-author-kohulan)
59
+ - [Project Website](#-project-website)
60
+ - [Research Group](#-research-group)
61
+
62
+ ---
63
+
64
+ ## 🔬 Abstract
65
+
66
+ <div style="background-color: #f0f0f0; padding: 15px; border-radius: 10px;">
67
+
68
+ The DECIMER 2.2 project tackles the OCSR (Optical Chemical Structure Recognition) challenge using cutting-edge computational intelligence methods. Our goal? To provide an automated, open-source software solution for chemical image recognition.
69
+
70
+ We've supercharged DECIMER with Google's TPU (Tensor Processing Unit) to handle datasets of over 1 million images with lightning speed!
71
+
72
+ </div>
73
+
74
+ ---
75
+
76
+ ## 🧠 Method and Model Changes
77
+
78
+ <table>
79
+ <tr>
80
+ <td width="50%">
81
+ <h3>🖼️ Image Feature Extraction</h3>
82
+ <p>Now utilizing EfficientNet-V2 for superior image analysis</p>
83
+ </td>
84
+ <td width="50%">
85
+ <h3>🔮 SMILES Prediction</h3>
86
+ <p>Employing a state-of-the-art transformer model</p>
87
+ </td>
88
+ </tr>
89
+ </table>
90
+
91
+ ### 🚀 Training Enhancements
92
+
93
+ 1. **TFRecord Files**: Lightning-fast data reading
94
+ 2. **Google Cloud Buckets**: Efficient cloud storage solution
95
+ 3. **TensorFlow Data Pipeline**: Optimized data loading
96
+ 4. **TPU Strategy**: Harnessing the power of Google's TPUs
97
+
98
+ ---
99
+
100
+ ## 💻 Installation
101
+
102
+ ```bash
103
+ # Create a conda wonderland
104
+ conda create --name DECIMER python=3.10.0 -y
105
+ conda activate DECIMER
106
+
107
+ # Equip yourself with DECIMER
108
+ pip install decimer
109
+ ```
110
+
111
+ ---
112
+
113
+ ## 🎮 Usage
114
+
115
+ ```python
116
+ from DECIMER import predict_SMILES
117
+
118
+ # Unleash the power of DECIMER
119
+ image_path = "path/to/your/chemical/masterpiece.jpg"
120
+ SMILES = predict_SMILES(image_path)
121
+ print(f"🎉 Decoded SMILES: {SMILES}")
122
+ ```
123
+
124
+ ---
125
+
126
+ ## ✍️ DECIMER - Hand-drawn Model
127
+
128
+ <div style="background-color: #e6f7ff; padding: 15px; border-radius: 10px;">
129
+
130
+ 🌟 **New Feature Alert!** 🌟
131
+
132
+ Our latest model brings the magic of AI to hand-drawn chemical structures!
133
+
134
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10781330.svg)](https://doi.org/10.5281/zenodo.10781330)
135
+
136
+ </div>
137
+
138
+ ---
139
+
140
+ ## 📜 Citation
141
+
142
+ <div style="background-color: #f9f9f9; padding: 15px; border-radius: 10px;">
143
+
144
+ If DECIMER helps your research, please cite:
145
+
146
+ 1. Rajan K, et al. "DECIMER.ai - An open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications." *Nat. Commun.* 14, 5045 (2023).
147
+ 2. Rajan, K., et al. "DECIMER 1.0: deep learning for chemical image recognition using transformers." *J Cheminform* 13, 61 (2021).
148
+ 3. Rajan, K., et al. "Advancements in hand-drawn chemical structure recognition through an enhanced DECIMER architecture," *J Cheminform* 16, 78 (2024).
149
+
150
+ </div>
151
+
152
+ ---
153
+
154
+ ## 🙏 Acknowledgements
155
+
156
+ - A big thank you to [Charles Tapley Hoyt](https://github.com/cthoyt) for his invaluable contributions!
157
+ - Powered by Google's TPU Research Cloud (TRC)
158
+
159
+ <p align="center">
160
+ <img src="https://user-images.githubusercontent.com/30716951/220350828-913e6645-6a0a-403c-bcb8-160d061d4606.png" width="300">
161
+ </p>
162
+
163
+ ---
164
+
165
+ ## 👨‍🔬 Author: [Kohulan](https://kohulanr.com)
166
+
167
+ <p align="center">
168
+ <img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/raw/master/assets/DECIMER.gif" width="300">
169
+ </p>
170
+
171
+ ---
172
+
173
+ ## 🌐 Project Website
174
+
175
+ Experience DECIMER in action at [decimer.ai](https://decimer.ai), brilliantly implemented by [Otto Brinkhaus](https://github.com/OBrink)!
176
+
177
+ ---
178
+
179
+ ## 🏫 Research Group
180
+
181
+ <p align="center">
182
+ <a href="https://cheminf.uni-jena.de">
183
+ <img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png" width="300">
184
+ </a>
185
+ </p>
186
+
187
+ ---
188
+
189
+ <div align="center">
190
+
191
+ ### 📊 Project Analytics
192
+
193
+ ![Repobeats](https://repobeats.axiom.co/api/embed/bf532b7ac0d34137bdea8fbb82986828f86de065.svg "Repobeats analytics image")
194
+
195
+ </div>
@@ -15,7 +15,7 @@ with open("README.md", "r") as fh:
15
15
 
16
16
  setuptools.setup(
17
17
  name="decimer",
18
- version="2.7.0",
18
+ version="2.7.1",
19
19
  author="Kohulan Rajan",
20
20
  author_email="kohulan.rajan@uni-jena.de",
21
21
  maintainer="Kohulan Rajan, Otto Brinkhaus ",
decimer-2.7.0/PKG-INFO DELETED
@@ -1,145 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: decimer
3
- Version: 2.7.0
4
- Summary: DECIMER 2.6.0: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
5
- Home-page: https://github.com/Kohulan/DECIMER-Image_Transformer
6
- Author: Kohulan Rajan
7
- Author-email: kohulan.rajan@uni-jena.de
8
- Maintainer: Kohulan Rajan, Otto Brinkhaus
9
- Maintainer-email: kohulan.rajan@uni-jena.de, otto.brinkhaus@uni-jena.de
10
- License: MIT
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.5
13
- Classifier: Programming Language :: Python :: 3.6
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3 :: Only
19
- Classifier: License :: OSI Approved :: MIT License
20
- Classifier: Operating System :: OS Independent
21
- Requires-Python: >=3.5
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
-
25
- # ***DECIMER Image Transformer***: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
26
-
27
- [![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://opensource.org/licenses/MIT)
28
- [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-blue.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/commit-activity)
29
- [![GitHub issues](https://img.shields.io/github/issues/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/issues/)
30
- [![GitHub contributors](https://img.shields.io/github/contributors/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/contributors/)
31
- [![tensorflow](https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=flat&logo=tensorflow)](https://www.tensorflow.org)
32
- [![DOI](https://zenodo.org/badge/293572361.svg)](https://zenodo.org/badge/latestdoi/293572361)
33
- [![Documentation Status](https://readthedocs.org/projects/decimer-image-transformer/badge/?version=latest)](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
34
- [![GitHub release](https://img.shields.io/github/release/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/releases/)
35
- [![PyPI version fury.io](https://badge.fury.io/py/decimer.svg)](https://pypi.python.org/pypi/decimer/)
36
-
37
- ## Abstract
38
-
39
- The DECIMER 2.2 [5] (Deep lEarning for Chemical ImagE Recognition) project [1] was launched to address the OCSR problem with the latest computational intelligence methods to provide an automated open-source software solution.
40
-
41
- The original implementation of DECIMER[1] using GPU takes a longer training time when we use a bigger dataset of more than 1 million images. To overcome these longer training times, many implement the training script to work on multiple GPUs. However, we tried to step up and implemented our code to use Google's Machine Learning hardware [TPU(Tensor Processing Unit)](https://en.wikipedia.org/wiki/Tensor_Processing_Unit) [2]. You can learn more about the hardware [here](https://en.wikipedia.org/wiki/Tensor_Processing_Unit).
42
-
43
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image_Transformer/blob/master/DECIMER_V2.png?raw=true)](https://github.com/Kohulan/DECIMER-Image_Transformer)
44
-
45
- ## Method and model changes
46
- - The DECIMER now uses EfficientNet-V2[3] for Image feature extraction and a transformer model [4] for predicting the SMILES.
47
- - The SMILES used during training and predictions
48
-
49
- ### Changes in the training method
50
-
51
- - We converted our datasets into [TFRecord](https://www.tensorflow.org/tutorials/load_data/tfrecord) Files, A binary file system the TPUs can read in a much faster way. Also, we can use these files to train on GPUs. Using the TFRecord helps us train the model fast by overcoming the bottleneck of reading multiple files from the hard disks.
52
- - We moved our data to [Google Cloud Buckets](https://cloud.google.com/storage/docs/json_api/v1/buckets). An efficient storage solution provided by the google cloud environment where we can access these files from any google cloud VMs easily and in a much faster way. (To get the highest speed, the cloud storage and the VM should be in the same region)
53
- - We adopted the TensorFlow data pipeline to load all TFRecord files to the TPUs from Google Cloud Buckets.
54
- - We modified the main training code to work on TPUs using [TPU strategy](https://www.tensorflow.org/api_docs/python/tf/distribute/TPUStrategy) introduced in Tensorflow 2.0.
55
-
56
- ## How to use DECIMER?
57
- - Python package [Documentation](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
58
- - Model library could be found here: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7624994.svg)](https://zenodo.org/record/7624994)
59
-
60
- ### We suggest using DECIMER inside a Conda environment, which makes the dependencies install easily.
61
- - Conda can be downloaded as part of the [Anaconda](https://www.anaconda.com/) or the [Miniconda](https://conda.io/en/latest/miniconda.html) platforms (Python 3.7). We recommend installing miniconda3. Using Linux, you can get it with:
62
- ```
63
- $ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
64
- $ bash Miniconda3-latest-Linux-x86_64.sh
65
- ```
66
-
67
- ### Instructions
68
-
69
- ### Python Package Installation
70
-
71
- #### Use a conda environment for clean installation
72
- ```shell
73
- $ sudo apt update
74
- $ sudo apt install unzip
75
- $ conda create --name DECIMER python=3.10.0
76
- $ conda activate DECIMER
77
- $ conda install pip
78
- $ python3 -m pip install -U pip
79
- ```
80
-
81
- Install the latest code from GitHub with:
82
- ```shell
83
- $ pip install git+https://github.com/Kohulan/DECIMER-Image_Transformer.git
84
- ```
85
-
86
- Install in development mode with:
87
- ```shell
88
- $ git clone https://github.com/Kohulan/DECIMER-Image_Transformer.git decimer
89
- $ cd decimer/
90
- $ pip install -e.
91
- ```
92
- - Where `-e` means "editable" mode.
93
-
94
- Install from PyPi
95
- ```shell
96
- $ pip install decimer
97
- ```
98
- ### How to use inside your own python script
99
- ```python
100
- from DECIMER import predict_SMILES
101
-
102
- # Chemical depiction to SMILES translation
103
- image_path = "path/to/imagefile"
104
- SMILES = predict_SMILES(image_path)
105
- print(SMILES)
106
- ```
107
-
108
- ### Install tensorflow == 2.10.1 if you do not have an Nvidia GPU (On Mac OS)
109
-
110
- ## License:
111
- - This project is licensed under the MIT License - see the [LICENSE](https://raw.githubusercontent.com/Kohulan/DECIMER-Image_Transformer/master/LICENSE?token=AHKLIF3EULMCUKCFUHIPBMDARSMDO) file for details
112
-
113
- ## Citation
114
- - Rajan K, Brinkhaus HO, Agea MI, Zielesny A, Steinbeck C DECIMER.ai - An open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications. Nat. Commun. 14, 5045 (2023). https://doi.org/10.1038/s41467-023-40782-0
115
- - Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER 1.0: deep learning for chemical image recognition using transformers. J Cheminform 13, 61 (2021). https://doi.org/10.1186/s13321-021-00538-8
116
-
117
- ## References
118
-
119
- 1. Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER: towards deep learning for chemical image recognition. J Cheminform 12, 65 (2020). https://doi.org/10.1186/s13321-020-00469-w
120
- 2. Norrie T, Patil N, Yoon DH, Kurian G, Li S, Laudon J, Young C, Jouppi N, Patterson D (2021) The Design Process for Google's Training Chips: TPUv2 and TPUv3. IEEE Micro 41:56–63
121
- 3. Tan M, Le QV (2021) EfficientNetV2: Smaller Models and Faster Training. arXiv [cs.CV]
122
- 4. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser L, Polosukhin I (2017) Attention Is All You Need. arXiv [cs.CL]
123
- 5. Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER 1.0: deep learning for chemical image recognition using transformers. J Cheminform 13, 61 (2021). https://doi.org/10.1186/s13321-021-00538-8
124
-
125
- ## Acknowledgement
126
- - We thank [Charles Tapley Hoyt](https://github.com/cthoyt) for his valuable advice and help in improving the DECIMER repository.
127
- - Research supported with Cloud TPUs from Google's TPU Research Cloud (TRC)
128
-
129
- <p align="center">
130
- <img src="https://user-images.githubusercontent.com/30716951/220350828-913e6645-6a0a-403c-bcb8-160d061d4606.png" width="500" class="center">
131
- </p>
132
-
133
- ## Author: [Kohulan](https://kohulanr.com)
134
-
135
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image-to-SMILES/raw/master/assets/DECIMER.gif)](https://decimer.ai)
136
-
137
- ## Project Website:
138
-
139
- - A web application implementation is available at [decimer.ai](https://decimer.ai), implemented by [Otto Brinkhaus](https://github.com/OBrink)
140
-
141
-
142
- ## Research Group
143
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png)](https://cheminf.uni-jena.de)
144
-
145
- ![Alt](https://repobeats.axiom.co/api/embed/bf532b7ac0d34137bdea8fbb82986828f86de065.svg "Repobeats analytics image")
decimer-2.7.0/README.md DELETED
@@ -1,121 +0,0 @@
1
- # ***DECIMER Image Transformer***: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
2
-
3
- [![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://opensource.org/licenses/MIT)
4
- [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-blue.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/commit-activity)
5
- [![GitHub issues](https://img.shields.io/github/issues/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/issues/)
6
- [![GitHub contributors](https://img.shields.io/github/contributors/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/contributors/)
7
- [![tensorflow](https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=flat&logo=tensorflow)](https://www.tensorflow.org)
8
- [![DOI](https://zenodo.org/badge/293572361.svg)](https://zenodo.org/badge/latestdoi/293572361)
9
- [![Documentation Status](https://readthedocs.org/projects/decimer-image-transformer/badge/?version=latest)](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
10
- [![GitHub release](https://img.shields.io/github/release/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/releases/)
11
- [![PyPI version fury.io](https://badge.fury.io/py/decimer.svg)](https://pypi.python.org/pypi/decimer/)
12
-
13
- ## Abstract
14
-
15
- The DECIMER 2.2 [5] (Deep lEarning for Chemical ImagE Recognition) project [1] was launched to address the OCSR problem with the latest computational intelligence methods to provide an automated open-source software solution.
16
-
17
- The original implementation of DECIMER[1] using GPU takes a longer training time when we use a bigger dataset of more than 1 million images. To overcome these longer training times, many implement the training script to work on multiple GPUs. However, we tried to step up and implemented our code to use Google's Machine Learning hardware [TPU(Tensor Processing Unit)](https://en.wikipedia.org/wiki/Tensor_Processing_Unit) [2]. You can learn more about the hardware [here](https://en.wikipedia.org/wiki/Tensor_Processing_Unit).
18
-
19
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image_Transformer/blob/master/DECIMER_V2.png?raw=true)](https://github.com/Kohulan/DECIMER-Image_Transformer)
20
-
21
- ## Method and model changes
22
- - The DECIMER now uses EfficientNet-V2[3] for Image feature extraction and a transformer model [4] for predicting the SMILES.
23
- - The SMILES used during training and predictions
24
-
25
- ### Changes in the training method
26
-
27
- - We converted our datasets into [TFRecord](https://www.tensorflow.org/tutorials/load_data/tfrecord) Files, A binary file system the TPUs can read in a much faster way. Also, we can use these files to train on GPUs. Using the TFRecord helps us train the model fast by overcoming the bottleneck of reading multiple files from the hard disks.
28
- - We moved our data to [Google Cloud Buckets](https://cloud.google.com/storage/docs/json_api/v1/buckets). An efficient storage solution provided by the google cloud environment where we can access these files from any google cloud VMs easily and in a much faster way. (To get the highest speed, the cloud storage and the VM should be in the same region)
29
- - We adopted the TensorFlow data pipeline to load all TFRecord files to the TPUs from Google Cloud Buckets.
30
- - We modified the main training code to work on TPUs using [TPU strategy](https://www.tensorflow.org/api_docs/python/tf/distribute/TPUStrategy) introduced in Tensorflow 2.0.
31
-
32
- ## How to use DECIMER?
33
- - Python package [Documentation](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
34
- - Model library could be found here: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7624994.svg)](https://zenodo.org/record/7624994)
35
-
36
- ### We suggest using DECIMER inside a Conda environment, which makes the dependencies install easily.
37
- - Conda can be downloaded as part of the [Anaconda](https://www.anaconda.com/) or the [Miniconda](https://conda.io/en/latest/miniconda.html) platforms (Python 3.7). We recommend installing miniconda3. Using Linux, you can get it with:
38
- ```
39
- $ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
40
- $ bash Miniconda3-latest-Linux-x86_64.sh
41
- ```
42
-
43
- ### Instructions
44
-
45
- ### Python Package Installation
46
-
47
- #### Use a conda environment for clean installation
48
- ```shell
49
- $ sudo apt update
50
- $ sudo apt install unzip
51
- $ conda create --name DECIMER python=3.10.0
52
- $ conda activate DECIMER
53
- $ conda install pip
54
- $ python3 -m pip install -U pip
55
- ```
56
-
57
- Install the latest code from GitHub with:
58
- ```shell
59
- $ pip install git+https://github.com/Kohulan/DECIMER-Image_Transformer.git
60
- ```
61
-
62
- Install in development mode with:
63
- ```shell
64
- $ git clone https://github.com/Kohulan/DECIMER-Image_Transformer.git decimer
65
- $ cd decimer/
66
- $ pip install -e.
67
- ```
68
- - Where `-e` means "editable" mode.
69
-
70
- Install from PyPi
71
- ```shell
72
- $ pip install decimer
73
- ```
74
- ### How to use inside your own python script
75
- ```python
76
- from DECIMER import predict_SMILES
77
-
78
- # Chemical depiction to SMILES translation
79
- image_path = "path/to/imagefile"
80
- SMILES = predict_SMILES(image_path)
81
- print(SMILES)
82
- ```
83
-
84
- ### Install tensorflow == 2.10.1 if you do not have an Nvidia GPU (On Mac OS)
85
-
86
- ## License:
87
- - This project is licensed under the MIT License - see the [LICENSE](https://raw.githubusercontent.com/Kohulan/DECIMER-Image_Transformer/master/LICENSE?token=AHKLIF3EULMCUKCFUHIPBMDARSMDO) file for details
88
-
89
- ## Citation
90
- - Rajan K, Brinkhaus HO, Agea MI, Zielesny A, Steinbeck C DECIMER.ai - An open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications. Nat. Commun. 14, 5045 (2023). https://doi.org/10.1038/s41467-023-40782-0
91
- - Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER 1.0: deep learning for chemical image recognition using transformers. J Cheminform 13, 61 (2021). https://doi.org/10.1186/s13321-021-00538-8
92
-
93
- ## References
94
-
95
- 1. Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER: towards deep learning for chemical image recognition. J Cheminform 12, 65 (2020). https://doi.org/10.1186/s13321-020-00469-w
96
- 2. Norrie T, Patil N, Yoon DH, Kurian G, Li S, Laudon J, Young C, Jouppi N, Patterson D (2021) The Design Process for Google's Training Chips: TPUv2 and TPUv3. IEEE Micro 41:56–63
97
- 3. Tan M, Le QV (2021) EfficientNetV2: Smaller Models and Faster Training. arXiv [cs.CV]
98
- 4. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser L, Polosukhin I (2017) Attention Is All You Need. arXiv [cs.CL]
99
- 5. Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER 1.0: deep learning for chemical image recognition using transformers. J Cheminform 13, 61 (2021). https://doi.org/10.1186/s13321-021-00538-8
100
-
101
- ## Acknowledgement
102
- - We thank [Charles Tapley Hoyt](https://github.com/cthoyt) for his valuable advice and help in improving the DECIMER repository.
103
- - Research supported with Cloud TPUs from Google's TPU Research Cloud (TRC)
104
-
105
- <p align="center">
106
- <img src="https://user-images.githubusercontent.com/30716951/220350828-913e6645-6a0a-403c-bcb8-160d061d4606.png" width="500" class="center">
107
- </p>
108
-
109
- ## Author: [Kohulan](https://kohulanr.com)
110
-
111
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image-to-SMILES/raw/master/assets/DECIMER.gif)](https://decimer.ai)
112
-
113
- ## Project Website:
114
-
115
- - A web application implementation is available at [decimer.ai](https://decimer.ai), implemented by [Otto Brinkhaus](https://github.com/OBrink)
116
-
117
-
118
- ## Research Group
119
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png)](https://cheminf.uni-jena.de)
120
-
121
- ![Alt](https://repobeats.axiom.co/api/embed/bf532b7ac0d34137bdea8fbb82986828f86de065.svg "Repobeats analytics image")
@@ -1,145 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: decimer
3
- Version: 2.7.0
4
- Summary: DECIMER 2.6.0: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
5
- Home-page: https://github.com/Kohulan/DECIMER-Image_Transformer
6
- Author: Kohulan Rajan
7
- Author-email: kohulan.rajan@uni-jena.de
8
- Maintainer: Kohulan Rajan, Otto Brinkhaus
9
- Maintainer-email: kohulan.rajan@uni-jena.de, otto.brinkhaus@uni-jena.de
10
- License: MIT
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.5
13
- Classifier: Programming Language :: Python :: 3.6
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3 :: Only
19
- Classifier: License :: OSI Approved :: MIT License
20
- Classifier: Operating System :: OS Independent
21
- Requires-Python: >=3.5
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
-
25
- # ***DECIMER Image Transformer***: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
26
-
27
- [![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://opensource.org/licenses/MIT)
28
- [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-blue.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/commit-activity)
29
- [![GitHub issues](https://img.shields.io/github/issues/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/issues/)
30
- [![GitHub contributors](https://img.shields.io/github/contributors/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/graphs/contributors/)
31
- [![tensorflow](https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=flat&logo=tensorflow)](https://www.tensorflow.org)
32
- [![DOI](https://zenodo.org/badge/293572361.svg)](https://zenodo.org/badge/latestdoi/293572361)
33
- [![Documentation Status](https://readthedocs.org/projects/decimer-image-transformer/badge/?version=latest)](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
34
- [![GitHub release](https://img.shields.io/github/release/Kohulan/DECIMER-Image_Transformer.svg)](https://GitHub.com/Kohulan/DECIMER-Image_Transformer/releases/)
35
- [![PyPI version fury.io](https://badge.fury.io/py/decimer.svg)](https://pypi.python.org/pypi/decimer/)
36
-
37
- ## Abstract
38
-
39
- The DECIMER 2.2 [5] (Deep lEarning for Chemical ImagE Recognition) project [1] was launched to address the OCSR problem with the latest computational intelligence methods to provide an automated open-source software solution.
40
-
41
- The original implementation of DECIMER[1] using GPU takes a longer training time when we use a bigger dataset of more than 1 million images. To overcome these longer training times, many implement the training script to work on multiple GPUs. However, we tried to step up and implemented our code to use Google's Machine Learning hardware [TPU(Tensor Processing Unit)](https://en.wikipedia.org/wiki/Tensor_Processing_Unit) [2]. You can learn more about the hardware [here](https://en.wikipedia.org/wiki/Tensor_Processing_Unit).
42
-
43
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image_Transformer/blob/master/DECIMER_V2.png?raw=true)](https://github.com/Kohulan/DECIMER-Image_Transformer)
44
-
45
- ## Method and model changes
46
- - The DECIMER now uses EfficientNet-V2[3] for Image feature extraction and a transformer model [4] for predicting the SMILES.
47
- - The SMILES used during training and predictions
48
-
49
- ### Changes in the training method
50
-
51
- - We converted our datasets into [TFRecord](https://www.tensorflow.org/tutorials/load_data/tfrecord) Files, A binary file system the TPUs can read in a much faster way. Also, we can use these files to train on GPUs. Using the TFRecord helps us train the model fast by overcoming the bottleneck of reading multiple files from the hard disks.
52
- - We moved our data to [Google Cloud Buckets](https://cloud.google.com/storage/docs/json_api/v1/buckets). An efficient storage solution provided by the google cloud environment where we can access these files from any google cloud VMs easily and in a much faster way. (To get the highest speed, the cloud storage and the VM should be in the same region)
53
- - We adopted the TensorFlow data pipeline to load all TFRecord files to the TPUs from Google Cloud Buckets.
54
- - We modified the main training code to work on TPUs using [TPU strategy](https://www.tensorflow.org/api_docs/python/tf/distribute/TPUStrategy) introduced in Tensorflow 2.0.
55
-
56
- ## How to use DECIMER?
57
- - Python package [Documentation](https://decimer-image-transformer.readthedocs.io/en/latest/?badge=latest)
58
- - Model library could be found here: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7624994.svg)](https://zenodo.org/record/7624994)
59
-
60
- ### We suggest using DECIMER inside a Conda environment, which makes the dependencies install easily.
61
- - Conda can be downloaded as part of the [Anaconda](https://www.anaconda.com/) or the [Miniconda](https://conda.io/en/latest/miniconda.html) platforms (Python 3.7). We recommend installing miniconda3. Using Linux, you can get it with:
62
- ```
63
- $ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
64
- $ bash Miniconda3-latest-Linux-x86_64.sh
65
- ```
66
-
67
- ### Instructions
68
-
69
- ### Python Package Installation
70
-
71
- #### Use a conda environment for clean installation
72
- ```shell
73
- $ sudo apt update
74
- $ sudo apt install unzip
75
- $ conda create --name DECIMER python=3.10.0
76
- $ conda activate DECIMER
77
- $ conda install pip
78
- $ python3 -m pip install -U pip
79
- ```
80
-
81
- Install the latest code from GitHub with:
82
- ```shell
83
- $ pip install git+https://github.com/Kohulan/DECIMER-Image_Transformer.git
84
- ```
85
-
86
- Install in development mode with:
87
- ```shell
88
- $ git clone https://github.com/Kohulan/DECIMER-Image_Transformer.git decimer
89
- $ cd decimer/
90
- $ pip install -e.
91
- ```
92
- - Where `-e` means "editable" mode.
93
-
94
- Install from PyPi
95
- ```shell
96
- $ pip install decimer
97
- ```
98
- ### How to use inside your own python script
99
- ```python
100
- from DECIMER import predict_SMILES
101
-
102
- # Chemical depiction to SMILES translation
103
- image_path = "path/to/imagefile"
104
- SMILES = predict_SMILES(image_path)
105
- print(SMILES)
106
- ```
107
-
108
- ### Install tensorflow == 2.10.1 if you do not have an Nvidia GPU (On Mac OS)
109
-
110
- ## License:
111
- - This project is licensed under the MIT License - see the [LICENSE](https://raw.githubusercontent.com/Kohulan/DECIMER-Image_Transformer/master/LICENSE?token=AHKLIF3EULMCUKCFUHIPBMDARSMDO) file for details
112
-
113
- ## Citation
114
- - Rajan K, Brinkhaus HO, Agea MI, Zielesny A, Steinbeck C DECIMER.ai - An open platform for automated optical chemical structure identification, segmentation and recognition in scientific publications. Nat. Commun. 14, 5045 (2023). https://doi.org/10.1038/s41467-023-40782-0
115
- - Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER 1.0: deep learning for chemical image recognition using transformers. J Cheminform 13, 61 (2021). https://doi.org/10.1186/s13321-021-00538-8
116
-
117
- ## References
118
-
119
- 1. Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER: towards deep learning for chemical image recognition. J Cheminform 12, 65 (2020). https://doi.org/10.1186/s13321-020-00469-w
120
- 2. Norrie T, Patil N, Yoon DH, Kurian G, Li S, Laudon J, Young C, Jouppi N, Patterson D (2021) The Design Process for Google's Training Chips: TPUv2 and TPUv3. IEEE Micro 41:56–63
121
- 3. Tan M, Le QV (2021) EfficientNetV2: Smaller Models and Faster Training. arXiv [cs.CV]
122
- 4. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser L, Polosukhin I (2017) Attention Is All You Need. arXiv [cs.CL]
123
- 5. Rajan, K., Zielesny, A. & Steinbeck, C. DECIMER 1.0: deep learning for chemical image recognition using transformers. J Cheminform 13, 61 (2021). https://doi.org/10.1186/s13321-021-00538-8
124
-
125
- ## Acknowledgement
126
- - We thank [Charles Tapley Hoyt](https://github.com/cthoyt) for his valuable advice and help in improving the DECIMER repository.
127
- - Research supported with Cloud TPUs from Google's TPU Research Cloud (TRC)
128
-
129
- <p align="center">
130
- <img src="https://user-images.githubusercontent.com/30716951/220350828-913e6645-6a0a-403c-bcb8-160d061d4606.png" width="500" class="center">
131
- </p>
132
-
133
- ## Author: [Kohulan](https://kohulanr.com)
134
-
135
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image-to-SMILES/raw/master/assets/DECIMER.gif)](https://decimer.ai)
136
-
137
- ## Project Website:
138
-
139
- - A web application implementation is available at [decimer.ai](https://decimer.ai), implemented by [Otto Brinkhaus](https://github.com/OBrink)
140
-
141
-
142
- ## Research Group
143
- [![GitHub Logo](https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png)](https://cheminf.uni-jena.de)
144
-
145
- ![Alt](https://repobeats.axiom.co/api/embed/bf532b7ac0d34137bdea8fbb82986828f86de065.svg "Repobeats analytics image")
File without changes
File without changes
File without changes
File without changes
File without changes