{
  "id": 103741,
  "title": "Need some help in saving the pre-processed image as image files",
  "url": "/competitions/aptos2019-blindness-detection/discussion/103741",
  "author_name": "",
  "post_date": "2019-08-11T11:57:15.781499900Z",
  "votes": null,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi, I've been recently trying to save the pre-processed image as an image file which is the whole test set images to run on inference, but not sure how to save them as images. Can anyone offer a helping hand.</p>",
  "messages": [
    {
      "id": "596845",
      "postDate": "08/11/2019 11:57:15",
      "content": "<p>Hi, I've been recently trying to save the pre-processed image as an image file which is the whole test set images to run on inference, but not sure how to save them as images. Can anyone offer a helping hand.</p>",
      "rawMarkdown": "Hi, I've been recently trying to save the pre-processed image as an image file which is the whole test set images to run on inference, but not sure how to save them as images. Can anyone offer a helping hand.",
      "votes": null
    },
    {
      "id": "596889",
      "postDate": "08/11/2019 13:03:44",
      "content": "<p>I had the same issue, the thing is that you need to create a folder and after using it you need to delete the same folder otherwise your kernel will get an error.</p>\n\n<p>To create a folder you can use:\n<code>os.makedirs('../input/folder_name/subfolder_name/')</code></p>\n\n<p>And to delete (at the end of the kernel):\n<code>shutil.rmtree('../input/folder_name/subfolder_name/')</code></p>",
      "rawMarkdown": "I had the same issue, the thing is that you need to create a folder and after using it you need to delete the same folder otherwise your kernel will get an error.\n\nTo create a folder you can use:\n`os.makedirs('../input/folder_name/subfolder_name/')`\n\nAnd to delete (at the end of the kernel):\n`shutil.rmtree('../input/folder_name/subfolder_name/')`",
      "votes": null
    },
    {
      "id": "597416",
      "postDate": "08/12/2019 10:08:42",
      "content": "<p>don't understander you problem.\ndo you mean that you don't know how to save a image object(or array) to disk?\nor you don't know how to refer image files of other kernel.</p>",
      "rawMarkdown": "don't understander you problem.\ndo you mean that you don't know how to save a image object(or array) to disk?\nor you don't know how to refer image files of other kernel.",
      "votes": null
    },
    {
      "id": "598328",
      "postDate": "08/13/2019 13:24:19",
      "content": "<p>Let me be clear. I did some preprocessing to the test images and want to load them for transformation ie.., transform.Compose([]). I converted my transformed image array values to images using keras image_to_array method. But I the transform module expects the image to in PIL loadable format but mine is the form of PIL.Image.Image which cannot be opened with PIL. So the problem being said what should I do <a href=\"/dimitreoliveira\">@dimitreoliveira</a> <a href=\"/frank518\">@frank518</a> . BTW thanks for your immediate response.</p>",
      "rawMarkdown": "Let me be clear. I did some preprocessing to the test images and want to load them for transformation ie.., transform.Compose([]). I converted my transformed image array values to images using keras image_to_array method. But I the transform module expects the image to in PIL loadable format but mine is the form of PIL.Image.Image which cannot be opened with PIL. So the problem being said what should I do @dimitreoliveira @frank518 . BTW thanks for your immediate response.",
      "votes": null
    },
    {
      "id": "598788",
      "postDate": "08/14/2019 03:05:25",
      "content": "<p>could you post your code and stacktrace logs? just like stackoverflow style. really hard to solve your problem according to the information above.</p>",
      "rawMarkdown": "could you post your code and stacktrace logs? just like stackoverflow style. really hard to solve your problem according to the information above.",
      "votes": null
    },
    {
      "id": "599084",
      "postDate": "08/14/2019 13:25:11",
      "content": "<p><a href=\"/frank518\">@frank518</a> , no worries I just solved it. Appreciate your help, thanks mate.</p>",
      "rawMarkdown": "frank518 , no worries I just solved it. Appreciate your help, thanks mate.",
      "votes": null
    },
    {
      "id": "599135",
      "postDate": "08/14/2019 14:29:59",
      "content": "<p>you're welcom, glad that you solve it.</p>",
      "rawMarkdown": "you're welcom, glad that you solve it.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 596889,
      "author_name": "dimitreoliveira",
      "author_url": "",
      "post_date": "08/11/2019 13:03:44",
      "content": "<p>I had the same issue, the thing is that you need to create a folder and after using it you need to delete the same folder otherwise your kernel will get an error.</p>\n\n<p>To create a folder you can use:\n<code>os.makedirs('../input/folder_name/subfolder_name/')</code></p>\n\n<p>And to delete (at the end of the kernel):\n<code>shutil.rmtree('../input/folder_name/subfolder_name/')</code></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 597416,
      "author_name": "frank518",
      "author_url": "",
      "post_date": "08/12/2019 10:08:42",
      "content": "<p>don't understander you problem.\ndo you mean that you don't know how to save a image object(or array) to disk?\nor you don't know how to refer image files of other kernel.</p>",
      "votes": null,
      "replies": [
        {
          "id": 598328,
          "author_name": "saravanakumar123",
          "author_url": "",
          "post_date": "08/13/2019 13:24:19",
          "content": "<p>Let me be clear. I did some preprocessing to the test images and want to load them for transformation ie.., transform.Compose([]). I converted my transformed image array values to images using keras image_to_array method. But I the transform module expects the image to in PIL loadable format but mine is the form of PIL.Image.Image which cannot be opened with PIL. So the problem being said what should I do <a href=\"/dimitreoliveira\">@dimitreoliveira</a> <a href=\"/frank518\">@frank518</a> . BTW thanks for your immediate response.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 598788,
          "author_name": "frank518",
          "author_url": "",
          "post_date": "08/14/2019 03:05:25",
          "content": "<p>could you post your code and stacktrace logs? just like stackoverflow style. really hard to solve your problem according to the information above.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 599084,
          "author_name": "saravanakumar123",
          "author_url": "",
          "post_date": "08/14/2019 13:25:11",
          "content": "<p><a href=\"/frank518\">@frank518</a> , no worries I just solved it. Appreciate your help, thanks mate.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 599135,
          "author_name": "frank518",
          "author_url": "",
          "post_date": "08/14/2019 14:29:59",
          "content": "<p>you're welcom, glad that you solve it.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "596845": "Hi, I've been recently trying to save the pre-processed image as an image file which is the whole test set images to run on inference, but not sure how to save them as images. Can anyone offer a helping hand.",
    "596889": "I had the same issue, the thing is that you need to create a folder and after using it you need to delete the same folder otherwise your kernel will get an error.\n\nTo create a folder you can use:\n`os.makedirs('../input/folder_name/subfolder_name/')`\n\nAnd to delete (at the end of the kernel):\n`shutil.rmtree('../input/folder_name/subfolder_name/')`",
    "597416": "don't understander you problem.\ndo you mean that you don't know how to save a image object(or array) to disk?\nor you don't know how to refer image files of other kernel.",
    "598328": "Let me be clear. I did some preprocessing to the test images and want to load them for transformation ie.., transform.Compose([]). I converted my transformed image array values to images using keras image_to_array method. But I the transform module expects the image to in PIL loadable format but mine is the form of PIL.Image.Image which cannot be opened with PIL. So the problem being said what should I do @dimitreoliveira @frank518 . BTW thanks for your immediate response.",
    "598788": "could you post your code and stacktrace logs? just like stackoverflow style. really hard to solve your problem according to the information above.",
    "599084": "frank518 , no worries I just solved it. Appreciate your help, thanks mate.",
    "599135": "you're welcom, glad that you solve it."
  },
  "source": "meta"
}