Skip to content

Commit d5476a7

Browse files
committed
allow for alpha
1 parent ef50583 commit d5476a7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bioencoder/scripts/inference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def inference(
109109
if isinstance(image, str):
110110
if not os.path.isfile(image):
111111
raise FileNotFoundError(f"File does not exist: {image}")
112-
image = np.asarray(Image.open(image))
112+
image = Image.open(image).convert("RGB")
113+
image = np.asarray(image)
113114
elif not isinstance(image, (np.ndarray, np.generic)):
114115
raise TypeError("Input must be either an image path (str) or a NumPy array.")
115116

0 commit comments

Comments
 (0)