-
Notifications
You must be signed in to change notification settings - Fork 0
/
OR-610 Project_Draft 0.py
37 lines (22 loc) · 1.03 KB
/
OR-610 Project_Draft 0.py
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
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import shutil
import pandas as pd
train = os.path.join(os.path.expanduser('~'), 'Documents', 'Datasets','aptos2019-blindness-detection','train')
#test = os.path.join(os.path.expanduser('~'), 'Documents', 'Datasets','aptos2019-blindness-detection','test')
metaTrain = pd.read_csv(os.path.join(os.path.expanduser('~'), 'Documents', 'Datasets','aptos2019-blindness-detection','train.csv'))
#metaTest = pd.read_csv(os.path.join(os.path.expanduser('~'), 'Documents', 'Datasets','aptos2019-blindness-detection','test.csv'))
def mover(path, meta, className):
meta = meta.id_code[meta.diagnosis==className]
for i in meta:
if not os.path.exists(os.path.join(path,str(className))):
os.makedirs(os.path.join(path,str(className)))
shutil.move(os.path.join(path,str(i)+'.png'),
os.path.join(path,str(className),str(i)+'.png')
)
for i in range(5):
mover(train,metaTrain,i)
#mover(test,metaTest,i)
# In[ ]: