implementing app
Browse files
app.py
CHANGED
@@ -23,6 +23,7 @@ from pytorch_lightning.callbacks import LearningRateMonitor
|
|
23 |
from rdkit import Chem
|
24 |
from rdkit.Chem import AllChem
|
25 |
from rdkit import DataStructs
|
|
|
26 |
|
27 |
model_cls = RCNN
|
28 |
experiment_path_atoms="./models/atoms_model/"
|
@@ -32,5 +33,16 @@ dir_list.sort(key=os.path.getctime, reverse=True)
|
|
32 |
checkpoint_file_atoms = [f for f in dir_list if "ckpt" in f][0]
|
33 |
model_atom = model_cls.load_from_checkpoint(checkpoint_file_atoms)
|
34 |
model_atom.model.roi_heads.score_thresh = 0.65
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
x = st.slider('Select a value')
|
36 |
st.write(x, 'squared is', x * x)
|
|
|
23 |
from rdkit import Chem
|
24 |
from rdkit.Chem import AllChem
|
25 |
from rdkit import DataStructs
|
26 |
+
from PIL import Image
|
27 |
|
28 |
model_cls = RCNN
|
29 |
experiment_path_atoms="./models/atoms_model/"
|
|
|
33 |
checkpoint_file_atoms = [f for f in dir_list if "ckpt" in f][0]
|
34 |
model_atom = model_cls.load_from_checkpoint(checkpoint_file_atoms)
|
35 |
model_atom.model.roi_heads.score_thresh = 0.65
|
36 |
+
|
37 |
+
|
38 |
+
st.title("Atom Level Entity Detector")
|
39 |
+
|
40 |
+
file_name = st.file_uploader("Upload a chemical structure candidate image")
|
41 |
+
|
42 |
+
if file_name is not None:
|
43 |
+
col1, col2 = st.columns(2)
|
44 |
+
|
45 |
+
image = Image.open(file_name)
|
46 |
+
col1.image(image, use_column_width=True)
|
47 |
x = st.slider('Select a value')
|
48 |
st.write(x, 'squared is', x * x)
|