diff --git a/PaddleCV/face_detection/README_cn.md b/PaddleCV/face_detection/README_cn.md index 3329a914af4fd12ae943fdc09ba7a6a15995db77..7324ad98760170550db69bc57850c18b90cfafbb 100644 --- a/PaddleCV/face_detection/README_cn.md +++ b/PaddleCV/face_detection/README_cn.md @@ -92,8 +92,8 @@ tar -xf vgg_ilsvrc_16_fc_reduced.tar.gz && rm -f vgg_ilsvrc_16_fc_reduced.tar.gz ```bash python -u train.py --batch_size=16 --pretrained_model=vgg_ilsvrc_16_fc_reduced ``` - - 可以通过设置 `export CUDA_VISIBLE_DEVICES=0,1,2,3` 指定想要使用的GPU数量,`batch_size`默认设置为12或16。 - - **注意**: 在**Windows**机器上训练,需要设置 `--use_multiprocess=False`,因为在Windows上使用Python多进程加速训练时有错误。 + - 可以通过设置 `export CUDA_VISIBLE_DEVICES=0,1,2,3` 指定想要使用的GPU数量,`batch_size`默认设置为12或16,如果GPU显存较小,请适当调低`batch_size`。 + - **注意**: 在**Windows**机器上训练或者训练环境内存较小时,需要设置 `--use_multiprocess=False`,因为在Windows上使用Python多进程加速训练时有错误,内存不足时程序会崩溃。 - 更多的可选参数见: ```bash python train.py --help diff --git a/PaddleCV/face_detection/visualize.py b/PaddleCV/face_detection/visualize.py index eee5d4db9ed7848cfeee1e92ec00ed489efd93dc..469696c6fc4f3670a3672635c1f1216f6d6b46e7 100644 --- a/PaddleCV/face_detection/visualize.py +++ b/PaddleCV/face_detection/visualize.py @@ -28,7 +28,7 @@ def draw_bbox(image, bbox): bbox (np.array|list|tuple): (xmin, ymin, xmax, ymax). """ draw = ImageDraw.Draw(image) - xmin, ymin, xmax, ymax = box + xmin, ymin, xmax, ymax = bbox (left, right, top, bottom) = (xmin, xmax, ymin, ymax) draw.line( [(left, top), (left, bottom), (right, bottom), (right, top), diff --git a/PaddleCV/face_detection/widerface_eval.py b/PaddleCV/face_detection/widerface_eval.py index 80201486b70d49689a9063b518efd6d4223edefd..803655ddc2598b595ee45d3ed74a0a8861a03c51 100644 --- a/PaddleCV/face_detection/widerface_eval.py +++ b/PaddleCV/face_detection/widerface_eval.py @@ -67,7 +67,7 @@ def infer(args, config): image_path = args.image_path image = Image.open(image_path) if image.mode == 'L': - image = img.convert('RGB') + image = image.convert('RGB') shrink, max_shrink = get_shrink(image.size[1], image.size[0]) det0 = detect_face(image, shrink)