|
import csv |
|
|
|
downloadList = open("/home/limmireu/문서/csv/Download_labelFile.csv", "r", encoding="utf8") |
|
downloadList = csv.reader(downloadList) |
|
|
|
datasetSize = {"All": 0.0, "Training": 0.0, "Validation": 0.0} |
|
|
|
for row in downloadList: |
|
datasetFileInfo = row[0].split("_")[0] |
|
datasetFileSize = row[1].split(" ") |
|
|
|
sizeNum = datasetFileSize[0] |
|
sizeType = datasetFileSize[1] |
|
|
|
if datasetFileInfo[0] == "T": |
|
if sizeType == "KB": |
|
datasetSize["Training"] += float(sizeNum)/(1024**1) |
|
|
|
elif sizeType == "MB": |
|
datasetSize["Training"] += float(sizeNum)/(1024**2) |
|
|
|
elif sizeType == "GB": |
|
datasetSize["Training"] += float(sizeNum)/(1024**3) |
|
|
|
|
|
elif datasetFileInfo[0] == "V": |
|
if sizeType == "KB": |
|
datasetSize["Validation"] += float(sizeNum)/(1024**1) |
|
|
|
elif sizeType == "MB": |
|
datasetSize["Validation"] += float(sizeNum)/(1024**2) |
|
|
|
elif sizeType == "GB": |
|
datasetSize["Validation"] += float(sizeNum)/(1024**3) |
|
|
|
|
|
if sizeType == "KB": |
|
datasetSize["All"] += float(sizeNum)/(1024**1) |
|
|
|
elif sizeType == "MB": |
|
datasetSize["All"] += float(sizeNum)/(1024**2) |
|
|
|
elif sizeType == "GB": |
|
datasetSize["All"] += float(sizeNum)/(1024**3) |
|
|
|
print(datasetSize) |