@@ -28,6 +28,11 @@ class OxfordFlowers102(ImageList):
28
28
transformed version. E.g, :class:`torchvision.transforms.RandomCrop`.
29
29
target_transform (callable, optional): A function/transform that takes in the target and transforms it.
30
30
"""
31
+ download_list = [
32
+ ("image_list" , "image_list.zip" , "https://cloud.tsinghua.edu.cn/f/161c7b222d6745408201/?dl=1" ),
33
+ ("train" , "train.tgz" , "https://cloud.tsinghua.edu.cn/f/59b6a3fa3dac4404aa3b/?dl=1" ),
34
+ ("test" , "test.tgz" , "https://cloud.tsinghua.edu.cn/f/ec77da479dfb471982fb/?dl=1" )
35
+ ]
31
36
CLASSES = ['pink primrose' , 'hard-leaved pocket orchid' , 'canterbury bells' , 'sweet pea' , 'english marigold' ,
32
37
'tiger lily' , 'moon orchid' , 'bird of paradise' , 'monkshood' , 'globe thistle' , 'snapdragon' ,
33
38
"colt's foot" , 'king protea' , 'spear thistle' , 'yellow iris' , 'globe-flower' , 'purple coneflower' ,
@@ -45,10 +50,11 @@ class OxfordFlowers102(ImageList):
45
50
'hibiscus' , 'columbine' , 'desert-rose' , 'tree mallow' , 'magnolia' , 'cyclamen' , 'watercress' ,
46
51
'canna lily' , 'hippeastrum' , 'bee balm' , 'ball moss' , 'foxglove' , 'bougainvillea' , 'camellia' ,
47
52
'mallow' , 'mexican petunia' , 'bromelia' , 'blanket flower' , 'trumpet creeper' , 'blackberry lily' ]
53
+
48
54
def __init__ (self , root , split = 'train' , download = False , ** kwargs ):
49
55
if download :
50
- download_data (root , "oxford_flowers102" , "oxford_flowers102.tgz" , "https://cloud.tsinghua.edu.cn/f/61cb20241c1d43279d80/?dl=1" )
56
+ list ( map ( lambda args : download_data (root , * args ), self . download_list ) )
51
57
else :
52
- check_exits (root , "oxford_flowers102" )
53
- root = os . path . join (root , "oxford_flowers102" )
54
- super ( OxfordFlowers102 , self ). __init__ ( root , OxfordFlowers102 . CLASSES , os .path .join (root , 'imagelist ' , '{}.txt' .format (split )), ** kwargs )
58
+ list ( map ( lambda file_name , _ : check_exits (root , file_name ), self . download_list ) )
59
+ super ( OxfordFlowers102 , self ). __init__ (root , OxfordFlowers102 . CLASSES ,
60
+ os .path .join (root , 'image_list ' , '{}.txt' .format (split )), ** kwargs )
0 commit comments