road cracks data provided
"## Table of Contents\n",
"* [Introduction and objective](#Introduction-and-objective)\n",
"* [Necessary imports](#Necessary-imports)\n",
+ "* [Prepare data that will be used for training](#Prepare-data-that-will-be-used-for-training)\n",
"* [Model training](#Model-training)\n",
" * [Visualize training data](#Visualize-training-data)\n",
" * [Load model architecture](#Load-model-architecture)\n",
"outputs": [],
"source": [
"import pandas as pd\n",
+ "import os\n",
+ "import shutil\n",
+ "from pathlib import Path\n",
"\n",
"from arcgis.learn import SingleShotDetector, prepare_data"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Prepare data that will be used for training"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "You can download pavement cracks data from the followimg link: https://mycityreport.s3-ap-northeast-1.amazonaws.com/02_RoadDamageDataset/RoadDamageDataset.tar.gz. Extract the downloaded file and run the code below to prepare data in a format that deep learning models expect."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Please uncomment the following code to prepare your training data.\n",
+ "\n",
+ "# input_path = Path(input(\"Enter the path where you extracted data: \"))\n",
+ "# output_path = Path(input(\"Enter the path where you want to create training data: \"))\n",
+ "# try:\n",
+ "# if not os.path.exists(output_path/'images') and os.path.exists(output_path/'labels'):\n",
+ "# os.mkdir(output_path/'images')\n",
+ "# os.mkdir(output_path/'labels')\n",
+ "# except: raise\n",
+ "# for fl in os.listdir(input_path):\n",
+ "# if not(fl.startswith(\".\")):\n",
+ "# for f in os.listdir(input_path/fl/'Annotations'):\n",
+ "# if not(f.startswith(\".\")):\n",
+ "# img_name = f.split('.')[0] + '.jpg'\n",
+ " \n",
+ "# shutil.copyfile(input_path/fl/'JPEGImages'/img_name, output_path/'images'/img_name)\n",
+ "# shutil.copyfile(input_path/fl/'Annotations'/f, output_path/'labels'/f)"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
