{
  "id": 256480,
  "title": "Use the key frames from data samples",
  "url": "/competitions/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/256480",
  "author_name": "",
  "post_date": "2021-08-01T21:57:14.193485100Z",
  "votes": 7,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I noticed the submissions are using a subset of the frames. There are multiple ways we could get a subset of the frames:</p>\n<ul>\n<li>Get the first n frames</li>\n<li>Get the middle of n frames</li>\n<li>Get a frame every total/n frames</li>\n</ul>\n<p>Instead of treating each frames equal, I compared the difference between each frames and get the most important frames by choosing the most differences between frames. The approach is described <a href=\"https://www.kaggle.com/gordonwang141/get-key-frames-for-each-data-sample/\" target=\"_blank\">here</a>. Based on this, I published a <a href=\"https://www.kaggle.com/gordonwang141/rsnamiccaikeyframes\" target=\"_blank\">dataset</a>. Example usage of the data:</p>\n<pre><code>data_df = pd.read_pickle('../input/rsnamiccaikeyframes/keyframes.pkl')\n\ndef get_keyframe(braTS21ID, t, num_frames):\n    braTS21ID = int(braTS21ID)\n    if braTS21ID in data_df['BraTS21ID'].values:\n        # print('found ' + str(braTS21ID) + ' ' + t)\n        return data_df[data_df['BraTS21ID'] == braTS21ID][t].values[0][:num_frames]\n\n    return []\n\nget_keyframe(0, 'FLAIR', 5)\n# [85, 80, 95, 94, 112]\n</code></pre>\n<p>This will give you the frames changed the most from the previous frame.</p>",
  "messages": [
    {
      "id": "1407450",
      "postDate": "08/01/2021 21:57:14",
      "content": "<p>I noticed the submissions are using a subset of the frames. There are multiple ways we could get a subset of the frames:</p>\n<ul>\n<li>Get the first n frames</li>\n<li>Get the middle of n frames</li>\n<li>Get a frame every total/n frames</li>\n</ul>\n<p>Instead of treating each frames equal, I compared the difference between each frames and get the most important frames by choosing the most differences between frames. The approach is described <a href=\"https://www.kaggle.com/gordonwang141/get-key-frames-for-each-data-sample/\" target=\"_blank\">here</a>. Based on this, I published a <a href=\"https://www.kaggle.com/gordonwang141/rsnamiccaikeyframes\" target=\"_blank\">dataset</a>. Example usage of the data:</p>\n<pre><code>data_df = pd.read_pickle('../input/rsnamiccaikeyframes/keyframes.pkl')\n\ndef get_keyframe(braTS21ID, t, num_frames):\n    braTS21ID = int(braTS21ID)\n    if braTS21ID in data_df['BraTS21ID'].values:\n        # print('found ' + str(braTS21ID) + ' ' + t)\n        return data_df[data_df['BraTS21ID'] == braTS21ID][t].values[0][:num_frames]\n\n    return []\n\nget_keyframe(0, 'FLAIR', 5)\n# [85, 80, 95, 94, 112]\n</code></pre>\n<p>This will give you the frames changed the most from the previous frame.</p>",
      "rawMarkdown": "I noticed the submissions are using a subset of the frames. There are multiple ways we could get a subset of the frames:\n\n- Get the first n frames\n- Get the middle of n frames\n- Get a frame every total/n frames\n\nInstead of treating each frames equal, I compared the difference between each frames and get the most important frames by choosing the most differences between frames. The approach is described [here](https://www.kaggle.com/gordonwang141/get-key-frames-for-each-data-sample/). Based on this, I published a [dataset](https://www.kaggle.com/gordonwang141/rsnamiccaikeyframes). Example usage of the data:\n\n\n\n```\ndata_df = pd.read_pickle('../input/rsnamiccaikeyframes/keyframes.pkl')\n\ndef get_keyframe(braTS21ID, t, num_frames):\n    braTS21ID = int(braTS21ID)\n    if braTS21ID in data_df['BraTS21ID'].values:\n        # print('found ' + str(braTS21ID) + ' ' + t)\n        return data_df[data_df['BraTS21ID'] == braTS21ID][t].values[0][:num_frames]\n    \n    return []\n\nget_keyframe(0, 'FLAIR', 5)\n# [85, 80, 95, 94, 112]\n```\n\nThis will give you the frames changed the most from the previous frame.",
      "votes": null
    },
    {
      "id": "1444948",
      "postDate": "08/04/2021 07:25:40",
      "content": "<p><code>get the most important frames by choosing the most differences between frames.</code><br>\nsorry, didn't get you. Can you please explain</p>",
      "rawMarkdown": "`get the most important frames by choosing the most differences between frames.`\nsorry, didn't get you. Can you please explain",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1444948,
      "author_name": "mrinath",
      "author_url": "",
      "post_date": "08/04/2021 07:25:40",
      "content": "<p><code>get the most important frames by choosing the most differences between frames.</code><br>\nsorry, didn't get you. Can you please explain</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1407450": "I noticed the submissions are using a subset of the frames. There are multiple ways we could get a subset of the frames:\n\n- Get the first n frames\n- Get the middle of n frames\n- Get a frame every total/n frames\n\nInstead of treating each frames equal, I compared the difference between each frames and get the most important frames by choosing the most differences between frames. The approach is described [here](https://www.kaggle.com/gordonwang141/get-key-frames-for-each-data-sample/). Based on this, I published a [dataset](https://www.kaggle.com/gordonwang141/rsnamiccaikeyframes). Example usage of the data:\n\n\n\n```\ndata_df = pd.read_pickle('../input/rsnamiccaikeyframes/keyframes.pkl')\n\ndef get_keyframe(braTS21ID, t, num_frames):\n    braTS21ID = int(braTS21ID)\n    if braTS21ID in data_df['BraTS21ID'].values:\n        # print('found ' + str(braTS21ID) + ' ' + t)\n        return data_df[data_df['BraTS21ID'] == braTS21ID][t].values[0][:num_frames]\n    \n    return []\n\nget_keyframe(0, 'FLAIR', 5)\n# [85, 80, 95, 94, 112]\n```\n\nThis will give you the frames changed the most from the previous frame.",
    "1444948": "`get the most important frames by choosing the most differences between frames.`\nsorry, didn't get you. Can you please explain"
  },
  "source": "meta"
}