ThomasDelteil commented on a change in pull request #10537: [MX-307] Add .md 
tutorials to .ipynb for CI integration
URL: https://github.com/apache/incubator-mxnet/pull/10537#discussion_r181875579
 
 

 ##########
 File path: docs/tutorials/gluon/datasets.md
 ##########
 @@ -175,58 +180,51 @@ for epoch in range(epochs):
     print("Epoch {}, training loss: {:.2f}, validation loss: 
{:.2f}".format(epoch, train_loss, valid_loss))
 ```
 
-    Epoch 0, training loss: 0.54, validation loss: 0.45
-    Epoch 1, training loss: 0.40, validation loss: 0.39
-    Epoch 2, training loss: 0.36, validation loss: 0.39
-    Epoch 3, training loss: 0.33, validation loss: 0.34
-    Epoch 4, training loss: 0.32, validation loss: 0.33
+`Epoch 0, training loss: 0.54, validation loss: 0.45`<!--notebook-skip-line-->
+
+`...`<!--notebook-skip-line-->
+
+`Epoch 4, training loss: 0.32, validation loss: 0.33`<!--notebook-skip-line-->
 
 
 # Using own data with included `Dataset`s
 
 Gluon has a number of different 
[`Dataset`](https://mxnet.incubator.apache.org/api/python/gluon/data.html?highlight=dataset#mxnet.gluon.data.Dataset)
 classes for working with your own image data straight out-of-the-box. You can 
get started quickly using the 
[`mxnet.gluon.data.vision.datasets.ImageFolderDataset`](https://mxnet.incubator.apache.org/api/python/gluon/data.html?highlight=imagefolderdataset#mxnet.gluon.data.vision.datasets.ImageFolderDataset)
 which loads images directly from a user-defined folder, and infers the label 
(i.e. class) from the folders.
 
 We will run through an example for image classification, but a similar process 
applies for other vision tasks. If you already have your own collection of 
images to work with you should partition your data into training and test sets, 
and place all objects of the same class into seperate folders. Similar to:
-
+```
     ./images/train/car/abc.jpg
     ./images/train/car/efg.jpg
     ./images/train/bus/hij.jpg
     ./images/train/bus/klm.jpg
     ./images/test/car/xyz.jpg
     ./images/test/bus/uvw.jpg
+```
 
 You can download the Caltech 101 dataset if you don't already have images to 
work with for this example, but please note the download is 126MB.
 
 ```python
-!wget 
http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz
-!tar -xzf 101_ObjectCategories.tar.gz
+
+data_folder = "data"
+dataset_name = "101_ObjectCategories"
+archive_file = "{}.tar.gz".format(dataset_name)
+archive_path = os.path.join(data_folder, archive_file)
+data_url = "https://s3.us-east-2.amazonaws.com/mxnet-public/";
+
+if not os.path.isfile(archive_path):
+    mx.test_utils.download("{}{}".format(data_url, archive_file), dirname = 
data_folder)
+    print('Extracting {} in {}...'.format(archive_file, data_folder))
+    tar = tarfile.open(archive_path, "r:gz")
+    tar.extractall(data_folder)
+    tar.close()
+    print('Data extracted.')
 ```
 
-After downloading and extracting the data archive, we seperate the data into 
training and test sets (50:50 split), and place images of the same class into 
the same folders, as required for using 
[`ImageFolderDataset`](https://mxnet.incubator.apache.org/api/python/gluon/data.html?highlight=imagefolderdataset#mxnet.gluon.data.vision.datasets.ImageFolderDataset).
+After downloading and extracting the data archive, we have two folders: 
`data/101_ObjectCategories` and `data/101_ObjectCategories_test`. We load the 
data into a training and testing dataset  
[`ImageFolderDataset`](https://mxnet.incubator.apache.org/api/python/gluon/data.html?highlight=imagefolderdataset#mxnet.gluon.data.vision.datasets.ImageFolderDataset).
 
 Review comment:
   will update

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to