File size: 594 Bytes
463f868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import glob
import os

import numpy as np

files = glob.glob("ai/data/*.npz")
print(f"{'Filename':50} | {'Size(MB)':>10} | {'Samples':>10}")
print("-" * 75)

for f in sorted(files):
    size = os.path.getsize(f) / (1024 * 1024)
    samples = "N/A"
    try:
        # Just check shape of 'states' to get sample count without loading everything
        with np.load(f) as data:
            if "states" in data.keys():
                samples = len(data["states"])
    except:
        samples = "CORRUPT"

    print(f"{os.path.basename(f):50} | {size:10.2f} | {samples:>10}")