diff --git a/configs/yolov3_mobilenet_v1_fruit.yml b/configs/yolov3_mobilenet_v1_fruit.yml index c89aefc4199123c3ec764e798a15bbb4775a3298..c5d1a5ed3e98fbae68d61c025c7efb3590a14ebd 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 0000000000000000000000000000000000000000..1f60d62c399939cd92e667c1fb938764b3ec2901 --- /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 926bdf39d0ba4b48c4284b4e83bef7549e432913..e8eb313c1894454d4782d9df7f1307ab28fee828 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 c11f041ba4405ebbf6c60365bbe937df55e6374d..b8c1513db436447dc694d38d2d023f72285abb4f 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 ``` 训练命令如下: