Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Increase YOLODataset speed #85

Open
ccasadei opened this issue Jun 1, 2021 · 0 comments
Open

Increase YOLODataset speed #85

ccasadei opened this issue Jun 1, 2021 · 0 comments

Comments

@ccasadei
Copy link

ccasadei commented Jun 1, 2021

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

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 = turbojpeg.TurboJPEG()
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants