This is an automated email from the ASF dual-hosted git repository. zhasheng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push: new 3761f2f Fallout from simplifying/fixing im2rec.py commandline boolean options. (#9652) 3761f2f is described below commit 3761f2f36e7e335f17e5c1dcbfe215de27f73fd5 Author: Pedro Larroy <928489+lar...@users.noreply.github.com> AuthorDate: Thu Feb 8 06:24:50 2018 +0100 Fallout from simplifying/fixing im2rec.py commandline boolean options. (#9652) Fix documentation referring to outdated usages of im2rec.py --- docs/faq/finetune.md | 4 ++-- docs/tutorials/basic/data.md | 4 ++-- docs/tutorials/basic/image_io.md | 4 ++-- docs/tutorials/vision/large_scale_classification.md | 4 ++-- example/image-classification/README.md | 2 +- tools/im2rec.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/faq/finetune.md b/docs/faq/finetune.md index 533c3ca..04244d1 100644 --- a/docs/faq/finetune.md +++ b/docs/faq/finetune.md @@ -61,8 +61,8 @@ for i in 256_ObjectCategories/*; do done done -python ~/mxnet/tools/im2rec.py --list True --recursive True caltech-256-60-train caltech_256_train_60/ -python ~/mxnet/tools/im2rec.py --list True --recursive True caltech-256-60-val 256_ObjectCategories/ +python ~/mxnet/tools/im2rec.py --list --recursive caltech-256-60-train caltech_256_train_60/ +python ~/mxnet/tools/im2rec.py --list --recursive caltech-256-60-val 256_ObjectCategories/ python ~/mxnet/tools/im2rec.py --resize 256 --quality 90 --num-thread 16 caltech-256-60-val 256_ObjectCategories/ python ~/mxnet/tools/im2rec.py --resize 256 --quality 90 --num-thread 16 caltech-256-60-train caltech_256_train_60/ ``` diff --git a/docs/tutorials/basic/data.md b/docs/tutorials/basic/data.md index 66479d5..1a88242 100644 --- a/docs/tutorials/basic/data.md +++ b/docs/tutorials/basic/data.md @@ -392,7 +392,7 @@ Now let's convert them into record io format using the `im2rec.py` utility scrip First, we need to make a list that contains all the image files and their categories: ```python -os.system('python %s/tools/im2rec.py --list=1 --recursive=1 --shuffle=1 --test-ratio=0.2 data/caltech data/101_ObjectCategories'%os.environ['MXNET_HOME']) +os.system('python %s/tools/im2rec.py --list --recursive --test-ratio=0.2 data/caltech data/101_ObjectCategories'%os.environ['MXNET_HOME']) ``` The resulting list file (./data/caltech_train.lst) is in the format `index\t(one or more label)\tpath`. In this case, there is only one label for each image but you can modify the list to add in more for multi-label training. @@ -401,7 +401,7 @@ Then we can use this list to create our record io file: ```python -os.system("python %s/tools/im2rec.py --num-thread=4 --pass-through=1 data/caltech data/101_ObjectCategories"%os.environ['MXNET_HOME']) +os.system("python %s/tools/im2rec.py --num-thread=4 --pass-through data/caltech data/101_ObjectCategories"%os.environ['MXNET_HOME']) ``` The record io files are now saved at here (./data) diff --git a/docs/tutorials/basic/image_io.md b/docs/tutorials/basic/image_io.md index e643425..8d60ee8 100644 --- a/docs/tutorials/basic/image_io.md +++ b/docs/tutorials/basic/image_io.md @@ -55,7 +55,7 @@ contains all the image files and their categories: ```python assert(MXNET_HOME != '/scratch/mxnet'), "Please update your MXNet location" -os.system('python %s/tools/im2rec.py --list=1 --recursive=1 --shuffle=1 --test-ratio=0.2 data/caltech data/101_ObjectCategories'%MXNET_HOME) +os.system('python %s/tools/im2rec.py --list --recursive --test-ratio=0.2 data/caltech data/101_ObjectCategories'%MXNET_HOME) ``` The resulting [list file](./data/caltech_train.lst) is in the format @@ -66,7 +66,7 @@ Then we can use this list to create our record io file: ```python -os.system("python %s/tools/im2rec.py --num-thread=4 --pass-through=1 data/caltech data/101_ObjectCategories"%MXNET_HOME) +os.system("python %s/tools/im2rec.py --num-thread=4 --pass-through data/caltech data/101_ObjectCategories"%MXNET_HOME) ``` The record io files are now saved in the "data" directory. diff --git a/docs/tutorials/vision/large_scale_classification.md b/docs/tutorials/vision/large_scale_classification.md index 17701e6..089f55b 100644 --- a/docs/tutorials/vision/large_scale_classification.md +++ b/docs/tutorials/vision/large_scale_classification.md @@ -105,7 +105,7 @@ To create the recordIO files, we first create a list of images we want in the re ``` mkdir -p train_meta -python ${MXNET}/tools/im2rec.py --list True --chunks 8 --recursive True \ +python ${MXNET}/tools/im2rec.py --list --chunks 8 --recursive \ train_meta/${NAME} ${ROOT} ``` @@ -127,7 +127,7 @@ We do similar preprocessing for the validation set. ``` mkdir -p val_meta -python ${MXNET}/tools/im2rec.py --list True --recursive True \ +python ${MXNET}/tools/im2rec.py --list --recursive \ val_meta/${NAME} ${VAL_ROOT} python ${MXNET}/tools/im2rec.py --resize 480 --quality 90 \ --num-thread 16 val_meta/${NAME} ${VAL_ROOT} diff --git a/example/image-classification/README.md b/example/image-classification/README.md index 2967605..d0ffa3f 100644 --- a/example/image-classification/README.md +++ b/example/image-classification/README.md @@ -68,7 +68,7 @@ We first prepare two `.lst` files, which consist of the labels and image paths can be used for generating `rec` files. ```bash -python tools/im2rec.py --list True --recursive True --train-ratio 0.95 mydata img_data +python tools/im2rec.py --list --recursive --train-ratio 0.95 mydata img_data ``` Then we generate the `.rec` files. We resize the images such that the short edge diff --git a/tools/im2rec.py b/tools/im2rec.py old mode 100644 new mode 100755 index 5547c53..ef3e3f3 --- a/tools/im2rec.py +++ b/tools/im2rec.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information @@ -15,7 +17,6 @@ # specific language governing permissions and limitations # under the License. -# -*- coding: utf-8 -*- from __future__ import print_function import os import sys @@ -229,7 +230,6 @@ def parse_args(): cgroup.add_argument('--no-shuffle', dest='shuffle', action='store_false', help='If this is passed, \ im2rec will not randomize the image order in <prefix>.lst') - rgroup = parser.add_argument_group('Options for creating database') rgroup.add_argument('--pass-through', action='store_true', help='whether to skip transformation and save image as is') -- To stop receiving notification emails like this one, please contact zhash...@apache.org.