AI for Earth project to map center pivots and monitor crop water use.
CropMask is a project to train and deploy instance segmentation models for mapping center pivot agriculture from multispectral satellite imagery. It extends matterport's module , which is an implementation of Mask R-CNN on Python 3, Keras, and TensorFlow. CropMask work with multispectral satellite imagery, contains infrastructure-as-code via terraform to provision a testing cluster on Azure, and will eventually contain a Leaflet or OpenLayers web app to expose maps of crop water use in drylands across the globe.
See matterport's mrcnn repo for an explanation of the Mask R-CNN architecture and a general guide to notebook tutorials and notebooks for inspecting model inputs and outputs.
For an overview of the project in poster form, see this poster I presented at the Fall 2018 Meeting on Center Pivot Crop Water Use.
Below are Preliminary results from test on 2004 Landsat SR scene over western Nebraska. Detections are in Red, Targets from the Nebraska Department of Agriculture are in Green. Metrics are (probability score)/(intersection over union)
Local Installation of cropmask dependencies, see
terraform/ folder for instructions to set up azure components.
Install dependencies and install the package
conda env create -f cropmask-env.yml python setup.py install # use develop instead of install for editable mode
Create a file called
~and fill in your NASA Earth Explorer Login credentials
[usgs] username= password=
azure_configs_template.yaml, name it
azure_configs.yamland place it outside of the git repository (so you don't accidently commit it). Fill it in according to the comments int he template.
Download the National WBD Dataset
Find the watershed you'd like to get Landsat imagery for with this tool. Make note of the HUC ID and the HUC level (the number of digits in the HUC ID) and put these in your azure_config.yaml file
Download pre-trained COCO weights (mask_rcnn_coco.h5) from the releases page.
(Optional) To train or test on MS COCO install
pycocotoolsfrom one of these repos. They are forks of the original pycocotools with fixes for Python3 and Windows (the official repo doesn't seem to be active anymore).
To train using labels from the Nebraska 2005 Center Pivots Dataset and define the projection as Nebraska State Plane NAD 1983 in US Feet, which is EPSG code 102704
This setup will allow you to run the parts of the project that don't require Azure, like locally downloading Landsat products according to watershed boundaries. For instructions on setting up the entire project on Azure, see the README in the terraform folder
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size cropmask-0.1-py2.py3-none-any.whl (291.7 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View hashes|
|Filename, size cropmask-0.1.tar.gz (25.3 MB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for cropmask-0.1-py2.py3-none-any.whl