{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":70203,"databundleVersionId":8068726,"sourceType":"competition"},{"sourceId":8605128,"sourceType":"datasetVersion","datasetId":4817095},{"sourceId":8737806,"sourceType":"datasetVersion","datasetId":4817074}],"dockerImageVersionId":30684,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"This is Team Epoch IV's solution to the BirdCLEF 2024 competition. With this notebook, we won the Best Working Note award! 🏆\n\nThis notebook was used to run inference on a locally-trained model for making submissions. To effectively work together as a team, we developed our code in a Python project rather than a notebook. We uploaded the [source code & trained models](https://www.kaggle.com/datasets/hugodeheer/bird-source) as well as it's [dependencies](https://www.kaggle.com/datasets/hugodeheer/bird-dependencies) to Kaggle as datasets and only use this notebook for running that code, resulting in a very short notebook. \n\nFor the full source code, which also includes the code for training models, as well as our award-winning working note, see our [repository on GitHub](https://github.com/TeamEpochGithub/iv-q4-birdclef-2024).","metadata":{}},{"cell_type":"code","source":"import os\nimport re\nimport shutil\nfrom pathlib import Path\n\nDEPENDENCIES_DATASET_PATH = Path('/kaggle/input/bird-dependencies')\nSOURCE_CODE_DATASET_PATH = Path('/kaggle/input/bird-source')\n\nDEPENENCIES_EXTRACTED_PATH = Path('/kaggle/temp/dependencies')","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-06-11T22:42:07.854124Z","iopub.execute_input":"2024-06-11T22:42:07.855867Z","iopub.status.idle":"2024-06-11T22:42:07.862941Z","shell.execute_reply.started":"2024-06-11T22:42:07.855794Z","shell.execute_reply":"2024-06-11T22:42:07.861495Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Install dependencies\nif not os.path.exists(DEPENENCIES_EXTRACTED_PATH):\n    print(\"Extracting Dependencies\")\n    shutil.unpack_archive(DEPENDENCIES_DATASET_PATH / 'dependencies.no_unzip', DEPENENCIES_EXTRACTED_PATH, format='zip')\n\nprint(\"Installing Dependencies\")\n!pip install -r {DEPENDENCIES_DATASET_PATH}/kaggle_requirements.txt --no-index --find-links=file://{DEPENENCIES_EXTRACTED_PATH}","metadata":{"execution":{"iopub.status.busy":"2024-06-11T22:42:07.865418Z","iopub.execute_input":"2024-06-11T22:42:07.865877Z","iopub.status.idle":"2024-06-11T22:42:20.972242Z","shell.execute_reply.started":"2024-06-11T22:42:07.865839Z","shell.execute_reply":"2024-06-11T22:42:20.970814Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle/working\n!rm -rf /kaggle/working/*\n\n!cp -r {SOURCE_CODE_DATASET_PATH}/* .","metadata":{"execution":{"iopub.status.busy":"2024-06-11T22:42:20.973968Z","iopub.execute_input":"2024-06-11T22:42:20.974322Z","iopub.status.idle":"2024-06-11T22:42:24.512854Z","shell.execute_reply.started":"2024-06-11T22:42:20.974290Z","shell.execute_reply":"2024-06-11T22:42:24.511070Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Run inference\n!python3 \"submit.py\"","metadata":{"execution":{"iopub.status.busy":"2024-06-11T22:42:24.514799Z","iopub.execute_input":"2024-06-11T22:42:24.515234Z","iopub.status.idle":"2024-06-11T22:42:34.893589Z","shell.execute_reply.started":"2024-06-11T22:42:24.515194Z","shell.execute_reply":"2024-06-11T22:42:34.891764Z"},"trusted":true},"execution_count":null,"outputs":[]}]}