From 31f3b2022e795f0ada3b4387011b9caaa2714e6f Mon Sep 17 00:00:00 2001 From: "xiaoke@ivgsz_171" Date: Tue, 7 Feb 2023 16:01:43 +0800 Subject: [PATCH] check the number of images --- easymocap/datasets/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/easymocap/datasets/base.py b/easymocap/datasets/base.py index c788451..0885c71 100644 --- a/easymocap/datasets/base.py +++ b/easymocap/datasets/base.py @@ -42,6 +42,10 @@ def get_allname(root0, subs, ranges, root, ext, **kwargs): else: _ranges = ranges nv = subs.index(sub) + + if len(imgnames) < _ranges[1]: + raise ValueError('The number of images in {} is less than the range: {} vs {}'.format(join(root0, root, sub), len(imgnames), _ranges[1])) + for nnf, nf in enumerate(range(*_ranges)): image_names.append({ 'sub': sub,