From 16255ba8f084b64a0fc88b1fff3ea0f6ddb6faa6 Mon Sep 17 00:00:00 2001 From: Zerohertz Date: Thu, 23 Mar 2023 17:32:12 +0900 Subject: [PATCH] :tada: Add: Check Data --- checkData.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 checkData.py diff --git a/checkData.py b/checkData.py new file mode 100644 index 0000000..14ce083 --- /dev/null +++ b/checkData.py @@ -0,0 +1,48 @@ +import os + + +def checkData(target): + os.chdir(init + '/FlickrLogos-v2') + try: + os.chdir('images/' + target) + except: + print('경로가 없어용 ~') + + imgDir = os.getcwd() + img = os.listdir() + + labDir = imgDir.replace('images', 'labels') + lab = os.listdir() + + tmpi = [] + for i in img: + tmpi.append(i[:-4]) + + tmpj = [] + for i in lab: + tmpj.append(i[:-4]) + + for i in tmpi: + if not i in tmpj and not 'ipynb' in i: + print('NG: ', i) + + for i in tmpj: + if not i in tmpi and not 'ipynb' in i: + print('NG: ', i) + + print('='*20, target, '='*20) + print('Images: ', len(img)) + print('Ground Truth: ', len(lab)) + print('='*20, target, '='*20) + +if __name__ == "__main__": + os.chdir('..') + init = os.getcwd() + try: + os.chdir(init + '/FlickrLogos-v2') + except: + print('경로가 없어용 ~') + + checkData('train') + checkData('val') + checkData('test') \ No newline at end of file