fix parameters in export training data
"metadata": {},
"outputs": [],
"source": [
- "chips = export_training_data(planet_mosaic_data, well_pads, \"PNG\", {\"x\":448,\"y\":448}, {\"x\":224,\"y\":224}, \n",
- " \"PASCAL_VOC_rectangles\", 75, \"planetdemo\")"
+ "chips = export_training_data(input_raster=planet_mosaic_data,\n",
+ " input_class_data=well_pads,\n",
+ " chip_format=\"PNG\",\n",
+ " tile_size={\"x\":448,\"y\":448},\n",
+ " stride_size={\"x\":224,\"y\":224},\n",
+ " metadata_format=\"PASCAL_VOC_rectangles\",\n",
+ " classvalue_field='pad_type',\n",
+ " buffer_radius=75,\n",
+ " output_location=\"/rasterStores/rasterstorename/wellpaddata\")"
]
},
{
"source": [
"from arcgis.learn import prepare_data\n",
"\n",
- "data = prepare_data('/arcgis/directories/rasterstore/planetdemo', {1: ' Pad'})"
+ "data = prepare_data('/rasterStores/rasterstorename/wellpaddata', {1: ' Pad'})"
]
},
{
"outputs": [],
"source": [
"# save the trained model\n",
- "ssd.save('wellpad_planet_model')"
+ "ssd.save('wellpad_planet_model', publish=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Deploy trained model"
+ "Once a model has been trained, it can be added to ArcGIS Enterprise as a deep learning package by passing ``publish=True`` parameter."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Once a model has been trained, it can be added to ArcGIS Enterprise as a deep learning package."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 13,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Upload as first class item on agol or portal as a deep learning package \n",
- "trained_model = '/arcgis/directories/rasterstore/planetdemo/models/wellpad_model_planet_2501/wellpad_model_planet_2501.zip'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 14,
- "metadata": {},
- "outputs": [],
- "source": [
- "model_package = gis.content.add(item_properties={\"type\":\"Deep Learning Package\",\"typeKeywords\":\"Deep Learning, Raster\",\n",
- " \"title\":\"Well Pad Detection Model Planet 2501\",\n",
- " \"tags\":\"deeplearning\", 'overwrite':'True'}, data=trained_model)\n",
- "# Or publish using:\n",
- "# ssd.save('Well Pad Detection Model Planet 2501', publish=True, gis=gis)"
+ "## Model management"
]
},
{
}
],
"source": [
+ "model_package = gis.content.get('id=32cb1df2834943f7a6ff3ab461aa9352')\n",
"model_package"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Model management"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.10"
+ "version": "3.7.11"
},
"toc": {
"base_numbering": 1,
