{
  "id": 402408,
  "title": "what all augmentations to use",
  "url": "/competitions/vesuvius-challenge-ink-detection/discussion/402408",
  "author_name": "",
  "post_date": "2023-04-18T09:02:40.149679400Z",
  "votes": 3,
  "comment_count": 2,
  "views": 0,
  "content": "<pre><code> ():\n    train_transform = [\n        albu.HorizontalFlip(p=),\n        albu.VerticalFlip(p=),\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.RandomBrightnessContrast(p=),\n        albu.ShiftScaleRotate(p=),\n        albu.Normalize(mean=[], std=[]),\n\n\n    ]\n     albu.Compose(train_transform)\n\n\n ():\n    train_transform = [\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.Normalize(mean=[], std=[]),\n\n    ]\n     albu.Compose(train_transform)\n</code></pre>\n<p>I have written code for augmentation, but the problem is that we cannot use normalization because it would normalize the mask as well, which is incorrect. How can I address this issue?</p>",
  "messages": [
    {
      "id": "2225572",
      "postDate": "04/18/2023 09:02:40",
      "content": "<pre><code> ():\n    train_transform = [\n        albu.HorizontalFlip(p=),\n        albu.VerticalFlip(p=),\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.RandomBrightnessContrast(p=),\n        albu.ShiftScaleRotate(p=),\n        albu.Normalize(mean=[], std=[]),\n\n\n    ]\n     albu.Compose(train_transform)\n\n\n ():\n    train_transform = [\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.Normalize(mean=[], std=[]),\n\n    ]\n     albu.Compose(train_transform)\n</code></pre>\n<p>I have written code for augmentation, but the problem is that we cannot use normalization because it would normalize the mask as well, which is incorrect. How can I address this issue?</p>",
      "rawMarkdown": "````python\ndef get_augmentation():\n    train_transform = [\n        albu.HorizontalFlip(p=0.5),\n        albu.VerticalFlip(p=0.5),\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.RandomBrightnessContrast(p=0.75),\n        albu.ShiftScaleRotate(p=0.75),\n        albu.Normalize(mean=[0], std=[1]),\n\n\n    ]\n    return albu.Compose(train_transform)\n\n\ndef get_test_augmentation():\n    train_transform = [\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.Normalize(mean=[0], std=[1]),\n\n    ]\n    return albu.Compose(train_transform)\n````\n\nI have written code for augmentation, but the problem is that we cannot use normalization because it would normalize the mask as well, which is incorrect. How can I address this issue?",
      "votes": null
    },
    {
      "id": "2225601",
      "postDate": "04/18/2023 09:33:01",
      "content": "<p>if you will take a look at the code you will see that normalize is image only transform, so it means it wont  normalize mask <a href=\"https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/transforms.py#L184\" target=\"_blank\">https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/transforms.py#L184</a></p>",
      "rawMarkdown": "if you will take a look at the code you will see that normalize is image only transform, so it means it wont  normalize mask https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/transforms.py#L184",
      "votes": null
    },
    {
      "id": "2225605",
      "postDate": "04/18/2023 09:47:53",
      "content": "<p>okay sir got it </p>",
      "rawMarkdown": "okay sir got it",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2225601,
      "author_name": "maksimovka",
      "author_url": "",
      "post_date": "04/18/2023 09:33:01",
      "content": "<p>if you will take a look at the code you will see that normalize is image only transform, so it means it wont  normalize mask <a href=\"https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/transforms.py#L184\" target=\"_blank\">https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/transforms.py#L184</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 2225605,
          "author_name": "lucario129",
          "author_url": "",
          "post_date": "04/18/2023 09:47:53",
          "content": "<p>okay sir got it </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2225572": "````python\ndef get_augmentation():\n    train_transform = [\n        albu.HorizontalFlip(p=0.5),\n        albu.VerticalFlip(p=0.5),\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.RandomBrightnessContrast(p=0.75),\n        albu.ShiftScaleRotate(p=0.75),\n        albu.Normalize(mean=[0], std=[1]),\n\n\n    ]\n    return albu.Compose(train_transform)\n\n\ndef get_test_augmentation():\n    train_transform = [\n        albu.Resize(height=Config.IMG_SIZE, width=Config.IMG_SIZE),\n        albu.Normalize(mean=[0], std=[1]),\n\n    ]\n    return albu.Compose(train_transform)\n````\n\nI have written code for augmentation, but the problem is that we cannot use normalization because it would normalize the mask as well, which is incorrect. How can I address this issue?",
    "2225601": "if you will take a look at the code you will see that normalize is image only transform, so it means it wont  normalize mask https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/transforms.py#L184",
    "2225605": "okay sir got it"
  },
  "source": "meta"
}