improving layout
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import numpy as np
|
|
8 |
from AtomLenz import *
|
9 |
#from utils_graph import *
|
10 |
from Object_Smiles import Objects_Smiles
|
11 |
-
|
12 |
#from robust_detection import wandb_config
|
13 |
from robust_detection import utils
|
14 |
from robust_detection.models.rcnn import RCNN
|
@@ -198,8 +198,16 @@ def atomlenz(modelfile):
|
|
198 |
predictions_list.append([image_idx,pred_smiles,problematic])
|
199 |
file_preds = open('preds_atomlenz','w')
|
200 |
for pred in predictions_list:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
print(pred)
|
202 |
|
|
|
203 |
#### TRYOUT MENU #####
|
204 |
|
205 |
page_to_funcs = {
|
|
|
8 |
from AtomLenz import *
|
9 |
#from utils_graph import *
|
10 |
from Object_Smiles import Objects_Smiles
|
11 |
+
from rdkit import Chem
|
12 |
#from robust_detection import wandb_config
|
13 |
from robust_detection import utils
|
14 |
from robust_detection.models.rcnn import RCNN
|
|
|
198 |
predictions_list.append([image_idx,pred_smiles,problematic])
|
199 |
file_preds = open('preds_atomlenz','w')
|
200 |
for pred in predictions_list:
|
201 |
+
smiles = pred[1]
|
202 |
+
m = Chem.MolFromSmiles(smiles)
|
203 |
+
if m is None:
|
204 |
+
st.write("No valid chemical structure recognized")
|
205 |
+
else:
|
206 |
+
img = Chem.Draw.MolToImage(m)
|
207 |
+
st.image(img, caption=f"{smiles}", use_column_width=True)
|
208 |
print(pred)
|
209 |
|
210 |
+
|
211 |
#### TRYOUT MENU #####
|
212 |
|
213 |
page_to_funcs = {
|