check the number of images

This commit is contained in:
xiaoke@ivgsz_171 2023-02-07 16:01:43 +08:00
parent a308bfee18
commit 31f3b2022e

View File

@ -42,6 +42,10 @@ def get_allname(root0, subs, ranges, root, ext, **kwargs):
else: else:
_ranges = ranges _ranges = ranges
nv = subs.index(sub) 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)): for nnf, nf in enumerate(range(*_ranges)):
image_names.append({ image_names.append({
'sub': sub, 'sub': sub,