{
  "id": 37958,
  "title": "Training Image rescaling",
  "url": "/competitions/carvana-image-masking-challenge/discussion/37958",
  "author_name": "",
  "post_date": "2017-08-12T10:39:08.803728900Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hello everyone,</p>\n\n<p>I'm using a Deconvolutional Neural Nework to predict the masks from input images. My problem is the following. I want to resize my training images (1280, 1918) to the shape (320, 480). it allow for a faster training of the network.</p>\n\n<p>In order to resize the images I tested three functions from the <a href=\"http://scikit-image.org/docs/0.13.x/api/skimage.transform.html#skimage.transform\">skimage.transform</a> library :</p>\n\n<ul>\n<li>downscale_local_mean</li>\n<li>resize</li>\n<li>rescale</li>\n</ul>\n\n<p>When using downscale_local_mean my network is training ok (the dice coefficient increase as expected) but with the two others functions the network does not train at all. The dice coefficient is actually not moving. </p>\n\n<p>Does anyone have any clue why the network is training with the first function and not the two others .</p>\n\n<p>Thanks !!</p>",
  "messages": [
    {
      "id": "212672",
      "postDate": "08/12/2017 10:39:08",
      "content": "<p>Hello everyone,</p>\n\n<p>I'm using a Deconvolutional Neural Nework to predict the masks from input images. My problem is the following. I want to resize my training images (1280, 1918) to the shape (320, 480). it allow for a faster training of the network.</p>\n\n<p>In order to resize the images I tested three functions from the <a href=\"http://scikit-image.org/docs/0.13.x/api/skimage.transform.html#skimage.transform\">skimage.transform</a> library :</p>\n\n<ul>\n<li>downscale_local_mean</li>\n<li>resize</li>\n<li>rescale</li>\n</ul>\n\n<p>When using downscale_local_mean my network is training ok (the dice coefficient increase as expected) but with the two others functions the network does not train at all. The dice coefficient is actually not moving. </p>\n\n<p>Does anyone have any clue why the network is training with the first function and not the two others .</p>\n\n<p>Thanks !!</p>",
      "rawMarkdown": "Hello everyone,\n\nI'm using a Deconvolutional Neural Nework to predict the masks from input images. My problem is the following. I want to resize my training images (1280, 1918) to the shape (320, 480). it allow for a faster training of the network.\n\nIn order to resize the images I tested three functions from the [skimage.transform][1] library :\n\n- downscale_local_mean\n- resize\n- rescale\n\nWhen using downscale_local_mean my network is training ok (the dice coefficient increase as expected) but with the two others functions the network does not train at all. The dice coefficient is actually not moving. \n\nDoes anyone have any clue why the network is training with the first function and not the two others .\n\nThanks !!\n\n  [1]: http://scikit-image.org/docs/0.13.x/api/skimage.transform.html#skimage.transform",
      "votes": null
    },
    {
      "id": "213087",
      "postDate": "08/13/2017 17:26:12",
      "content": "<p>You must not have a problem with resizing, except with training mask which is gif images. You need to convert them to png via ImageMagick which help you out not face any problem. </p>\n\n<p>I use sicpy.misc.imresize which work pretty well for me, even with gif images. </p>",
      "rawMarkdown": "You must not have a problem with resizing, except with training mask which is gif images. You need to convert them to png via ImageMagick which help you out not face any problem. \n\nI use sicpy.misc.imresize which work pretty well for me, even with gif images.",
      "votes": null
    },
    {
      "id": "213100",
      "postDate": "08/13/2017 18:08:03",
      "content": "<p>Have you tried to save the result of resize/rescale into a file and check it?\nOutput of resize may not be what you expected without correct parameter. In my case, I padded 2 pixel on side and used following:</p>\n\n<pre>            resize(img, (320, 480), preserve_range=True, mode='constant')\n</pre>",
      "rawMarkdown": "Have you tried to save the result of resize/rescale into a file and check it?\nOutput of resize may not be what you expected without correct parameter. In my case, I padded 2 pixel on side and used following:\n<pre>            resize(img, (320, 480), preserve_range=True, mode='constant')\n</pre>",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 213087,
      "author_name": "svesal",
      "author_url": "",
      "post_date": "08/13/2017 17:26:12",
      "content": "<p>You must not have a problem with resizing, except with training mask which is gif images. You need to convert them to png via ImageMagick which help you out not face any problem. </p>\n\n<p>I use sicpy.misc.imresize which work pretty well for me, even with gif images. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 213100,
      "author_name": "jandjenter",
      "author_url": "",
      "post_date": "08/13/2017 18:08:03",
      "content": "<p>Have you tried to save the result of resize/rescale into a file and check it?\nOutput of resize may not be what you expected without correct parameter. In my case, I padded 2 pixel on side and used following:</p>\n\n<pre>            resize(img, (320, 480), preserve_range=True, mode='constant')\n</pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "212672": "Hello everyone,\n\nI'm using a Deconvolutional Neural Nework to predict the masks from input images. My problem is the following. I want to resize my training images (1280, 1918) to the shape (320, 480). it allow for a faster training of the network.\n\nIn order to resize the images I tested three functions from the [skimage.transform][1] library :\n\n- downscale_local_mean\n- resize\n- rescale\n\nWhen using downscale_local_mean my network is training ok (the dice coefficient increase as expected) but with the two others functions the network does not train at all. The dice coefficient is actually not moving. \n\nDoes anyone have any clue why the network is training with the first function and not the two others .\n\nThanks !!\n\n  [1]: http://scikit-image.org/docs/0.13.x/api/skimage.transform.html#skimage.transform",
    "213087": "You must not have a problem with resizing, except with training mask which is gif images. You need to convert them to png via ImageMagick which help you out not face any problem. \n\nI use sicpy.misc.imresize which work pretty well for me, even with gif images.",
    "213100": "Have you tried to save the result of resize/rescale into a file and check it?\nOutput of resize may not be what you expected without correct parameter. In my case, I padded 2 pixel on side and used following:\n<pre>            resize(img, (320, 480), preserve_range=True, mode='constant')\n</pre>"
  },
  "source": "meta"
}