Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import io
|
|
| 6 |
import rdkit
|
| 7 |
from rdkit import Chem
|
| 8 |
from rdkit.Chem import Draw
|
| 9 |
-
from utils import bbox_to_graph_with_charge
|
| 10 |
|
| 11 |
bond_labels = [13,14,15,16,17]
|
| 12 |
idx_to_labels = {0:'other',1:'C',2:'O',3:'N',4:'Cl',5:'Br',6:'S',7:'F',8:'B',
|
|
@@ -60,7 +60,7 @@ def predict(input_image):
|
|
| 60 |
predictions = session.run([output_name], {input_name: processed_image})
|
| 61 |
|
| 62 |
# 假设模型输出是SMILES字符串
|
| 63 |
-
output = predictions
|
| 64 |
atoms_df, bonds_list,charge_list =bbox_to_graph_with_charge(output, idx_to_labels=idx_to_labels,
|
| 65 |
bond_labels=bond_labels, result=[])
|
| 66 |
smiles,mol_rebuit=mol_from_graph_with_chiral(atoms_df, bonds_list,charge_list )
|
|
|
|
| 6 |
import rdkit
|
| 7 |
from rdkit import Chem
|
| 8 |
from rdkit.Chem import Draw
|
| 9 |
+
from utils import bbox_to_graph_with_charge, mol_from_graph_with_chiral
|
| 10 |
|
| 11 |
bond_labels = [13,14,15,16,17]
|
| 12 |
idx_to_labels = {0:'other',1:'C',2:'O',3:'N',4:'Cl',5:'Br',6:'S',7:'F',8:'B',
|
|
|
|
| 60 |
predictions = session.run([output_name], {input_name: processed_image})
|
| 61 |
|
| 62 |
# 假设模型输出是SMILES字符串
|
| 63 |
+
output = predictions # 根据实际模型输出格式调整
|
| 64 |
atoms_df, bonds_list,charge_list =bbox_to_graph_with_charge(output, idx_to_labels=idx_to_labels,
|
| 65 |
bond_labels=bond_labels, result=[])
|
| 66 |
smiles,mol_rebuit=mol_from_graph_with_chiral(atoms_df, bonds_list,charge_list )
|