{
  "id": 491774,
  "title": "Number of Images in dataset",
  "url": "/competitions/tpu-getting-started/discussion/491774",
  "author_name": "Yongshan Yu",
  "post_date": "2024-04-07T08:04:55.371000",
  "votes": 1,
  "comment_count": 2,
  "views": null,
  "content": "<p>Sorry i am so confused. This dataset seems to be unusually small and only have 192 images in it, which are separately from 4 differen folders. Am i download the correct dataset?</p>",
  "messages": [
    {
      "id": 2863345,
      "postDate": "2024-06-09T10:40:25.367Z",
      "content": "<p>Actually the dataset of 192 images is divided in to 4 dataset for our convince. I would prefer you try 4 different folder because all of them have different resolution(512,331,224,192)<br>\nAnd all 4 folders are separated into train, test and val</p>",
      "rawMarkdown": "Actually the dataset of 192 images is divided in to 4 dataset for our convince. I would prefer you try 4 different folder because all of them have different resolution(512,331,224,192)\nAnd all 4 folders are separated into train, test and val",
      "votes": 1
    },
    {
      "id": 2739711,
      "postDate": "2024-04-07T08:04:55.370Z",
      "content": "<p>Sorry i am so confused. This dataset seems to be unusually small and only have 192 images in it, which are separately from 4 differen folders. Am i download the correct dataset?</p>",
      "rawMarkdown": "Sorry i am so confused. This dataset seems to be unusually small and only have 192 images in it, which are separately from 4 differen folders. Am i download the correct dataset?",
      "votes": 1
    },
    {
      "id": 3169772,
      "postDate": "2025-04-03T20:31:09.880Z",
      "content": "<p>The 4 folders contains the same pics with different resolutions !</p>\n<p>with this code</p>\n<blockquote>\n  <p>def count_examples_in_tfrecord(tfrecord_path):<br>\n           \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"<br>\n           return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))</p>\n</blockquote>\n<p>then</p>\n<blockquote>\n  <p>for resolution in ['192x192','224x224','331x331','512x512']:<br>\n      print(f\"\\nResolution {resolution}\")<br>\n      for doss in [\"train\", \"val\", \"test\"]:<br>\n          # Lister tous les fichiers TFRecord<br>\n          tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')<br>\n          # Compter les images dans chaque fichier et faire la somme<br>\n          total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)<br>\n          print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")</p>\n</blockquote>\n<p>you get :</p>\n<blockquote>\n  <p>Resolution 192x192<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 224x224<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 331x331<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 512x512<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382</p>\n</blockquote>\n<p>Excuse my french 🤪</p>",
      "rawMarkdown": "The 4 folders contains the same pics with different resolutions !\n\nwith this code\n\n>def count_examples_in_tfrecord(tfrecord_path):\n         \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"\n         return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))\n\nthen\n\n>for resolution in ['192x192','224x224','331x331','512x512']:\n    print(f\"\\nResolution {resolution}\")\n    for doss in [\"train\", \"val\", \"test\"]:\n        # Lister tous les fichiers TFRecord\n        tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')\n        # Compter les images dans chaque fichier et faire la somme\n        total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)\n        print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")\n\nyou get :\n\n>Resolution 192x192\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 224x224\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 331x331\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 512x512\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n\nExcuse my french 🤪"
    }
  ],
  "comments": [
    {
      "id": 2863345,
      "author_name": "Umer Tariq",
      "author_url": "",
      "post_date": "2024-06-09T10:40:25.367000",
      "content": "<p>Actually the dataset of 192 images is divided in to 4 dataset for our convince. I would prefer you try 4 different folder because all of them have different resolution(512,331,224,192)<br>\nAnd all 4 folders are separated into train, test and val</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 3169772,
      "author_name": "Didier Flamm",
      "author_url": "",
      "post_date": "2025-04-03T20:31:09.880000",
      "content": "<p>The 4 folders contains the same pics with different resolutions !</p>\n<p>with this code</p>\n<blockquote>\n  <p>def count_examples_in_tfrecord(tfrecord_path):<br>\n           \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"<br>\n           return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))</p>\n</blockquote>\n<p>then</p>\n<blockquote>\n  <p>for resolution in ['192x192','224x224','331x331','512x512']:<br>\n      print(f\"\\nResolution {resolution}\")<br>\n      for doss in [\"train\", \"val\", \"test\"]:<br>\n          # Lister tous les fichiers TFRecord<br>\n          tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')<br>\n          # Compter les images dans chaque fichier et faire la somme<br>\n          total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)<br>\n          print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")</p>\n</blockquote>\n<p>you get :</p>\n<blockquote>\n  <p>Resolution 192x192<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 224x224<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 331x331<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 512x512<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382</p>\n</blockquote>\n<p>Excuse my french 🤪</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2863345": "Actually the dataset of 192 images is divided in to 4 dataset for our convince. I would prefer you try 4 different folder because all of them have different resolution(512,331,224,192)\nAnd all 4 folders are separated into train, test and val",
    "2739711": "Sorry i am so confused. This dataset seems to be unusually small and only have 192 images in it, which are separately from 4 differen folders. Am i download the correct dataset?",
    "3169772": "The 4 folders contains the same pics with different resolutions !\n\nwith this code\n\n>def count_examples_in_tfrecord(tfrecord_path):\n         \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"\n         return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))\n\nthen\n\n>for resolution in ['192x192','224x224','331x331','512x512']:\n    print(f\"\\nResolution {resolution}\")\n    for doss in [\"train\", \"val\", \"test\"]:\n        # Lister tous les fichiers TFRecord\n        tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')\n        # Compter les images dans chaque fichier et faire la somme\n        total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)\n        print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")\n\nyou get :\n\n>Resolution 192x192\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 224x224\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 331x331\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 512x512\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n\nExcuse my french 🤪"
  }
}