Spaces:
Sleeping
Sleeping
Download app.py from Pezh/zz: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/spaces/Pezh/zz/resolve/main/app.py
- Command line
-
hf download hf://spaces/Pezh/zz/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Pezh/zz/resolve/main/app.py
1.45 kB
| import streamlit as st | |
| from PIL import Image | |
| # Set the Streamlit layout | |
| st.set_page_config(layout="wide") | |
| # Title | |
| st.title("Medicmate.ir") | |
| # Text input for the description | |
| description = st.text_input('توصیف ضایعه و شرح حال بیمار وارد شود', | |
| placeholder='پاپول هایپرکراتوز چرب در نواحی سبورئیک به همراه ناهنجاری ناخن ها و تعداد زیادی پاپول کوچک در سقف دهان') | |
| # Custom CSS to style the file uploader button | |
| st.markdown(""" | |
| <style> | |
| [data-baseweb="file-uploader"] > div { | |
| background-color: red !important; | |
| color: white !important; | |
| } | |
| button[data-baseweb="button"] { | |
| background-color: red !important; | |
| color: white !important; | |
| } | |
| </style> | |
| """, unsafe_allow_html=True) | |
| # Add a key for the uploader to manage its state | |
| uploader_key = 'file_uploader' | |
| # Function to clear the uploaded file | |
| def clear_file(): | |
| del st.session_state[uploader_key] # This clears the file uploader widget | |
| # Check if the delete button is pressed | |
| if st.button('Delete'): | |
| clear_file() | |
| # File uploader with the key | |
| uploaded_file = st.file_uploader("Just Image", type=["jpg", "jpeg", "png"], key=uploader_key) | |
| # Display the image if available | |
| if uploaded_file is not None: | |
| image = Image.open(uploaded_file) | |
| st.image(image, caption='Uploaded Image.', use_column_width=True) | |
| # Other Streamlit app logic... |