thomas0809
commited on
Commit
•
a677d37
1
Parent(s):
c157f5a
change markdown
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def get_markdown(reaction):
|
|
23 |
s = ''
|
24 |
for ent in reaction[x]:
|
25 |
if 'smiles' in ent:
|
26 |
-
s += ent['smiles'] +
|
27 |
elif 'text' in ent:
|
28 |
s += ' '.join(ent['text']) + '<br>'
|
29 |
else:
|
@@ -46,11 +46,11 @@ with gr.Blocks() as demo:
|
|
46 |
Extract chemical reactions from a diagram. Please upload a reaction diagram, RxnScribe will predict the reaction structures in the diagram.
|
47 |
|
48 |
The predicted reactions are visualized in separate images.
|
49 |
-
<
|
50 |
-
<
|
51 |
-
<
|
52 |
|
53 |
-
It usually takes 10
|
54 |
Check the options to run [MolScribe](https://huggingface.co/spaces/yujieq/MolScribe) and [OCR](https://huggingface.co/spaces/tomofi/EasyOCR) (it will take a longer time, of course).
|
55 |
|
56 |
Code: https://github.com/thomas0809/RxnScribe
|
@@ -65,7 +65,7 @@ with gr.Blocks() as demo:
|
|
65 |
ocr = gr.Checkbox(label="Run OCR to recognize text")
|
66 |
btn = gr.Button("Submit").style(full_width=False)
|
67 |
with gr.Row():
|
68 |
-
gallery = gr.Image(label='Predicted reactions', show_label=True).style(height=
|
69 |
markdown = gr.Dataframe(
|
70 |
headers=['#', 'reactant', 'condition', 'product'],
|
71 |
datatype=['number'] + ['markdown'] * 3,
|
|
|
23 |
s = ''
|
24 |
for ent in reaction[x]:
|
25 |
if 'smiles' in ent:
|
26 |
+
s += "\n```\n" + ent['smiles'] + "\n```\n"
|
27 |
elif 'text' in ent:
|
28 |
s += ' '.join(ent['text']) + '<br>'
|
29 |
else:
|
|
|
46 |
Extract chemical reactions from a diagram. Please upload a reaction diagram, RxnScribe will predict the reaction structures in the diagram.
|
47 |
|
48 |
The predicted reactions are visualized in separate images.
|
49 |
+
<b style="color:red">Red boxes are <ins><em>reactants</em></ins>.</b>
|
50 |
+
<b style="color:green">Green boxes are <ins><em>reaction conditions</em></ins>.</b>
|
51 |
+
<b style="color:blue">Blue boxes are <ins><em>products</em></ins>.</b>
|
52 |
|
53 |
+
It usually takes 5-10 seconds to process a diagram with this demo.
|
54 |
Check the options to run [MolScribe](https://huggingface.co/spaces/yujieq/MolScribe) and [OCR](https://huggingface.co/spaces/tomofi/EasyOCR) (it will take a longer time, of course).
|
55 |
|
56 |
Code: https://github.com/thomas0809/RxnScribe
|
|
|
65 |
ocr = gr.Checkbox(label="Run OCR to recognize text")
|
66 |
btn = gr.Button("Submit").style(full_width=False)
|
67 |
with gr.Row():
|
68 |
+
gallery = gr.Image(label='Predicted reactions', show_label=True).style(height="auto")
|
69 |
markdown = gr.Dataframe(
|
70 |
headers=['#', 'reactant', 'condition', 'product'],
|
71 |
datatype=['number'] + ['markdown'] * 3,
|