File size: 1,361 Bytes
f08eee8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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)