Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 20, 2024
1 parent e94bd7f commit 1f5893b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
4 changes: 3 additions & 1 deletion app/Home.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
treat_data,
)

st.set_page_config(page_title="Vision AI - Rio", layout="wide", initial_sidebar_state="collapsed")
st.set_page_config(
page_title="Vision AI - Rio", layout="wide", initial_sidebar_state="collapsed"
)
# st.image("./data/logo/logo.png", width=300)

DEFAULT_OBJECT = "nível da água"
Expand Down
6 changes: 5 additions & 1 deletion app/pages/Classificador de Labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import streamlit as st
from utils.utils import explode_df, get_objects_cache, get_objetcs_labels_df

st.set_page_config(page_title="Classificador de Labels", layout="wide", initial_sidebar_state="collapsed")
st.set_page_config(
page_title="Classificador de Labels",
layout="wide",
initial_sidebar_state="collapsed",
)
# st.image("./data/logo/logo.png", width=300)

st.markdown("# Classificador de labels | Vision AI")
Expand Down
4 changes: 3 additions & 1 deletion app/pages/Visualizar Prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
get_prompts_cache,
)

st.set_page_config(page_title="Visualizar Prompt", layout="wide", initial_sidebar_state="collapsed")
st.set_page_config(
page_title="Visualizar Prompt", layout="wide", initial_sidebar_state="collapsed"
)
# st.image("./data/logo/logo.png", width=300)

st.markdown("# Visualizar Prompt | Vision AI")
Expand Down
21 changes: 12 additions & 9 deletions app/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,11 @@ def display_camera_details(row, cameras_identifications):
columns=rename_columns
) # noqa


# make a markdown with the first row of the dataframe and the first value of "Data Identificação"
first_row = camera_identifications.iloc[0]
markdown = f'<p><strong>Data Identificação:</strong> {first_row["Data Identificação"]}</p>'
markdown = (
f'<p><strong>Data Identificação:</strong> {first_row["Data Identificação"]}</p>'
)
st.markdown(markdown, unsafe_allow_html=True)
i = 0
markdown = ""
Expand All @@ -471,36 +472,36 @@ def display_camera_details(row, cameras_identifications):

# if i is even and not the last row
if i % 2 == 0 and i != len(camera_identifications) - 1:
markdown += (f"""
markdown += f"""
<div style="display: flex; margin-bottom: 10px;">
<div style="flex: 1; border: 3px solid #ccc; border-radius: 5px; padding: 10px; margin-right: 10px;">
<p><strong>{identificador}</strong></p>
<p><strong>{classificacao}</strong></p>
<p><strong>Descrição:</strong> {row["Descrição"]}</p>
</div>""")
</div>"""
# if it is the last row, make it complete the row
elif i == len(camera_identifications) - 1:
markdown += (f"""
markdown += f"""
<div style="flex: 1; border: 3px solid #ccc; border-radius: 5px; padding: 10px; margin-right: 10px;">
<p><strong>{identificador}</strong></p>
<p><strong>{classificacao}</strong></p>
<p><strong>Descrição:</strong> {row["Descrição"]}</p>
</div>
</div> <!-- Close the row here -->
""")
"""
st.markdown(markdown, unsafe_allow_html=True)
markdown = ""
else:
markdown += (f"""
markdown += f"""
<div style="flex: 1; border: 3px solid #ccc; border-radius: 5px; padding: 10px; margin-right: 10px;">
<p><strong>{identificador}</strong></p>
<p><strong>{classificacao}</strong></p>
<p><strong>Descrição:</strong> {row["Descrição"]}</p>
</div>
</div> <!-- Close the row here -->
""")
"""
st.markdown(markdown, unsafe_allow_html=True)
markdown = ""
markdown = ""
i += 1


Expand Down Expand Up @@ -595,6 +596,7 @@ def create_order_column(table):

return table


def translate_back_to_english(label):
tradutor = {
"image_corrupted": "imagem corrompida",
Expand Down Expand Up @@ -623,6 +625,7 @@ def translate_back_to_english(label):
label = list(tradutor.keys())[list(tradutor.values()).index(label)]
return label


def classify_label(label):
if label in [
"major",
Expand Down

0 comments on commit 1f5893b

Please sign in to comment.