Skip to content

Commit

Permalink
fix: image path in whale viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
vancauwe committed Dec 19, 2024
1 parent a62a456 commit a874233
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/whale_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from PIL import Image
import pandas as pd
import os

WHALE_CLASSES = [
"beluga",
Expand Down Expand Up @@ -149,7 +150,9 @@ def display_whale(whale_classes:List[str], i:int, viewcontainer=None):
viewcontainer.markdown(
"### :whale: #" + str(i + 1) + ": " + format_whale_name(whale_classes[i])
)
image = Image.open("images/references/" + df_whale_img_ref.loc[whale_classes[i], "WHALE_IMAGES"])
current_dir = os.getcwd()
image_path = os.path.join(current_dir, "src/images/references/")
image = Image.open(image_path + df_whale_img_ref.loc[whale_classes[i], "WHALE_IMAGES"])

viewcontainer.image(image, caption=df_whale_img_ref.loc[whale_classes[i], "WHALE_REFERENCES"])
# link st.markdown(f"[{df.loc[whale_classes[i], 'WHALE_REFERENCES']}]({df.loc[whale_classes[i], 'WHALE_REFERENCES']})")

0 comments on commit a874233

Please sign in to comment.