04_detect_segment/04a_retinanet_anthropods_download.ipynb (144 lines of code) (raw):
{
"cells": [
{
"cell_type": "markdown",
"id": "3b9a223d-4739-4cb3-ab53-d45c1612f108",
"metadata": {},
"source": [
"# Download RetinaNet code to notebook instance"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "edb85374-7056-4479-a31e-b827548fc43a",
"metadata": {},
"outputs": [],
"source": [
"!pip install --user --upgrade kaggle"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "49495951-6833-4377-becd-4b77feb49ce2",
"metadata": {},
"outputs": [],
"source": [
"import IPython\n",
"\n",
"IPython.Application.instance().kernel.do_shutdown(True) #automatically restarts kernel"
]
},
{
"cell_type": "markdown",
"id": "1bb99ae1-80a4-445b-a2eb-eab7015f355c",
"metadata": {},
"source": [
"## Create API Key on Kaggle\n",
"* Please go https://www.kaggle.com/ and go to your Account profile page\n",
"* Click on \"Create New API Token\"\n",
"* Upload the kaggle.json to this directory."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "018c36f6-3723-490e-903e-1b89d97d96f5",
"metadata": {},
"outputs": [],
"source": [
"!ls ./kaggle.json"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d6f3c560-0137-4dcc-869b-7b7ec659bced",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"current_dir=!pwd\n",
"current_dir=current_dir[0]\n",
"os.environ['KAGGLE_CONFIG_DIR']=current_dir"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4d7426c2-6f56-4efe-bde0-418dede06b24",
"metadata": {},
"outputs": [],
"source": [
"!${HOME}/.local/bin/kaggle datasets download mistag/arthropod-taxonomy-orders-object-detection-dataset"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "46a0bda9-757e-423f-a32e-8d8d4aa775d7",
"metadata": {},
"outputs": [],
"source": [
"!unzip -q *dataset.zip"
]
},
{
"cell_type": "markdown",
"id": "278a76ee-14f8-4f24-a1be-619104918a0e",
"metadata": {},
"source": [
"Now, you can run in order:\n",
"* dataprep.ipynb\n",
"* train.ipynb\n",
"* predict.ipynb"
]
},
{
"cell_type": "markdown",
"id": "439618be-3050-4df0-afd2-42b21b162864",
"metadata": {},
"source": [
"## License\n",
"\n",
"Copyright 2021 Google Inc. Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "80982d44-900d-4d84-b7ee-bfecbe38bbb7",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"environment": {
"kernel": "python3",
"name": "tf2-gpu.2-6.m87",
"type": "gcloud",
"uri": "gcr.io/deeplearning-platform-release/tf2-gpu.2-6:m87"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}