{
  "id": 51824,
  "title": "How to do image augementation both for X and Y?",
  "url": "/competitions/data-science-bowl-2018/discussion/51824",
  "author_name": "",
  "post_date": "2018-03-13T13:26:28.999460200Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Could you share the image augmentation for input and label images. </p>",
  "messages": [
    {
      "id": "295316",
      "postDate": "03/13/2018 13:26:29",
      "content": "<p>Could you share the image augmentation for input and label images. </p>",
      "rawMarkdown": "Could you share the image augmentation for input and label images.",
      "votes": null
    },
    {
      "id": "295542",
      "postDate": "03/13/2018 20:31:26",
      "content": "<p>Hi, you can learn about this from our repo where we have that implemented with an abstraction of torchvision.transform on imgaug augmentations. <br>\nYou can find everything you may need in <code>loaders.py</code> of our repo  <code>https://github.com/neptune-ml/data-science-bowl-2018</code></p>\n\n<p>Check it out and use it however you like! </p>",
      "rawMarkdown": "Hi, you can learn about this from our repo where we have that implemented with an abstraction of torchvision.transform on imgaug augmentations.  \nYou can find everything you may need in `loaders.py` of our repo  `https://github.com/neptune-ml/data-science-bowl-2018`\n\n\nCheck it out and use it however you like!",
      "votes": null
    },
    {
      "id": "295635",
      "postDate": "03/14/2018 00:19:06",
      "content": "<p>Here's a good example of a clean and efficient augmentation code for segmentation data:</p>\n\n<p><a href=\"https://github.com/asanakoy/kaggle_carvana_segmentation/blob/master/albu/src/transforms.py\">https://github.com/asanakoy/kaggle_carvana_segmentation/blob/master/albu/src/transforms.py</a></p>\n\n<p>But if you already use <code>imgaug</code> pipeline for augmentations, it provides a handy function <code>.to_deterministic()</code>, which works like this:</p>\n\n<pre><code># Convert the stochastic sequence of augmenters to a deterministic one.\n# The deterministic sequence will always apply the exactly same effects to the images.\nseq_det = seq.to_deterministic() # call this for each batch again, NOT only once at the start\nimages_aug = seq_det.augment_images(images)\nmasks_aug = seq_det.augment_images(masks)\n</code></pre>\n\n<p>More on <code>imgaug</code> you can find on github:</p>\n\n<p><a href=\"https://github.com/aleju/imgaug\">https://github.com/aleju/imgaug</a></p>",
      "rawMarkdown": "Here's a good example of a clean and efficient augmentation code for segmentation data:\n\nhttps://github.com/asanakoy/kaggle_carvana_segmentation/blob/master/albu/src/transforms.py\n\n\nBut if you already use `imgaug` pipeline for augmentations, it provides a handy function `.to_deterministic()`, which works like this:\n\n    # Convert the stochastic sequence of augmenters to a deterministic one.\n    # The deterministic sequence will always apply the exactly same effects to the images.\n    seq_det = seq.to_deterministic() # call this for each batch again, NOT only once at the start\n    images_aug = seq_det.augment_images(images)\n    masks_aug = seq_det.augment_images(masks)\n\nMore on `imgaug` you can find on github:\n\nhttps://github.com/aleju/imgaug",
      "votes": null
    },
    {
      "id": "295687",
      "postDate": "03/14/2018 02:31:46",
      "content": "<p>Thank you guys</p>",
      "rawMarkdown": "Thank you guys",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 295542,
      "author_name": "jakubczakon",
      "author_url": "",
      "post_date": "03/13/2018 20:31:26",
      "content": "<p>Hi, you can learn about this from our repo where we have that implemented with an abstraction of torchvision.transform on imgaug augmentations. <br>\nYou can find everything you may need in <code>loaders.py</code> of our repo  <code>https://github.com/neptune-ml/data-science-bowl-2018</code></p>\n\n<p>Check it out and use it however you like! </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 295635,
      "author_name": "killthekitten",
      "author_url": "",
      "post_date": "03/14/2018 00:19:06",
      "content": "<p>Here's a good example of a clean and efficient augmentation code for segmentation data:</p>\n\n<p><a href=\"https://github.com/asanakoy/kaggle_carvana_segmentation/blob/master/albu/src/transforms.py\">https://github.com/asanakoy/kaggle_carvana_segmentation/blob/master/albu/src/transforms.py</a></p>\n\n<p>But if you already use <code>imgaug</code> pipeline for augmentations, it provides a handy function <code>.to_deterministic()</code>, which works like this:</p>\n\n<pre><code># Convert the stochastic sequence of augmenters to a deterministic one.\n# The deterministic sequence will always apply the exactly same effects to the images.\nseq_det = seq.to_deterministic() # call this for each batch again, NOT only once at the start\nimages_aug = seq_det.augment_images(images)\nmasks_aug = seq_det.augment_images(masks)\n</code></pre>\n\n<p>More on <code>imgaug</code> you can find on github:</p>\n\n<p><a href=\"https://github.com/aleju/imgaug\">https://github.com/aleju/imgaug</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 295687,
      "author_name": "sabarinathan",
      "author_url": "",
      "post_date": "03/14/2018 02:31:46",
      "content": "<p>Thank you guys</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "295316": "Could you share the image augmentation for input and label images.",
    "295542": "Hi, you can learn about this from our repo where we have that implemented with an abstraction of torchvision.transform on imgaug augmentations.  \nYou can find everything you may need in `loaders.py` of our repo  `https://github.com/neptune-ml/data-science-bowl-2018`\n\n\nCheck it out and use it however you like!",
    "295635": "Here's a good example of a clean and efficient augmentation code for segmentation data:\n\nhttps://github.com/asanakoy/kaggle_carvana_segmentation/blob/master/albu/src/transforms.py\n\n\nBut if you already use `imgaug` pipeline for augmentations, it provides a handy function `.to_deterministic()`, which works like this:\n\n    # Convert the stochastic sequence of augmenters to a deterministic one.\n    # The deterministic sequence will always apply the exactly same effects to the images.\n    seq_det = seq.to_deterministic() # call this for each batch again, NOT only once at the start\n    images_aug = seq_det.augment_images(images)\n    masks_aug = seq_det.augment_images(masks)\n\nMore on `imgaug` you can find on github:\n\nhttps://github.com/aleju/imgaug",
    "295687": "Thank you guys"
  },
  "source": "meta"
}