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")
API
image_viewer(
image_path_list: List[str],
ncol: int = 2,
nrow: int = 2,
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.
- 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/9/20 Release version 0.1.6
- 2023/9/22 Release version 0.1.8
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.1.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a2c9f15c2d73ac8151e868db61675fcf70fb11662d0c86abd5a7cd804315e63 |
|
MD5 | 0fa744c3a82657347ef373269aa62445 |
|
BLAKE2b-256 | 9e5b8466897152bd094fb9fb9ae42046985d75f0ecb2e00b1fb093f46e1b9c81 |
Close
Hashes for streamlit_image_viewer-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7ca3e482ece4d0b359aa453aa7b32fcf80f90aa70ee99509de9b04293eef1f9 |
|
MD5 | 4fe18f12b41bd4e0b7d0cdfc3ccdc4b1 |
|
BLAKE2b-256 | 00bd35e429f2676755d21d428438540bf4658afedb56eec41770f0ae4fe3d365 |