Unverified Commit c57b8b18 authored by yxzhao's avatar yxzhao Committed by GitHub
Browse files

[Docs] Fix some mistakes in data_process.md (#2283)

* correction

* correction en docs
parent 936c193e
......@@ -135,7 +135,7 @@ bboxes = np.array([[10, 10, 100, 120], [0, 0, 50, 50]])
patches = mmcv.imcrop(img, bboxes)
# crop two regions, and rescale the patches by 1.2x
patches = mmcv.imcrop(img, bboxes, scale_ratio=1.2)
patches = mmcv.imcrop(img, bboxes, scale=1.2)
```
#### Padding
......@@ -150,14 +150,14 @@ img = mmcv.imread('tests/data/color.jpg')
img_ = mmcv.impad(img, shape=(1000, 1200), pad_val=0)
# pad the image to (1000, 1200) with different values for three channels.
img_ = mmcv.impad(img, shape=(1000, 1200), pad_val=[100, 50, 200])
img_ = mmcv.impad(img, shape=(1000, 1200), pad_val=(100, 50, 200))
# pad the image on left, right, top, bottom borders with all zeros
img_ = mmcv.impad(img, padding=(10, 20, 30, 40), pad_val=0)
# pad the image on left, right, top, bottom borders with different values
# for three channels.
img_ = mmcv.impad(img, padding=(10, 20, 30, 40), pad_val=[100, 50, 200])
img_ = mmcv.impad(img, padding=(10, 20, 30, 40), pad_val=(100, 50, 200))
# pad an image so that each edge is a multiple of some value.
img_ = mmcv.impad_to_multiple(img, 32)
......
......@@ -130,7 +130,7 @@ bboxes = np.array([[10, 10, 100, 120], [0, 0, 50, 50]])
patches = mmcv.imcrop(img, bboxes)
# 裁剪两个区域并且缩放区域1.2倍
patches = mmcv.imcrop(img, bboxes, scale_ratio=1.2)
patches = mmcv.imcrop(img, bboxes, scale=1.2)
```
#### 填充
......@@ -144,13 +144,13 @@ img = mmcv.imread('tests/data/color.jpg')
img_ = mmcv.impad(img, shape=(1000, 1200), pad_val=0)
# 用给定值分别填充图像的3个通道至 (1000, 1200)
img_ = mmcv.impad(img, shape=(1000, 1200), pad_val=[100, 50, 200])
img_ = mmcv.impad(img, shape=(1000, 1200), pad_val=(100, 50, 200))
# 用给定值填充图像的左、右、上、下四条边
img_ = mmcv.impad(img, padding=(10, 20, 30, 40), pad_val=0)
# 用3个值分别填充图像的左、右、上、下四条边的3个通道
img_ = mmcv.impad(img, padding=(10, 20, 30, 40), pad_val=[100, 50, 200])
img_ = mmcv.impad(img, padding=(10, 20, 30, 40), pad_val=(100, 50, 200))
# 将图像的四条边填充至能够被给定值整除
img_ = mmcv.impad_to_multiple(img, 32)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment