From 41b326db5db2e965bac74b96e786dcc87beeff41 Mon Sep 17 00:00:00 2001 From: Ed Murphy Date: Mon, 6 Mar 2023 12:09:07 -0800 Subject: [PATCH] Add back in the code that saves the 16bit grayscale png (#1106) --- donkeycar/parts/tub_v2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/donkeycar/parts/tub_v2.py b/donkeycar/parts/tub_v2.py index bb88753b2..07c2faefc 100644 --- a/donkeycar/parts/tub_v2.py +++ b/donkeycar/parts/tub_v2.py @@ -63,6 +63,13 @@ def write_record(self, record=None): image_path = os.path.join(self.images_base_path, name) image.save(image_path) contents[key] = name + elif input_type == 'gray16_array': + # save np.uint16 as a 16bit png + image = Image.fromarray(np.uint16(value)) + name = Tub._image_file_name(self.manifest.current_index, key, ext='.png') + image_path = os.path.join(self.images_base_path, name) + image.save(image_path) + contents[key]=name # Private properties contents['_timestamp_ms'] = int(round(time.time() * 1000))