{
  "id": 155536,
  "title": "Anyone know why my images aren't showing?",
  "url": "/competitions/alaska2-image-steganalysis/discussion/155536",
  "author_name": "",
  "post_date": "2020-06-02T05:06:23.513673300Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>My code is super simple and compiling with no error, but nothing gets printed half way through and my images aren't showing.</p>\n\n<p>import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)</p>\n\n<p>import os</p>\n\n<p>import cv2</p>\n\n<p>BASE_PATH = \"/kaggle/input/alaska2-image-steganalysis\"\ntrain_ids = pd.Series(os.listdir(BASE_PATH + '/Cover')).sort_values(ascending=True).reset_index(drop=True)\ntest_ids = pd.Series(os.listdir(BASE_PATH + '/Test')).sort_values(ascending=True).reset_index(drop=True)</p>\n\n<p>print(train_ids.describe())\nprint(test_ids.describe())</p>\n\n<p>cover_paths = pd.Series(BASE_PATH + '/Cover/' + train_ids).sort_values(ascending=True)\njm_paths = pd.Series(BASE_PATH + '/JMiPOD/' + train_ids).sort_values(ascending=True)\nprint('here')\nju_paths = pd.Series(BASE_PATH + '/JUNIWARD/' + train_ids).sort_values(ascending=True)\nprint('here2') </p>\n\n<h1>AROUND HERE STUFF STOPS PRINTING</h1>\n\n<p>ue_paths = pd.Series(BASE_PATH + '/UERD/' + train_ids).sort_values(ascending=True)\ntest_paths = pd.Series(BASE_PATH + '/Test/' + test_ids).sort_values(ascending=True)</p>\n\n<p>sub = pd.read_csv(BASE_PATH + '/sample_submission.csv')\nprint(sub.head())</p>\n\n<p>first_images = []</p>\n\n<p>for i in range(3):\n    print(cover_paths[i])\n    temp = cv2.imread(cover_paths[i],0)\n    print(temp)\n    cv2.imshow('image',temp)</p>",
  "messages": [
    {
      "id": "871015",
      "postDate": "06/02/2020 05:06:23",
      "content": "<p>My code is super simple and compiling with no error, but nothing gets printed half way through and my images aren't showing.</p>\n\n<p>import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)</p>\n\n<p>import os</p>\n\n<p>import cv2</p>\n\n<p>BASE_PATH = \"/kaggle/input/alaska2-image-steganalysis\"\ntrain_ids = pd.Series(os.listdir(BASE_PATH + '/Cover')).sort_values(ascending=True).reset_index(drop=True)\ntest_ids = pd.Series(os.listdir(BASE_PATH + '/Test')).sort_values(ascending=True).reset_index(drop=True)</p>\n\n<p>print(train_ids.describe())\nprint(test_ids.describe())</p>\n\n<p>cover_paths = pd.Series(BASE_PATH + '/Cover/' + train_ids).sort_values(ascending=True)\njm_paths = pd.Series(BASE_PATH + '/JMiPOD/' + train_ids).sort_values(ascending=True)\nprint('here')\nju_paths = pd.Series(BASE_PATH + '/JUNIWARD/' + train_ids).sort_values(ascending=True)\nprint('here2') </p>\n\n<h1>AROUND HERE STUFF STOPS PRINTING</h1>\n\n<p>ue_paths = pd.Series(BASE_PATH + '/UERD/' + train_ids).sort_values(ascending=True)\ntest_paths = pd.Series(BASE_PATH + '/Test/' + test_ids).sort_values(ascending=True)</p>\n\n<p>sub = pd.read_csv(BASE_PATH + '/sample_submission.csv')\nprint(sub.head())</p>\n\n<p>first_images = []</p>\n\n<p>for i in range(3):\n    print(cover_paths[i])\n    temp = cv2.imread(cover_paths[i],0)\n    print(temp)\n    cv2.imshow('image',temp)</p>",
      "rawMarkdown": "My code is super simple and compiling with no error, but nothing gets printed half way through and my images aren't showing.\n\n\n\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\nimport os\n\nimport cv2\n\n\n\nBASE_PATH = \"/kaggle/input/alaska2-image-steganalysis\"\ntrain_ids = pd.Series(os.listdir(BASE_PATH + '/Cover')).sort_values(ascending=True).reset_index(drop=True)\ntest_ids = pd.Series(os.listdir(BASE_PATH + '/Test')).sort_values(ascending=True).reset_index(drop=True)\n\nprint(train_ids.describe())\nprint(test_ids.describe())\n\ncover_paths = pd.Series(BASE_PATH + '/Cover/' + train_ids).sort_values(ascending=True)\njm_paths = pd.Series(BASE_PATH + '/JMiPOD/' + train_ids).sort_values(ascending=True)\nprint('here')\nju_paths = pd.Series(BASE_PATH + '/JUNIWARD/' + train_ids).sort_values(ascending=True)\nprint('here2') \n# AROUND HERE STUFF STOPS PRINTING\nue_paths = pd.Series(BASE_PATH + '/UERD/' + train_ids).sort_values(ascending=True)\ntest_paths = pd.Series(BASE_PATH + '/Test/' + test_ids).sort_values(ascending=True)\n\nsub = pd.read_csv(BASE_PATH + '/sample_submission.csv')\nprint(sub.head())\n\n\n\nfirst_images = []\n\nfor i in range(3):\n    print(cover_paths[i])\n    temp = cv2.imread(cover_paths[i],0)\n    print(temp)\n    cv2.imshow('image',temp)",
      "votes": null
    },
    {
      "id": "872232",
      "postDate": "06/03/2020 02:40:49",
      "content": "<p>It's probably with cv2.imshow(). You need to use cv2.waitkey() after and if you're in a notebook, there are some other pieces that I've never bothered to learn. You might find it easier to just use matplotlib and do plt.imshow(img) after converting from BGR to RGB.</p>",
      "rawMarkdown": "It's probably with cv2.imshow(). You need to use cv2.waitkey() after and if you're in a notebook, there are some other pieces that I've never bothered to learn. You might find it easier to just use matplotlib and do plt.imshow(img) after converting from BGR to RGB.",
      "votes": null
    },
    {
      "id": "877265",
      "postDate": "06/07/2020 13:01:56",
      "content": "<p>alternatively, you can use matplotlib.pyplot to display images.\nimport matplotlib.pyplot as plt\ntemp = cv2.imread(coverpaths[i])\ntemp=cv2.cvtColor(temp,cv2.COLOR_BGR2RGB)\n    #print(temp)\n plt.imshow(temp)</p>",
      "rawMarkdown": "alternatively, you can use matplotlib.pyplot to display images.\nimport matplotlib.pyplot as plt\ntemp = cv2.imread(coverpaths[i])\ntemp=cv2.cvtColor(temp,cv2.COLOR_BGR2RGB)\n    #print(temp)\n plt.imshow(temp)",
      "votes": null
    },
    {
      "id": "883359",
      "postDate": "06/12/2020 15:06:42",
      "content": "<p>What is the waitkey doing here?</p>",
      "rawMarkdown": "What is the waitkey doing here?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 872232,
      "author_name": "jpmiller",
      "author_url": "",
      "post_date": "06/03/2020 02:40:49",
      "content": "<p>It's probably with cv2.imshow(). You need to use cv2.waitkey() after and if you're in a notebook, there are some other pieces that I've never bothered to learn. You might find it easier to just use matplotlib and do plt.imshow(img) after converting from BGR to RGB.</p>",
      "votes": null,
      "replies": [
        {
          "id": 883359,
          "author_name": "tasnimnishatislam",
          "author_url": "",
          "post_date": "06/12/2020 15:06:42",
          "content": "<p>What is the waitkey doing here?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 877265,
      "author_name": "priyt00",
      "author_url": "",
      "post_date": "06/07/2020 13:01:56",
      "content": "<p>alternatively, you can use matplotlib.pyplot to display images.\nimport matplotlib.pyplot as plt\ntemp = cv2.imread(coverpaths[i])\ntemp=cv2.cvtColor(temp,cv2.COLOR_BGR2RGB)\n    #print(temp)\n plt.imshow(temp)</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "871015": "My code is super simple and compiling with no error, but nothing gets printed half way through and my images aren't showing.\n\n\n\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\nimport os\n\nimport cv2\n\n\n\nBASE_PATH = \"/kaggle/input/alaska2-image-steganalysis\"\ntrain_ids = pd.Series(os.listdir(BASE_PATH + '/Cover')).sort_values(ascending=True).reset_index(drop=True)\ntest_ids = pd.Series(os.listdir(BASE_PATH + '/Test')).sort_values(ascending=True).reset_index(drop=True)\n\nprint(train_ids.describe())\nprint(test_ids.describe())\n\ncover_paths = pd.Series(BASE_PATH + '/Cover/' + train_ids).sort_values(ascending=True)\njm_paths = pd.Series(BASE_PATH + '/JMiPOD/' + train_ids).sort_values(ascending=True)\nprint('here')\nju_paths = pd.Series(BASE_PATH + '/JUNIWARD/' + train_ids).sort_values(ascending=True)\nprint('here2') \n# AROUND HERE STUFF STOPS PRINTING\nue_paths = pd.Series(BASE_PATH + '/UERD/' + train_ids).sort_values(ascending=True)\ntest_paths = pd.Series(BASE_PATH + '/Test/' + test_ids).sort_values(ascending=True)\n\nsub = pd.read_csv(BASE_PATH + '/sample_submission.csv')\nprint(sub.head())\n\n\n\nfirst_images = []\n\nfor i in range(3):\n    print(cover_paths[i])\n    temp = cv2.imread(cover_paths[i],0)\n    print(temp)\n    cv2.imshow('image',temp)",
    "872232": "It's probably with cv2.imshow(). You need to use cv2.waitkey() after and if you're in a notebook, there are some other pieces that I've never bothered to learn. You might find it easier to just use matplotlib and do plt.imshow(img) after converting from BGR to RGB.",
    "877265": "alternatively, you can use matplotlib.pyplot to display images.\nimport matplotlib.pyplot as plt\ntemp = cv2.imread(coverpaths[i])\ntemp=cv2.cvtColor(temp,cv2.COLOR_BGR2RGB)\n    #print(temp)\n plt.imshow(temp)",
    "883359": "What is the waitkey doing here?"
  },
  "source": "meta"
}