From 83919b1464ed3d0bc07191e7e30c3668d621a3fb Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Mon, 15 Jul 2019 13:38:19 +0200 Subject: [PATCH] Fixed opening of image Will need to be changed again if more than one trajectory is evaluated Signed-off-by: Jim Martens --- src/twomartens/masterthesis/debug.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/twomartens/masterthesis/debug.py b/src/twomartens/masterthesis/debug.py index bbbbd3d..981d2bb 100644 --- a/src/twomartens/masterthesis/debug.py +++ b/src/twomartens/masterthesis/debug.py @@ -63,9 +63,8 @@ def save_ssd_train_images(images: Union[np.ndarray, Sequence[str]], labels: np.n instances = labels[i] if type(train_image) is str: with Image.open(train_image) as _image: - image = _image - else: - image = Image.fromarray(train_image) + train_image = np.array(_image, dtype=np.uint8) + image = Image.fromarray(train_image) image.save(f"{output_path}/" f"{custom_string}train_image{str(i).zfill(nr_digits)}.png")