{
  "id": 193050,
  "title": "agents_mask",
  "url": "/competitions/lyft-motion-prediction-autonomous-vehicles/discussion/193050",
  "author_name": "",
  "post_date": "2020-10-25T05:07:20.068350900Z",
  "votes": null,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Kindly someone explains what the below code does.</p>\n<pre><code>agents_mask = self.load_agents_mask()\n past_mask = agents_mask[:, 0] &gt;= min_frame_history\n future_mask = agents_mask[:, 1] &gt;= min_frame_future\n agents_mask = past_mask * future_mask\n</code></pre>\n<p>Here <strong>agents_mask</strong> dimension is (320124624,2). I am not able to relate this dimension with frames or agents. Also not sure what is happening in the next couple of lines. Please help me. Thanks!</p>",
  "messages": [
    {
      "id": "1059432",
      "postDate": "10/25/2020 05:07:20",
      "content": "<p>Kindly someone explains what the below code does.</p>\n<pre><code>agents_mask = self.load_agents_mask()\n past_mask = agents_mask[:, 0] &gt;= min_frame_history\n future_mask = agents_mask[:, 1] &gt;= min_frame_future\n agents_mask = past_mask * future_mask\n</code></pre>\n<p>Here <strong>agents_mask</strong> dimension is (320124624,2). I am not able to relate this dimension with frames or agents. Also not sure what is happening in the next couple of lines. Please help me. Thanks!</p>",
      "rawMarkdown": "Kindly someone explains what the below code does.\n\n ```\nagents_mask = self.load_agents_mask()\n past_mask = agents_mask[:, 0] >= min_frame_history\n future_mask = agents_mask[:, 1] >= min_frame_future\n agents_mask = past_mask * future_mask\n```\nHere **agents_mask** dimension is (320124624,2). I am not able to relate this dimension with frames or agents. Also not sure what is happening in the next couple of lines. Please help me. Thanks!",
      "votes": null
    },
    {
      "id": "1059593",
      "postDate": "10/25/2020 09:03:32",
      "content": "<p>It takes all agents from the dataset, finds agents with a minimum number of history frames, and in the next line agents with a minimum number of future frames. The last line is just an intersection of both sets, so you end up only with agents with at least <code>min_frame_history</code> history positions available and at least <code>min_frame_future</code> future positions available. </p>",
      "rawMarkdown": "It takes all agents from the dataset, finds agents with a minimum number of history frames, and in the next line agents with a minimum number of future frames. The last line is just an intersection of both sets, so you end up only with agents with at least `min_frame_history` history positions available and at least `min_frame_future` future positions available.",
      "votes": null
    },
    {
      "id": "1059598",
      "postDate": "10/25/2020 09:09:47",
      "content": "<p>Additionally, the history and future frames here are not only required to exist, but also to pass the \"thresholds\", like maximum distance from the AV etc.</p>",
      "rawMarkdown": "Additionally, the history and future frames here are not only required to exist, but also to pass the \"thresholds\", like maximum distance from the AV etc.",
      "votes": null
    },
    {
      "id": "1059612",
      "postDate": "10/25/2020 09:20:39",
      "content": "<p>Thank you!. Your both statements are helping me to think. But still didn't get clarity on what actually there in the agents_mask folder.  under <strong>agents_mask/0.5</strong> why these files have numbers? what do they mean? <br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F636669%2Fe73435dcd0d1abbc6151c1e605208f0b%2FScreenshot%20from%202020-10-25%2014-47-08.png?generation=1603617491952938&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Thank you!. Your both statements are helping me to think. But still didn't get clarity on what actually there in the agents_mask folder.  under **agents_mask/0.5** why these files have numbers? what do they mean? \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F636669%2Fe73435dcd0d1abbc6151c1e605208f0b%2FScreenshot%20from%202020-10-25%2014-47-08.png?generation=1603617491952938&alt=media)",
      "votes": null
    },
    {
      "id": "1059622",
      "postDate": "10/25/2020 09:37:26",
      "content": "<p>This is just how it is stored, in chunks of 10000. Zarr files internal staff, no need to dig there. Function <code>select_agents</code> creates those files.</p>",
      "rawMarkdown": "This is just how it is stored, in chunks of 10000. Zarr files internal staff, no need to dig there. Function `select_agents` creates those files.",
      "votes": null
    },
    {
      "id": "1059628",
      "postDate": "10/25/2020 09:49:50",
      "content": "<p>Agree with you. Next, as I said before agents_mask dimension is (320124624,2). This is list of list - [[0, 0],[0,0], ..] . It means 2D array. Array size is equal to the number of unique agents that we have. <br>\nKindly correct me here. </p>\n<ul>\n<li>are they unique or duplicate? </li>\n<li>if they are not unique, are they follow a sequence as <strong>agents</strong> dataset? </li>\n<li>also how these numbers can tell us the maximum distance from the AV as you said before?</li>\n<li>also is these details can help us to place an agent at a particular place in a single frame?</li>\n</ul>",
      "rawMarkdown": "Agree with you. Next, as I said before agents_mask dimension is (320124624,2). This is list of list - [[0, 0],[0,0], ..] . It means 2D array. Array size is equal to the number of unique agents that we have. \nKindly correct me here. \n- are they unique or duplicate? \n- if they are not unique, are they follow a sequence as **agents** dataset? \n-  also how these numbers can tell us the maximum distance from the AV as you said before?\n- also is these details can help us to place an agent at a particular place in a single frame?",
      "votes": null
    },
    {
      "id": "1059643",
      "postDate": "10/25/2020 10:05:01",
      "content": "<p>This is exactly the sequence from the agents part of the given zarr arrays. Not sure what do you mean by unique or duplicate, but the same agent does appear there multiple times (once per frame). These numbers can only tell in how many frames before and after the given frame and the given agent the same agent is present <strong>and</strong> passes the filters. The filters are implemented in <code>get_valid_agents</code> function. </p>\n<p>These details <strong>can not</strong> help us to place an agent at a particular place in a single frame.</p>",
      "rawMarkdown": "This is exactly the sequence from the agents part of the given zarr arrays. Not sure what do you mean by unique or duplicate, but the same agent does appear there multiple times (once per frame). These numbers can only tell in how many frames before and after the given frame and the given agent the same agent is present **and** passes the filters. The filters are implemented in `get_valid_agents` function. \n\nThese details **can not** help us to place an agent at a particular place in a single frame.",
      "votes": null
    },
    {
      "id": "1059647",
      "postDate": "10/25/2020 10:10:09",
      "content": "<p>Thank you! You answered all my questions.</p>",
      "rawMarkdown": "Thank you! You answered all my questions.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1059593,
      "author_name": "szacho",
      "author_url": "",
      "post_date": "10/25/2020 09:03:32",
      "content": "<p>It takes all agents from the dataset, finds agents with a minimum number of history frames, and in the next line agents with a minimum number of future frames. The last line is just an intersection of both sets, so you end up only with agents with at least <code>min_frame_history</code> history positions available and at least <code>min_frame_future</code> future positions available. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1059598,
          "author_name": "zaharch",
          "author_url": "",
          "post_date": "10/25/2020 09:09:47",
          "content": "<p>Additionally, the history and future frames here are not only required to exist, but also to pass the \"thresholds\", like maximum distance from the AV etc.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1059612,
          "author_name": "pallaviroyal",
          "author_url": "",
          "post_date": "10/25/2020 09:20:39",
          "content": "<p>Thank you!. Your both statements are helping me to think. But still didn't get clarity on what actually there in the agents_mask folder.  under <strong>agents_mask/0.5</strong> why these files have numbers? what do they mean? <br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F636669%2Fe73435dcd0d1abbc6151c1e605208f0b%2FScreenshot%20from%202020-10-25%2014-47-08.png?generation=1603617491952938&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1059622,
          "author_name": "zaharch",
          "author_url": "",
          "post_date": "10/25/2020 09:37:26",
          "content": "<p>This is just how it is stored, in chunks of 10000. Zarr files internal staff, no need to dig there. Function <code>select_agents</code> creates those files.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1059628,
          "author_name": "pallaviroyal",
          "author_url": "",
          "post_date": "10/25/2020 09:49:50",
          "content": "<p>Agree with you. Next, as I said before agents_mask dimension is (320124624,2). This is list of list - [[0, 0],[0,0], ..] . It means 2D array. Array size is equal to the number of unique agents that we have. <br>\nKindly correct me here. </p>\n<ul>\n<li>are they unique or duplicate? </li>\n<li>if they are not unique, are they follow a sequence as <strong>agents</strong> dataset? </li>\n<li>also how these numbers can tell us the maximum distance from the AV as you said before?</li>\n<li>also is these details can help us to place an agent at a particular place in a single frame?</li>\n</ul>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1059643,
          "author_name": "zaharch",
          "author_url": "",
          "post_date": "10/25/2020 10:05:01",
          "content": "<p>This is exactly the sequence from the agents part of the given zarr arrays. Not sure what do you mean by unique or duplicate, but the same agent does appear there multiple times (once per frame). These numbers can only tell in how many frames before and after the given frame and the given agent the same agent is present <strong>and</strong> passes the filters. The filters are implemented in <code>get_valid_agents</code> function. </p>\n<p>These details <strong>can not</strong> help us to place an agent at a particular place in a single frame.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1059647,
          "author_name": "pallaviroyal",
          "author_url": "",
          "post_date": "10/25/2020 10:10:09",
          "content": "<p>Thank you! You answered all my questions.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1059432": "Kindly someone explains what the below code does.\n\n ```\nagents_mask = self.load_agents_mask()\n past_mask = agents_mask[:, 0] >= min_frame_history\n future_mask = agents_mask[:, 1] >= min_frame_future\n agents_mask = past_mask * future_mask\n```\nHere **agents_mask** dimension is (320124624,2). I am not able to relate this dimension with frames or agents. Also not sure what is happening in the next couple of lines. Please help me. Thanks!",
    "1059593": "It takes all agents from the dataset, finds agents with a minimum number of history frames, and in the next line agents with a minimum number of future frames. The last line is just an intersection of both sets, so you end up only with agents with at least `min_frame_history` history positions available and at least `min_frame_future` future positions available.",
    "1059598": "Additionally, the history and future frames here are not only required to exist, but also to pass the \"thresholds\", like maximum distance from the AV etc.",
    "1059612": "Thank you!. Your both statements are helping me to think. But still didn't get clarity on what actually there in the agents_mask folder.  under **agents_mask/0.5** why these files have numbers? what do they mean? \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F636669%2Fe73435dcd0d1abbc6151c1e605208f0b%2FScreenshot%20from%202020-10-25%2014-47-08.png?generation=1603617491952938&alt=media)",
    "1059622": "This is just how it is stored, in chunks of 10000. Zarr files internal staff, no need to dig there. Function `select_agents` creates those files.",
    "1059628": "Agree with you. Next, as I said before agents_mask dimension is (320124624,2). This is list of list - [[0, 0],[0,0], ..] . It means 2D array. Array size is equal to the number of unique agents that we have. \nKindly correct me here. \n- are they unique or duplicate? \n- if they are not unique, are they follow a sequence as **agents** dataset? \n-  also how these numbers can tell us the maximum distance from the AV as you said before?\n- also is these details can help us to place an agent at a particular place in a single frame?",
    "1059643": "This is exactly the sequence from the agents part of the given zarr arrays. Not sure what do you mean by unique or duplicate, but the same agent does appear there multiple times (once per frame). These numbers can only tell in how many frames before and after the given frame and the given agent the same agent is present **and** passes the filters. The filters are implemented in `get_valid_agents` function. \n\nThese details **can not** help us to place an agent at a particular place in a single frame.",
    "1059647": "Thank you! You answered all my questions."
  },
  "source": "meta"
}