From e5af23e7f1b64c9f8e6a9ddf3088d0c74595a13b Mon Sep 17 00:00:00 2001 From: qingqing01 Date: Sat, 15 Feb 2020 19:59:12 +0800 Subject: [PATCH] Fix fruit config (#236) * Fix fruit config * Update docs/QUICK_STARTED doc --- configs/yolov3_mobilenet_v1_fruit.yml | 1 + dataset/fruit/label_list.txt | 3 +++ docs/QUICK_STARTED.md | 14 +++++++------- docs/QUICK_STARTED_cn.md | 13 ++++++------- 4 files changed, 17 insertions(+), 14 deletions(-) create mode 100755 dataset/fruit/label_list.txt diff --git a/configs/yolov3_mobilenet_v1_fruit.yml b/configs/yolov3_mobilenet_v1_fruit.yml index c89aefc41..c5d1a5ed3 100644 --- a/configs/yolov3_mobilenet_v1_fruit.yml +++ b/configs/yolov3_mobilenet_v1_fruit.yml @@ -119,4 +119,5 @@ YoloTestFeed: image_shape: [3, 608, 608] dataset: dataset_dir: dataset/fruit + annotation: label_list.txt use_default_label: false diff --git a/dataset/fruit/label_list.txt b/dataset/fruit/label_list.txt new file mode 100755 index 000000000..1f60d62c3 --- /dev/null +++ b/dataset/fruit/label_list.txt @@ -0,0 +1,3 @@ +apple +banana +orange diff --git a/docs/QUICK_STARTED.md b/docs/QUICK_STARTED.md index 926bdf39d..e8eb313c1 100644 --- a/docs/QUICK_STARTED.md +++ b/docs/QUICK_STARTED.md @@ -4,20 +4,20 @@ 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](../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](../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: @@ -26,7 +26,7 @@ Training: python -u tools/train.py -c configs/yolov3_mobilenet_v1_fruit.yml \ --use_tb=True \ --tb_log_dir=tb_fruit_dir/scalar \ - --eval + --eval ``` Use `yolov3_mobilenet_v1` to fine-tune the model from COCO dataset. Meanwhile, loss and mAP can be observed on tensorboard. diff --git a/docs/QUICK_STARTED_cn.md b/docs/QUICK_STARTED_cn.md index c11f041ba..b8c1513db 100644 --- a/docs/QUICK_STARTED_cn.md +++ b/docs/QUICK_STARTED_cn.md @@ -4,20 +4,19 @@ 为了使得用户能够在很短的时间内快速产出模型,掌握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](../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 ``` 训练命令如下: -- GitLab