Publishing 2019 R1 content
[platform/upstream/dldt.git] / tools / accuracy_checker / accuracy_checker / preprocessor / README.md
1 # Preprocessors
2
3 Preprocessor is function which processes input data before model inference.
4 Every preprocessor has parameters available for configuration.
5 Accuracy Checker supports following set of preprocessors:
6
7 * `resize` - resizing the image to a new width and height.
8   * `dst_width` and `dst_height` are destination width and height for image resizing respectively.
9     You can also use `size` instead in case when destination sizes are equal for both dimensions.
10   * `use_pil` parameter specifies usage of Pillow library for resizing.
11     Accuracy Checker uses OpenCV as default image reader.
12   * `interpolation` specifies method that will be used.
13     Possible values depend on image processing library:
14       * **OpenCV**: Nearest, Linear, Cubic, Area, Max, Lanczos4, Bits, Bits32
15       * **Pillow**: None, Nearest, Cubic, Bicubic, Box, Bilinear, Lanczos, Antialias, Hamming
16   * `aspect_ratio_scale` allows save image aspect ratio using one of these ways: 
17     - `width` - rescale width.
18     - `height` - rescale height.
19     - `greater` - rescale greater from image sizes.
20
21 * `normalization` - changing the range of pixel intensity values.
22   * `mean` values which will be subtracted from image channels.
23      You can specify one value for all channels or list of comma separated channel-wise values.
24   * `std` specifies values, on which pixels will be divided.
25      You can specify one value for all channels or list of comma separated channel-wise values.
26
27      These parameters support work with precomputed values of frequently used datasets (e.g. `cifar10` or `imagenet`).
28
29 * `bgr_to_rgb` - reversing image channels. Convert image in BGR format to RGB.
30 * `bgr_to_gray` - converting image in BGR to grayscale color space.
31 * `flip` - image mirroring around specified axis.
32   * `mode` specifies the axis for flipping (`vertical` or `horizontal`).
33 * `crop` - central cropping for image.
34   * `dst_width` and `dst_height` are destination width and height for image resizing respectively. You can also use `size` instead in case when destination sizes are equal.
35 * `crop_rectangle` - cropping region of interest using coordinates given as annotation metadata.
36 * `extend_around_rect` - scaling region of interest using annotation metadata.
37   * `augmentation_param` is scale factor for augmentation.
38 * `point_aligment` - aligning keypoints stored in annotation metadata.
39   * `draw_points` - allows visualize points.
40   * `normalize` - allows to use normalization for keypoints.
41   * `dst_width` and `dst_height` are destination width and height for keypoints resizing respectively. You can also use `size` instead in case when destination sizes are equal.
42 * `padding` - padding for image.
43   * `stride` - stride for padding.
44   * `pad_value` - value for filling space around original image.
45   * `dst_width` and `dst_height` are destination width and height for padded image respectively.
46     You can also use `size` instead in case when destination sizes are equal for both dimensions.
47 * `tiling` - image tiling.
48   * `margin` - margin for tiled fragment of image.
49   * `dst_width` and `dst_height` are destination width and height of tiled fragment respectively.
50     You can also use `size` instead in case when destination sizes are equal for both dimensions.
51