streamlit components for image viewer
Project description
Streamlit Image Viewer
Streamlit component for image viewer.
Features
- You can easily view the images in a folder side by side
- Support for displaying images in multiple rows and columns
Install
pip install streamlit-image-viewer
Example Usage
from glob import glob
from streamlit_image_viewer import image_viewer
import streamlit as st
st.title("ImageViewer App")
st.title("Sample Images")
image_path_list = glob('../../image/*.jpg') + glob('../../image/*.png')
image_viewer(image_path_list, ncol=3, nrow=2, key="image_viewer")
Example App
cd streamlit_image_viewer/ImageViewer
streamlit run app.py
API
image_viewer(
image_path_list: List[str],
ncol: int = 2,
nrow: int = 2,
image_name_visible: bool = True
key: Optional[str] = None
)
- image_path_list : A list containing paths to the images to be displayed.
- ncol : The number of columns. Defaults to 2.
- nrow : The number of rows. Defaults to 2.
- image_name_visible : A boolean indicating whether image names are visible.
- key : A unique key for the component. Can be used to distinguish between different components.
NOTE
ncol
andnrow
should be positive integers; otherwise, a ValueError will be raised.
This function allows for the effective display of specified images in a grid layout with a customizable number of columns and rows. By default, a 2x2 grid is created, but you can adjust the column and row counts to suit your needs.
References
- Streamlit-Image-Annotation
- Streamlit Components Doc
- streamlit-template
- Sample Images are downloaded from Pixabay
Release note
- 2023/10/19 Release version 0.2.3 Now available for Multi-Page
- 2023/9/22 Release version 0.2.2 Add Modal Image and image name visible/invisible
- 2023/9/22 Release version 0.1.9
- 2023/9/20 Release version 0.1.6
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for streamlit_image_viewer-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad93a02193f46312c640fc5772979cdca79260c8ee9abaa75fd0cc79dc035690 |
|
MD5 | d0a4d28a5ac1d283f1515b38ff7d3a48 |
|
BLAKE2b-256 | 3fe63609ac1bc38c9bafd7d283050037890892152182d73ff26d1583f9c5cf73 |
Close
Hashes for streamlit_image_viewer-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fdab3691aaeecd28a48431c59cf0e9642d761d4f6fa61ff53183b45462c640a |
|
MD5 | 618daeca20c28de57661215e3adeef5f |
|
BLAKE2b-256 | a723b0fccb5fabd1c27481d11cfa9a6f3d6ddeda6083e1a6ef7b7f81619b839b |