rishabh-sat's picture
Upload walkability project (rest) (part 11)
7b0de7a verified
Raw History Blame Contribute Delete
491 Bytes
import sys, os
state, listfile, dest = sys.argv[1:4]
exp = {}
for line in open(listfile):
n, s = line.rstrip('\n').split('\t')
exp[n.replace('lcmcvpr2019/cvpr_chesapeake_landcover/', '')] = int(s)
bad = [n for n, s in exp.items() if not os.path.exists(os.path.join(dest, state, n)) or os.path.getsize(os.path.join(dest, state, n)) != s]
print(f"{state}: verified {len(exp)-len(bad)}/{len(exp)} files, {sum(exp.values())/1e9:.1f} GB, mismatched={len(bad)}")
sys.exit(1 if bad else 0)