Update app.py
Browse files
app.py
CHANGED
|
@@ -54,7 +54,10 @@ def predict(input_image):
|
|
| 54 |
predictions = session.run([output_name], {input_name: processed_image})
|
| 55 |
|
| 56 |
# 假设模型输出是SMILES字符串
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
# 使用RDKit生成分子结构图
|
| 60 |
mol_image = visualize_molecule(smiles)
|
|
|
|
| 54 |
predictions = session.run([output_name], {input_name: processed_image})
|
| 55 |
|
| 56 |
# 假设模型输出是SMILES字符串
|
| 57 |
+
output = predictions[0] # 根据实际模型输出格式调整
|
| 58 |
+
atoms_df, bonds_list,charge_list =bbox_to_graph_with_charge(output, idx_to_labels=idx_to_labels,
|
| 59 |
+
bond_labels=bond_labels, result=[])
|
| 60 |
+
smiles,mol_rebuit=mol_from_graph_with_chiral(atoms_df, bonds_list,charge_list )
|
| 61 |
|
| 62 |
# 使用RDKit生成分子结构图
|
| 63 |
mol_image = visualize_molecule(smiles)
|