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
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 550b9eee4292af32c2b7dc81ebc12560033aeae1ff9554fdea9e01865520eac4 |
|
MD5 | 4f79a823aa29ce9cfb3a2a6bc10f1c0a |
|
BLAKE2b-256 | c287ce5e3469096648690528c84a0815d196a7eab1c8a34a5386fc168dfe488e |
Close
Hashes for streamlit_image_viewer-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22bc488fd1dae337d0e62a30e686f48fa62b6939107772af480862d79a946285 |
|
MD5 | 2980f829b6add72930d92dc1091558b5 |
|
BLAKE2b-256 | 6594a68b4b69f4488847d0fb054c1b7ac7561cadacf66d40e1e03be844d8e18b |