Skip to content

Commit 895a02d

Browse files
authored
Fix typing for images (#25)
The top-level function didn't indicate you can pass other types.
1 parent a56ed63 commit 895a02d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

streamlit_image_comparison/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def pillow_local_file_to_base64(image: Image.Image, temp_dir: str):
149149
return base64_src
150150

151151
def image_comparison(
152-
img1: str,
153-
img2: str,
152+
img1: Union[Image.Image, str, np.ndarray],
153+
img2: Union[Image.Image, str, np.ndarray],
154154
label1: str = "1",
155155
label2: str = "2",
156156
width: int = 704,
@@ -164,10 +164,10 @@ def image_comparison(
164164
165165
Parameters
166166
----------
167-
img1: str
168-
Path to the first image.
169-
img2: str
170-
Path to the second image.
167+
img1: str, PIL Image, or numpy array
168+
Data for the first image.
169+
img2: str, PIL Image, or numpy array
170+
Data for the second image.
171171
label1: str, optional
172172
Label for the first image. Default is "1".
173173
label2: str, optional

0 commit comments

Comments
 (0)