Fix debug samples are not uploaded correctly (#924)

* PR relating to bug #923.
---------

Co-authored-by: jday1 <jd685@cam.ac.uk>
Co-authored-by: jday1 <james.day@bglgroup.co.uk>
This commit is contained in:
jday1 2023-02-19 07:19:40 +00:00 committed by GitHub
parent e938f2800b
commit 541c2425e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,11 +398,12 @@ class EventTrainsWriter(object):
with open(fd, "wb") as f:
f.write(imdata)
return temp_file
image = np.asarray(im)
output.close()
if height is not None and height > 0 and width is not None and width > 0:
val = np.array(im).reshape((height, width, -1)).astype(np.uint8)
val = image.reshape((height, width, -1)).astype(np.uint8)
else:
val = np.array(im).astype(np.uint8)
val = image.astype(np.uint8)
if val.ndim == 3 and val.shape[2] == 3:
if self._visualization_mode == 'BGR':
val = val[:, :, [2, 1, 0]]