Open ccasadei opened 3 years ago
Hi,
using TurboJpeg instead of cv2, I increased the dataset image reading speed from 80 images/sec to 126 images/sec on my pc.
Method: _convert_dataset_to_image_and_bboxes
_convert_dataset_to_image_and_bboxes
try: # image = cv2.imread(dataset[0]) # image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) with open(dataset[0], "rb") as f: image = self.jpgdecode.decode(f.read(), pixel_format=TJPF_RGB) except: return None, None
where self.jpgdecode is assigned once in __init__ constructor:
self.jpgdecode
__init__
... self.jpgdecode = turbojpeg.TurboJPEG() ...
Hi,
using TurboJpeg instead of cv2, I increased the dataset image reading speed from 80 images/sec to 126 images/sec on my pc.
Method:
_convert_dataset_to_image_and_bboxes
where
self.jpgdecode
is assigned once in__init__
constructor: