From ce624b3adf5b880cb63b48d812abe2aa55163db4 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Mon, 17 Feb 2020 15:02:29 +0800 Subject: [PATCH] Fix master fruit (#238) * fix fruit config on master branch * refine doc --- configs/yolov3_mobilenet_v1_fruit.yml | 1 + dataset/fruit/label_list.txt | 3 +++ docs/tutorials/QUICK_STARTED.md | 13 ++++++------- docs/tutorials/QUICK_STARTED_cn.md | 15 +++++++-------- 4 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 dataset/fruit/label_list.txt diff --git a/configs/yolov3_mobilenet_v1_fruit.yml b/configs/yolov3_mobilenet_v1_fruit.yml index e89a600bb..def43e109 100644 --- a/configs/yolov3_mobilenet_v1_fruit.yml +++ b/configs/yolov3_mobilenet_v1_fruit.yml @@ -128,5 +128,6 @@ TestReader: batch_size: 1 dataset: !ImageFolder + anno_path: dataset/fruit/label_list.txt use_default_label: false with_background: false diff --git a/dataset/fruit/label_list.txt b/dataset/fruit/label_list.txt new file mode 100644 index 000000000..1f60d62c3 --- /dev/null +++ b/dataset/fruit/label_list.txt @@ -0,0 +1,3 @@ +apple +banana +orange diff --git a/docs/tutorials/QUICK_STARTED.md b/docs/tutorials/QUICK_STARTED.md index a8a4464a9..ac6eefabc 100644 --- a/docs/tutorials/QUICK_STARTED.md +++ b/docs/tutorials/QUICK_STARTED.md @@ -4,20 +4,19 @@ English | [简体中文](QUICK_STARTED_cn.md) This tutorial fine-tunes a tiny dataset by pretrained detection model for users to get a model and learn PaddleDetection quickly. The model can be trained in around 20min with good performance. -## Data Preparation - -Dataset refers to [Kaggle](https://www.kaggle.com/mbkinaci/fruit-images-for-object-detection), which contains 240 images in train dataset and 60 images in test dataset. Data categories are apple, orange and banana. Download [here](https://dataset.bj.bcebos.com/PaddleDetection_demo/fruit-detection.tar) and uncompress the dataset after download, script for data preparation is located at [download_fruit.py](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dataset/fruit/download_fruit.py). Command is as follows: +- **Note: before started, need to set PYTHONPATH and specifiy the GPU device as follows in Linux platform. For Windows users, also need to set PYTHONPATH correctly.** ```bash export PYTHONPATH=$PYTHONPATH:. -python dataset/fruit/download_fruit.py +export CUDA_VISIBLE_DEVICES=0 ``` -- **Note: before started, run the following command and specifiy the GPU** +## Data Preparation + +Dataset refers to [Kaggle](https://www.kaggle.com/mbkinaci/fruit-images-for-object-detection), which contains 240 images in train dataset and 60 images in test dataset. Data categories are apple, orange and banana. Download [here](https://dataset.bj.bcebos.com/PaddleDetection_demo/fruit-detection.tar) and uncompress the dataset after download, script for data preparation is located at [download_fruit.py](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dataset/fruit/download_fruit.py). Command is as follows: ```bash -export PYTHONPATH=$PYTHONPATH:. -export CUDA_VISIBLE_DEVICES=0 +python dataset/fruit/download_fruit.py ``` Training: diff --git a/docs/tutorials/QUICK_STARTED_cn.md b/docs/tutorials/QUICK_STARTED_cn.md index 99275e5f0..64756e08c 100644 --- a/docs/tutorials/QUICK_STARTED_cn.md +++ b/docs/tutorials/QUICK_STARTED_cn.md @@ -4,24 +4,23 @@ 为了使得用户能够在很短的时间内快速产出模型,掌握PaddleDetection的使用方式,这篇教程通过一个预训练检测模型对小数据集进行finetune。在P40上单卡大约20min即可产出一个效果不错的模型。 -## 数据准备 - -数据集参考[Kaggle数据集](https://www.kaggle.com/mbkinaci/fruit-images-for-object-detection),其中训练数据集240张图片,测试数据集60张图片,数据类别为3类:苹果,橘子,香蕉。[下载链接](https://dataset.bj.bcebos.com/PaddleDetection_demo/fruit-detection.tar)。数据下载后分别解压即可, 数据准备脚本位于[download_fruit.py](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dataset/fruit/download_fruit.py)。下载数据方式如下: +- **注:在开始前,对于Linux用户, 运行如下命令设置PYTHONPATH,如果有GPU设备,指定GPU设备号。对于Windows用户,同样需要将PaddleDetection的根目录设置到PYTHONPATH中。** ```bash export PYTHONPATH=$PYTHONPATH:. -python dataset/fruit/download_fruit.py +export CUDA_VISIBLE_DEVICES=0 ``` -## 开始训练 +## 数据准备 -- **注:在开始前,运行如下命令并指定GPU** +数据集参考[Kaggle数据集](https://www.kaggle.com/mbkinaci/fruit-images-for-object-detection),其中训练数据集240张图片,测试数据集60张图片,数据类别为3类:苹果,橘子,香蕉。[下载链接](https://dataset.bj.bcebos.com/PaddleDetection_demo/fruit-detection.tar)。数据下载后分别解压即可, 数据准备脚本位于[download_fruit.py](../dataset/fruit/download_fruit.py)。下载数据方式如下: ```bash -export PYTHONPATH=$PYTHONPATH:. -export CUDA_VISIBLE_DEVICES=0 +python dataset/fruit/download_fruit.py ``` +## 开始训练 + 训练命令如下: ```bash -- GitLab