{
  "id": 241533,
  "title": "File input and output in the Kaggle jupyter notebook",
  "url": "/competitions/birdclef-2021/discussion/241533",
  "author_name": "",
  "post_date": "2021-05-24T23:40:10.403688500Z",
  "votes": 6,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Our teams workflow was that I created spectrograms pngs using a python script. Those pngs were then picked up by the analyst and fed into the neural network. </p>\n<p>Here is the code that i used to created the spectrograms for the soundscapes<br>\n<a href=\"https://github.com/thesteve0/birdclef21/blob/main/soundscapes/soundscape_splitter.py\" target=\"_blank\">https://github.com/thesteve0/birdclef21/blob/main/soundscapes/soundscape_splitter.py</a></p>\n<p>This leads me to some questions about the judging data work. I know we have to move our work into a jupyter notebook but I only really work with straight python code. I could really use some help trying to translate how to move my python code into the notebook environment in terms of how to handle inputs and outputs.</p>\n<ol>\n<li>Based on other submitted notebooks, it seems like I can assume that the test_soundscapes will be at \"../input/birdclef-2021/test_soundscapes\". Is this a good assumption. </li>\n<li>Where can I write me intermediate png files so that my partners code can pick them up?</li>\n</ol>\n<p>Thanks<br>\nSteve</p>",
  "messages": [
    {
      "id": "1321763",
      "postDate": "05/24/2021 23:40:10",
      "content": "<p>Our teams workflow was that I created spectrograms pngs using a python script. Those pngs were then picked up by the analyst and fed into the neural network. </p>\n<p>Here is the code that i used to created the spectrograms for the soundscapes<br>\n<a href=\"https://github.com/thesteve0/birdclef21/blob/main/soundscapes/soundscape_splitter.py\" target=\"_blank\">https://github.com/thesteve0/birdclef21/blob/main/soundscapes/soundscape_splitter.py</a></p>\n<p>This leads me to some questions about the judging data work. I know we have to move our work into a jupyter notebook but I only really work with straight python code. I could really use some help trying to translate how to move my python code into the notebook environment in terms of how to handle inputs and outputs.</p>\n<ol>\n<li>Based on other submitted notebooks, it seems like I can assume that the test_soundscapes will be at \"../input/birdclef-2021/test_soundscapes\". Is this a good assumption. </li>\n<li>Where can I write me intermediate png files so that my partners code can pick them up?</li>\n</ol>\n<p>Thanks<br>\nSteve</p>",
      "rawMarkdown": "Our teams workflow was that I created spectrograms pngs using a python script. Those pngs were then picked up by the analyst and fed into the neural network. \n\nHere is the code that i used to created the spectrograms for the soundscapes\nhttps://github.com/thesteve0/birdclef21/blob/main/soundscapes/soundscape_splitter.py\n\nThis leads me to some questions about the judging data work. I know we have to move our work into a jupyter notebook but I only really work with straight python code. I could really use some help trying to translate how to move my python code into the notebook environment in terms of how to handle inputs and outputs.\n\n1. Based on other submitted notebooks, it seems like I can assume that the test_soundscapes will be at \"../input/birdclef-2021/test_soundscapes\". Is this a good assumption. \n2. Where can I write me intermediate png files so that my partners code can pick them up?\n\nThanks\nSteve",
      "votes": null
    },
    {
      "id": "1326584",
      "postDate": "05/28/2021 14:54:15",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/thesteve0\" target=\"_blank\">@thesteve0</a> </p>\n<p>If you want your code to access any data you need to create a dataset in Kaggle. Then add that data (right side top button when the kaggle notebook is on edit mode) to your current notebook (in edit mode).</p>\n<p>Here is a <a href=\"https://www.kaggle.com/getting-started/55948\" target=\"_blank\">discussion </a>that can help you learn about creating a dataset in kaggle.</p>",
      "rawMarkdown": "Hi @thesteve0 \n\nIf you want your code to access any data you need to create a dataset in Kaggle. Then add that data (right side top button when the kaggle notebook is on edit mode) to your current notebook (in edit mode).\n\nHere is a [discussion ](https://www.kaggle.com/getting-started/55948)that can help you learn about creating a dataset in kaggle.",
      "votes": null
    },
    {
      "id": "1326958",
      "postDate": "05/28/2021 18:50:41",
      "content": "<p>You can use python scripts if you prefer.  Have a look at the file menu when you edit your notebook.  You can edit it as a script.</p>",
      "rawMarkdown": "You can use python scripts if you prefer.  Have a look at the file menu when you edit your notebook.  You can edit it as a script.",
      "votes": null
    },
    {
      "id": "1326992",
      "postDate": "05/28/2021 19:19:21",
      "content": "<p>Can we do a mix of both? For example, the sound -&gt; img file processing in python and then the ML part in Jupyter? If so where do I tell the python script to write it's files so that the jupyter notebook can see them?</p>",
      "rawMarkdown": "Can we do a mix of both? For example, the sound -> img file processing in python and then the ML part in Jupyter? If so where do I tell the python script to write it's files so that the jupyter notebook can see them?",
      "votes": null
    },
    {
      "id": "1326995",
      "postDate": "05/28/2021 19:21:38",
      "content": "<p>Thanks for the suggestion but that will not work in this case as we do not have the test soundscapes visible to us. There is no way for me to run my sound -&gt; img python script on the test soundscape and then upload the results for my partner's jupyter notebook to use.</p>",
      "rawMarkdown": "Thanks for the suggestion but that will not work in this case as we do not have the test soundscapes visible to us. There is no way for me to run my sound -> img python script on the test soundscape and then upload the results for my partner's jupyter notebook to use.",
      "votes": null
    },
    {
      "id": "1327644",
      "postDate": "05/29/2021 13:45:02",
      "content": "<p>Yeah, this will only be possible if you run that code in the submission notebook itself. Generate in kaggle environment during submission.</p>",
      "rawMarkdown": "Yeah, this will only be possible if you run that code in the submission notebook itself. Generate in kaggle environment during submission.",
      "votes": null
    },
    {
      "id": "1328142",
      "postDate": "05/30/2021 00:22:49",
      "content": "<p>you can run shel commens in notebook cells using 1.</p>\n<p>For instance, running the following in a cell will run the python script:</p>\n<p><code>! python_script.py</code></p>",
      "rawMarkdown": "you can run shel commens in notebook cells using 1.\n\nFor instance, running the following in a cell will run the python script:\n\n`! python_script.py `",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1326584,
      "author_name": "lplenka",
      "author_url": "",
      "post_date": "05/28/2021 14:54:15",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/thesteve0\" target=\"_blank\">@thesteve0</a> </p>\n<p>If you want your code to access any data you need to create a dataset in Kaggle. Then add that data (right side top button when the kaggle notebook is on edit mode) to your current notebook (in edit mode).</p>\n<p>Here is a <a href=\"https://www.kaggle.com/getting-started/55948\" target=\"_blank\">discussion </a>that can help you learn about creating a dataset in kaggle.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1326995,
          "author_name": "thesteve0",
          "author_url": "",
          "post_date": "05/28/2021 19:21:38",
          "content": "<p>Thanks for the suggestion but that will not work in this case as we do not have the test soundscapes visible to us. There is no way for me to run my sound -&gt; img python script on the test soundscape and then upload the results for my partner's jupyter notebook to use.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1327644,
          "author_name": "lplenka",
          "author_url": "",
          "post_date": "05/29/2021 13:45:02",
          "content": "<p>Yeah, this will only be possible if you run that code in the submission notebook itself. Generate in kaggle environment during submission.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1326958,
      "author_name": "cpmpml",
      "author_url": "",
      "post_date": "05/28/2021 18:50:41",
      "content": "<p>You can use python scripts if you prefer.  Have a look at the file menu when you edit your notebook.  You can edit it as a script.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1326992,
          "author_name": "thesteve0",
          "author_url": "",
          "post_date": "05/28/2021 19:19:21",
          "content": "<p>Can we do a mix of both? For example, the sound -&gt; img file processing in python and then the ML part in Jupyter? If so where do I tell the python script to write it's files so that the jupyter notebook can see them?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1328142,
          "author_name": "cpmpml",
          "author_url": "",
          "post_date": "05/30/2021 00:22:49",
          "content": "<p>you can run shel commens in notebook cells using 1.</p>\n<p>For instance, running the following in a cell will run the python script:</p>\n<p><code>! python_script.py</code></p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1321763": "Our teams workflow was that I created spectrograms pngs using a python script. Those pngs were then picked up by the analyst and fed into the neural network. \n\nHere is the code that i used to created the spectrograms for the soundscapes\nhttps://github.com/thesteve0/birdclef21/blob/main/soundscapes/soundscape_splitter.py\n\nThis leads me to some questions about the judging data work. I know we have to move our work into a jupyter notebook but I only really work with straight python code. I could really use some help trying to translate how to move my python code into the notebook environment in terms of how to handle inputs and outputs.\n\n1. Based on other submitted notebooks, it seems like I can assume that the test_soundscapes will be at \"../input/birdclef-2021/test_soundscapes\". Is this a good assumption. \n2. Where can I write me intermediate png files so that my partners code can pick them up?\n\nThanks\nSteve",
    "1326584": "Hi @thesteve0 \n\nIf you want your code to access any data you need to create a dataset in Kaggle. Then add that data (right side top button when the kaggle notebook is on edit mode) to your current notebook (in edit mode).\n\nHere is a [discussion ](https://www.kaggle.com/getting-started/55948)that can help you learn about creating a dataset in kaggle.",
    "1326958": "You can use python scripts if you prefer.  Have a look at the file menu when you edit your notebook.  You can edit it as a script.",
    "1326992": "Can we do a mix of both? For example, the sound -> img file processing in python and then the ML part in Jupyter? If so where do I tell the python script to write it's files so that the jupyter notebook can see them?",
    "1326995": "Thanks for the suggestion but that will not work in this case as we do not have the test soundscapes visible to us. There is no way for me to run my sound -> img python script on the test soundscape and then upload the results for my partner's jupyter notebook to use.",
    "1327644": "Yeah, this will only be possible if you run that code in the submission notebook itself. Generate in kaggle environment during submission.",
    "1328142": "you can run shel commens in notebook cells using 1.\n\nFor instance, running the following in a cell will run the python script:\n\n`! python_script.py `"
  },
  "source": "meta"
}