-
Notifications
You must be signed in to change notification settings - Fork 1
/
filt19_new_add.py
48 lines (28 loc) · 913 Bytes
/
filt19_new_add.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 21:43:15 2020
add ISIC19 images exclude pos = 'oral/genital'
@author: cmj
"""
import os
import pandas as pd
from tqdm import tqdm
import os.path as osp
import shutil
fn_ISIC18_gt = '../data/ISIC18/task3/ISIC2018_Task3_Training_GroundTruth.csv'
fn_ISIC19_meta ='../data/ISIC19/ISIC_2019_Training_Metadata.csv'
path_im = '../data/ISIC19/ISIC_2019_Training_Input'
path_tar = '../data_19a'
os.makedirs(path_tar,exist_ok = True)
df = pd.read_csv(fn_ISIC18_gt)
datas18 = df.values
df = pd.read_csv(fn_ISIC19_meta)
datas_meta = df.values
#idx = np.where(datas_meta[:,2] == 'palms/soles')[0]
fids = datas_meta[:,0]
idx_cols = []
for meta in tqdm(datas_meta):
fn = meta[0]
pos = meta[2]
if pos!='oral/genital' and fn not in datas18[:,0]:
shutil.copyfile(osp.join(path_im, fn + '.jpg'), osp.join(path_tar, fn + '.jpg'))