From c4f301ded74b1f4c0dd1526a76ece9e8e26d2048 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Wed, 12 Jul 2017 10:34:59 +0800 Subject: [PATCH] Modify comments and fix code format. --- python/paddle/v2/dataset/voc_seg.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/python/paddle/v2/dataset/voc_seg.py b/python/paddle/v2/dataset/voc_seg.py index 9b79f726d23..595ab41cd80 100644 --- a/python/paddle/v2/dataset/voc_seg.py +++ b/python/paddle/v2/dataset/voc_seg.py @@ -13,7 +13,10 @@ # limitations under the License. """ Image dataset for segmentation. -The 2012 dataset contains images from 2008-2011 for which additional segmentations have been prepared. As in previous years the assignment to training/test sets has been maintained. The total number of images with segmentation has been increased from 7,062 to 9,993. +The 2012 dataset contains images from 2008-2011 for which additional +segmentations have been prepared. As in previous years the assignment +to training/test sets has been maintained. The total number of images +with segmentation has been increased from 7,062 to 9,993. """ import tarfile @@ -23,7 +26,9 @@ from paddle.v2.image import * __all__ = ['train', 'test', 'val'] -VOC_URL = 'http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar' +VOC_URL = 'http://host.robots.ox.ac.uk/pascal/VOC/voc2012/\ + VOCtrainval_11-May-2012.tar' + VOC_MD5 = '6cd6e144f989b92b3379bac3b3de84fd' SET_FILE = 'VOCdevkit/VOC2012/ImageSets/Segmentation/{}.txt' DATA_FILE = 'VOCdevkit/VOC2012/JPEGImages/{}.jpg' @@ -55,20 +60,20 @@ def reader_creator(filename, sub_name): def train(): """ - Create a train dataset reader containing 2913 images. + Create a train dataset reader containing 2913 images in HWC order. """ return reader_creator(download(VOC_URL, 'voc_seg', VOC_MD5), 'trainval') def test(): """ - Create a test dataset reader containing 1464 images. + Create a test dataset reader containing 1464 images in HWC order. """ return reader_creator(download(VOC_URL, 'voc_seg', VOC_MD5), 'train') def val(): """ - Create a val dataset reader containing 1449 images. + Create a val dataset reader containing 1449 images in HWC order. """ return reader_creator(download(VOC_URL, 'voc_seg', VOC_MD5), 'val') -- GitLab