Last active
September 9, 2023 06:06
-
-
Save serihiro/7878efa8b148ce2c76000f5f9fed491c to your computer and use it in GitHub Desktop.
A shell script to count the total size and counts of ImageNet training dataset. For busy people; 1,281,167 images / 146,999,143,316 Byte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_DIR="/path/to/imagenet/train" | |
ALL_DIRS=`ls $BASE_DIR | grep -v .tar | grep -v .sh` | |
total_size=0 | |
total_count=0 | |
for dir in $ALL_DIRS | |
do | |
target_dir="${BASE_DIR}/${dir}" | |
tmp_size=`du --bytes "${target_dir}" | awk '{print $1}'` | |
total_size=$(($total_size+$tmp_size)) | |
tmp_count=`ls "${target_dir}" | wc -l` | |
total_count=$(($total_count+$tmp_count)) | |
done | |
echo $total_size | |
echo $total_count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment