Browse Source

update README

yjh0410 1 year ago
parent
commit
c01424ec81
2 changed files with 35 additions and 4 deletions
  1. 18 2
      README.md
  2. 17 2
      README_CN.md

+ 18 - 2
README.md

@@ -134,18 +134,34 @@ python eval.py -d coco \
 ```
 
 ## Demo
-I have provide some images in `data/demo/images/`, so you can run following command to run a demo:
+I have provide some images in `data/demo/images/`, so you can run following command to run a demo with coco pretrained model:
 
 ```Shell
 python demo.py --mode image \
                --path_to_img data/demo/images/ \
                --cuda \
                --img_size 640 \
-               -m yolov2 \
+               --model yolov2 \
                --weight path/to/weight \
+               --dataset coco \
+               --num_classes 80 \
                --show
 ```
 
+If you want to try this command with voc pretrained model, you could refer to the following command:
+```Shell
+python demo.py --mode image \
+               --path_to_img data/demo/images/ \
+               --cuda \
+               --img_size 640 \
+               --model yolov2 \
+               --weight path/to/weight \
+               --dataset voc \
+               --num_classes 20 \
+               --show
+```
+
+
 If you want run a demo of streaming video detection, you need to set `--mode` to `video`, and give the path to video `--path_to_vid`。
 
 ```Shell

+ 17 - 2
README_CN.md

@@ -147,18 +147,33 @@ python eval.py -d coco \
 - 按照COCO官方的要求,将该文件上传至官方的服务器去计算AP。
 
 ## Demo
-本项目在`data/demo/images/`文件夹中提供了一些图片,使用者可以运行下面的命令来测试本地的图片
+本项目在`data/demo/images/`文件夹中提供了一些图片,使用者可以运行下面的命令去在本地的图片上测试用COCO训练出来的模型
 
 ```Shell
 python demo.py --mode image \
                --path_to_img data/demo/images/ \
                --cuda \
                --img_size 640 \
-               -m yolov2 \
+               --model yolov2 \
                --weight path/to/weight \
+               --dataset coco \
+               --num_classes 80 \
                --show
 ```
 
+当然,如果你想测试的是用VOC训练出来的模型,而非COCO,则参考下面的运行命令即可:
+
+```Shell
+python demo.py --mode image \
+               --path_to_img data/demo/images/ \
+               --cuda \
+               --img_size 640 \
+               --model yolov2 \
+               --weight path/to/weight \
+               --dataset voc \
+               --num_classes 20 \
+               --show
+```
 如果使用者想在本地的视频上去做测试,那么你需要将上述命令中的`--mode image`修改为`--mode video`,并给`--path_to_vid`传入视频所在的文件路径,例如:
 
 ```Shell