{
  "id": 214538,
  "title": "Proper way to apply Albumentations",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/214538",
  "author_name": "",
  "post_date": "2021-01-27T03:36:52.956677200Z",
  "votes": 7,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi,</p>\n<p>When should we apply/(apply in combination) transformations like <a href=\"https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1258\" target=\"_blank\">HueSaturationValue</a>, <a href=\"https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1457\" target=\"_blank\">RandomBrightnessContrast</a>, <a href=\"https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L552\" target=\"_blank\">CoarseDropout</a>? Should they be applied before or after Normalize? Some of them required float as inputs and others int values. </p>\n<p>Different public notebooks are following different ways to use them. Some of them are using wrong values for different parameters (int -&gt; float) as well. </p>\n<p>So would like to request anyone who has good knowledge on applying image transformations (albumentations) to give some broad idea on this topic. What are the useful ones, how to combine multiple transformations, …</p>\n<p>Many thanks.</p>",
  "messages": [
    {
      "id": "1171690",
      "postDate": "01/27/2021 03:36:52",
      "content": "<p>Hi,</p>\n<p>When should we apply/(apply in combination) transformations like <a href=\"https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1258\" target=\"_blank\">HueSaturationValue</a>, <a href=\"https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1457\" target=\"_blank\">RandomBrightnessContrast</a>, <a href=\"https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L552\" target=\"_blank\">CoarseDropout</a>? Should they be applied before or after Normalize? Some of them required float as inputs and others int values. </p>\n<p>Different public notebooks are following different ways to use them. Some of them are using wrong values for different parameters (int -&gt; float) as well. </p>\n<p>So would like to request anyone who has good knowledge on applying image transformations (albumentations) to give some broad idea on this topic. What are the useful ones, how to combine multiple transformations, …</p>\n<p>Many thanks.</p>",
      "rawMarkdown": "Hi,\n\nWhen should we apply/(apply in combination) transformations like [HueSaturationValue](https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1258), [RandomBrightnessContrast](https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1457), [CoarseDropout](https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L552)? Should they be applied before or after Normalize? Some of them required float as inputs and others int values. \n\nDifferent public notebooks are following different ways to use them. Some of them are using wrong values for different parameters (int -> float) as well. \n\nSo would like to request anyone who has good knowledge on applying image transformations (albumentations) to give some broad idea on this topic. What are the useful ones, how to combine multiple transformations, ...\n\nMany thanks.",
      "votes": null
    },
    {
      "id": "1174571",
      "postDate": "01/28/2021 15:32:17",
      "content": "<p>The general rule of thumb is to Normalize after all your transformations. After all, normalization is just scaling the values within your specified range/mean/std. Typically, images are converted into numerical arrays/tensors before being fed into any model, so augmentation is based on adjusting those values. For example, Coarse Dropout/Cutout zeroes out or replaces the value of the \"area\" it is applied to. We don't want some sort of weird interaction by scaling the values first before changing them, so yes, Normalization comes after. </p>",
      "rawMarkdown": "The general rule of thumb is to Normalize after all your transformations. After all, normalization is just scaling the values within your specified range/mean/std. Typically, images are converted into numerical arrays/tensors before being fed into any model, so augmentation is based on adjusting those values. For example, Coarse Dropout/Cutout zeroes out or replaces the value of the \"area\" it is applied to. We don't want some sort of weird interaction by scaling the values first before changing them, so yes, Normalization comes after.",
      "votes": null
    },
    {
      "id": "1175346",
      "postDate": "01/29/2021 05:12:54",
      "content": "<p>Thank you. I understand about the Normalization part. </p>",
      "rawMarkdown": "Thank you. I understand about the Normalization part.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1174571,
      "author_name": "junyingsg",
      "author_url": "",
      "post_date": "01/28/2021 15:32:17",
      "content": "<p>The general rule of thumb is to Normalize after all your transformations. After all, normalization is just scaling the values within your specified range/mean/std. Typically, images are converted into numerical arrays/tensors before being fed into any model, so augmentation is based on adjusting those values. For example, Coarse Dropout/Cutout zeroes out or replaces the value of the \"area\" it is applied to. We don't want some sort of weird interaction by scaling the values first before changing them, so yes, Normalization comes after. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1175346,
          "author_name": "manikanthr5",
          "author_url": "",
          "post_date": "01/29/2021 05:12:54",
          "content": "<p>Thank you. I understand about the Normalization part. </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1171690": "Hi,\n\nWhen should we apply/(apply in combination) transformations like [HueSaturationValue](https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1258), [RandomBrightnessContrast](https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L1457), [CoarseDropout](https://github.com/albumentations-team/albumentations/blob/1f4fa59389f07a692a3934ba5c2c7d3c4e89e9f6/albumentations/augmentations/transforms.py#L552)? Should they be applied before or after Normalize? Some of them required float as inputs and others int values. \n\nDifferent public notebooks are following different ways to use them. Some of them are using wrong values for different parameters (int -> float) as well. \n\nSo would like to request anyone who has good knowledge on applying image transformations (albumentations) to give some broad idea on this topic. What are the useful ones, how to combine multiple transformations, ...\n\nMany thanks.",
    "1174571": "The general rule of thumb is to Normalize after all your transformations. After all, normalization is just scaling the values within your specified range/mean/std. Typically, images are converted into numerical arrays/tensors before being fed into any model, so augmentation is based on adjusting those values. For example, Coarse Dropout/Cutout zeroes out or replaces the value of the \"area\" it is applied to. We don't want some sort of weird interaction by scaling the values first before changing them, so yes, Normalization comes after.",
    "1175346": "Thank you. I understand about the Normalization part."
  },
  "source": "meta"
}