Segmentation support & other enchancements (#40)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Ayush Chaurasia
2022-11-08 20:57:57 +05:30
committed by GitHub
parent c617ee1c79
commit f56c9bcc26
17 changed files with 1320 additions and 47 deletions

View File

@ -1,6 +1,7 @@
from itertools import repeat
from multiprocessing.pool import Pool
from pathlib import Path
from typing import OrderedDict
import torchvision
from tqdm import tqdm
@ -205,7 +206,7 @@ class ClassificationDataset(torchvision.datasets.ImageFolder):
sample = self.album_transforms(image=cv2.cvtColor(im, cv2.COLOR_BGR2RGB))["image"]
else:
sample = self.torch_transforms(im)
return sample, j
return OrderedDict(img=sample, cls=j)
# TODO: support semantic segmentation