From 0d4c20a8104a77f2f61f5ce0ac46c3a26d61b9c1 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Sat, 19 Dec 2020 21:16:19 +0800 Subject: 1. Delete unused transform function 2. Reorganize the initialization cache dicts --- utils/dataset.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/utils/dataset.py b/utils/dataset.py index 63cffa5..f41a9c5 100644 --- a/utils/dataset.py +++ b/utils/dataset.py @@ -14,10 +14,6 @@ ClipLabels = NewType('ClipLabels', Set[str]) ClipConditions = NewType('ClipConditions', Set[str]) ClipViews = NewType('ClipViews', Set[str]) -default_frame_transform = transforms.Compose([ - transforms.Resize(size=(64, 32)) -]) - class CASIAB(data.Dataset): """CASIA-B multi-view gait dataset""" @@ -89,6 +85,11 @@ class CASIAB(data.Dataset): # set of three attributes above self.metadata = Dict[str, Set[str]] + # Dictionaries for indexing frames and frame names by clip name + # and chip path when cache is on + self._cached_clips_frame_names: Optional[Dict[str, List[str]]] = None + self._cached_clips: Optional[Dict[str, torch.Tensor]] = None + clip_names = sorted(os.listdir(self.root_dir)) if self.is_train: @@ -166,8 +167,6 @@ class CASIAB(data.Dataset): 'views': set(self.views.tolist()) } - self._cached_clips_frame_names: Optional[Dict[str, List[str]]] = None - self._cached_clips: Optional[Dict[str, torch.Tensor]] = None if self.cache_on: self._cached_clips_frame_names = dict() self._cached_clips = dict() -- cgit v1.2.3