Deep Learning Python raster function For ArcGIS
Deep learning model inferencing in ArcGIS is implemented on top of the Python raster function framework. This repository serves to provide guidance on deep learning Python raster functions in ArcGIS, and to educate users on how to create custom Python raster functions to integrate additional deep learning models with the ArcGIS platform.
Deep learning in ArcGIS requires one of the following products:
- ArcGIS Pro 2.3 or later.
- ArcGIS Enterprise 10.7 or later.
An ArcGIS Image Analyst license is required to run inferencing tools.
CPU or NVIDIA GPU + CUDA CuDNN
Clone raster-deep-learning repository:
git clone https://github.com/Esri/raster-deep-learning.git
- Use the link above to download the sample data and models for four different model frameworks.
Set up the Python deep learning environment in ArcGIS, and install the required deep learning libraries listed in requirements.txt.
Install Python environments in ArcGIS Pro using the ArcGIS Pro Python Package Manager.
Alternatively, ArcGIS Pro users can use this batch file env_setup.bat at the root directory to automatically install all the required deep learning libraries for the sample cases in this repository. NOTE: By default, the batch installation will take up 5 GB of disk space on the C:/ drive (or the disk where ArcGIS Pro is installed). To execute the batch file, right click the batch file and choose to Run as Administrator. This installation takes less than 5 minutes to run on the author's test machine.
For ArcGIS Enterprise users, the deep learning libraries need to be installed to the Python environment on each raster analytics server machine: C:\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python. The batch file env_setup_server_tensorflow.bat at root directory automates the TensorFlow environment setup process for ArcGIS Enterprise 10.7, specifically. It is not recommended to install different deep learning frameworks (TensorFlow, Keras, PyTorch, etc) into one Enterprise Python environment.
NOTE: By default, batch installation will take ~2-3 GB of disk space on the C:/ drive (or the disk where ArcGIS server is installed). To execute the batch file, right click the batch file and choose to Run as Administrator. This installation takes less than 5 minutes to run on the author's test machine. Once you finish setting up the Python environment, you will need to restart the ArcGIS server. For more details on setting up the Enterprise environment, see Configure ArcGIS Image Server for deep learning raster analytics.
If you prefer to manually setup the deep learning Python environment using command lines, see the example below which installs TensorFlow on the ArcGIS raster analytics server:
Step1: Change Directory to ArcGIS python scripts directory. cd C:\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts Step2: Clone a new ArcGIS python environment for deep learning. conda create --name deeplearning_env_name --clone arcgispro-py3 Step3: Activate the new python environment. activate deeplearning_env_name Step4: Install tensorflow or tensorflow-gpu in the new python environment. conda install tensorflow Step5: Swap it to the activate python environment of the ArcGIS servers. proswap deeplearning_env_name
Get familiar with the format and requirements of the Esri model definition file (emd).
(Optional) Get familiar with Python raster function. Anatomy of a Python Raster Function.
(Optional) If you are interested in writing custom deep learning Python raster function to integrate additional deep learning models into ArcGIS, the Custom Python raster function guide provides details on the necessary functions and how to implement model inference calls using Python raster function.
We provide deep learning model inference Python raster function (PRF) for a list of open source deep learning model configurations.
Click on the model configuration name to go to the corresponding GitHub repository or project landing page for that model.
Python Raster function templates are provided for object detection and pixel-level image classification (Image Segmentation in Computer Vision).
Did you find a bug or do you want to request a new feature? Please let us know by submitting an issue.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
Copyright 2019 Esri
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
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.
A copy of the license is available in the repository's license.txt file.