Skip to content

Commit

Permalink
add example image etc
Browse files Browse the repository at this point in the history
  • Loading branch information
akochari committed Nov 12, 2024
1 parent 60d4dd4 commit 4e33a97
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
7 changes: 4 additions & 3 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

st.title("Predict SMILES encodings of chemical structure depictions in images")

intro = '''This application allows users to either [upload an image file](/SMILES_from_an_image_file) or [take a picture using their webcam](/SMILES_from_a_webcam_photo)
and get a prediction the chemical structure depicted in the image in SMILES notation.
The chemical structure depiction can be machine or hand drawn.
intro = '''This application allows users to either upload an image file or take a picture using their webcam
and get a prediction the chemical structure depicted in the image in SMILES notation. You can navigate using
__links in the sidebar to the left__. The chemical structure depiction can be machine or hand drawn. Note that
loading the pages or getting a prediction may sometimes take a while.
This application is using the [DECIMER Image Transformer](https://github.com/Kohulan/DECIMER-Image_Transformer) (MIT license)
model to make predictions (as implemented in the [DECIMER Python package](https://pypi.org/project/decimer/)). The DECIMER (Deep lEarning for Chemical ImagE Recognition) addresses the Optical Chemical Structure
Expand Down
8 changes: 8 additions & 0 deletions app/pages/01_SMILES_from_an_image_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

st.write("The image files are only stored in RAM memory and are removed as soon as you close or reload the page.")

with open("./test_predictions/example_structure_2.jpg", "rb") as file:
btn = st.download_button(
label="Download an example image",
data=file,
file_name="example_structure.jpg",
mime="image/jpg",
)

st.subheader("Step 1. Upload a file", divider="gray")

# Input widget for users to upload image files from their computer
Expand Down
Binary file added app/test_predictions/example_structure_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4e33a97

Please sign in to comment.