未验证 提交 7184dd87 编写于 作者: G Guanghua Yu 提交者: GitHub

fix face_detection grammatical errors (#4405)

上级 2377b052
...@@ -92,8 +92,8 @@ tar -xf vgg_ilsvrc_16_fc_reduced.tar.gz && rm -f vgg_ilsvrc_16_fc_reduced.tar.gz ...@@ -92,8 +92,8 @@ tar -xf vgg_ilsvrc_16_fc_reduced.tar.gz && rm -f vgg_ilsvrc_16_fc_reduced.tar.gz
```bash ```bash
python -u train.py --batch_size=16 --pretrained_model=vgg_ilsvrc_16_fc_reduced 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。 - 可以通过设置 `export CUDA_VISIBLE_DEVICES=0,1,2,3` 指定想要使用的GPU数量,`batch_size`默认设置为12或16,如果GPU显存较小,请适当调低`batch_size`
- **注意**: 在**Windows**机器上训练,需要设置 `--use_multiprocess=False`,因为在Windows上使用Python多进程加速训练时有错误 - **注意**: 在**Windows**机器上训练或者训练环境内存较小时,需要设置 `--use_multiprocess=False`,因为在Windows上使用Python多进程加速训练时有错误,内存不足时程序会崩溃
- 更多的可选参数见: - 更多的可选参数见:
```bash ```bash
python train.py --help python train.py --help
......
...@@ -28,7 +28,7 @@ def draw_bbox(image, bbox): ...@@ -28,7 +28,7 @@ def draw_bbox(image, bbox):
bbox (np.array|list|tuple): (xmin, ymin, xmax, ymax). bbox (np.array|list|tuple): (xmin, ymin, xmax, ymax).
""" """
draw = ImageDraw.Draw(image) draw = ImageDraw.Draw(image)
xmin, ymin, xmax, ymax = box xmin, ymin, xmax, ymax = bbox
(left, right, top, bottom) = (xmin, xmax, ymin, ymax) (left, right, top, bottom) = (xmin, xmax, ymin, ymax)
draw.line( draw.line(
[(left, top), (left, bottom), (right, bottom), (right, top), [(left, top), (left, bottom), (right, bottom), (right, top),
......
...@@ -67,7 +67,7 @@ def infer(args, config): ...@@ -67,7 +67,7 @@ def infer(args, config):
image_path = args.image_path image_path = args.image_path
image = Image.open(image_path) image = Image.open(image_path)
if image.mode == 'L': if image.mode == 'L':
image = img.convert('RGB') image = image.convert('RGB')
shrink, max_shrink = get_shrink(image.size[1], image.size[0]) shrink, max_shrink = get_shrink(image.size[1], image.size[0])
det0 = detect_face(image, shrink) det0 = detect_face(image, shrink)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册