diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2020-12-19 21:00:02 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2020-12-19 21:00:02 +0800 |
commit | d7975c6a9b3814aa09f8a9ad48647f741d097060 (patch) | |
tree | 70155b2b349cef16d52f2d37749b62f96fdffe63 /utils | |
parent | ca194fbc53207b7b1c93044bd5fc766f5b9fad75 (diff) |
Fix indexing error when no clip to be discard
Diffstat (limited to 'utils')
-rw-r--r-- | utils/dataset.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/dataset.py b/utils/dataset.py index fad94c0..63cffa5 100644 --- a/utils/dataset.py +++ b/utils/dataset.py @@ -103,8 +103,9 @@ class CASIAB(data.Dataset): if len(os.listdir(clip_path)) < self.discard_threshold: discard_clips_names.append(clip_name) clip_names.remove(clip_name) - print(', '.join(discard_clips_names[:-1]), - 'and', discard_clips_names[-1], 'will be discarded.') + if len(discard_clips_names) != 0: + print(', '.join(discard_clips_names[:-1]), + 'and', discard_clips_names[-1], 'will be discarded.') # clip name constructed by label, condition and view # e.g 002-bg-02-090 means clip from Subject #2 |