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

Increase YOLODataset speed #85

@ccasadei

Description

@ccasadei

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()
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions