|
|
|
|
|
|
|
|
cache, exists = self.cache_labels(cache_path, prefix), False # cache |
|
|
cache, exists = self.cache_labels(cache_path, prefix), False # cache |
|
|
|
|
|
|
|
|
# Display cache |
|
|
# Display cache |
|
|
nf, nm, ne, nc, n = cache.pop('results') # found, missing, empty, corrupted, total |
|
|
|
|
|
|
|
|
nf, nm, ne, nc, n = cache.pop('results') # found, missing, empty, corrupt, total |
|
|
if exists: |
|
|
if exists: |
|
|
d = f"Scanning '{cache_path}' images and labels... {nf} found, {nm} missing, {ne} empty, {nc} corrupted" |
|
|
|
|
|
|
|
|
d = f"Scanning '{cache_path}' images and labels... {nf} found, {nm} missing, {ne} empty, {nc} corrupt" |
|
|
tqdm(None, desc=prefix + d, total=n, initial=n) # display cache results |
|
|
tqdm(None, desc=prefix + d, total=n, initial=n) # display cache results |
|
|
if cache['msgs']: |
|
|
if cache['msgs']: |
|
|
LOGGER.info('\n'.join(cache['msgs'])) # display warnings |
|
|
LOGGER.info('\n'.join(cache['msgs'])) # display warnings |
|
|
|
|
|
|
|
|
x[im_file] = [l, shape, segments] |
|
|
x[im_file] = [l, shape, segments] |
|
|
if msg: |
|
|
if msg: |
|
|
msgs.append(msg) |
|
|
msgs.append(msg) |
|
|
pbar.desc = f"{desc}{nf} found, {nm} missing, {ne} empty, {nc} corrupted" |
|
|
|
|
|
|
|
|
pbar.desc = f"{desc}{nf} found, {nm} missing, {ne} empty, {nc} corrupt" |
|
|
|
|
|
|
|
|
pbar.close() |
|
|
pbar.close() |
|
|
if msgs: |
|
|
if msgs: |