Skip to main content

AI for Earth project to map center pivots and monitor crop water use.

Project description

Code style: black

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) Center Pivot Detections

Local Installation of cropmask dependencies, see terraform/ folder for instructions to set up azure components.

  1. 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
    
  2. Create a file called .lsru at ~ and fill in your NASA Earth Explorer Login credentials

    [usgs]
    username=
    password=
    
  3. Copy the azure_configs_template.yaml, name it azure_configs.yaml and place it outside of the git repository (so you don't accidently commit it). Fill it in according to the comments int he template.

  4. Download the National WBD Dataset

  5. 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

  6. Download pre-trained COCO weights (mask_rcnn_coco.h5) from the releases page.

  7. (Optional) To train or test on MS COCO install pycocotools from 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).

  8. 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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cropmask-0.1.tar.gz (25.3 MB view details)

Uploaded Source

Built Distribution

cropmask-0.1-py2.py3-none-any.whl (291.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cropmask-0.1.tar.gz.

File metadata

  • Download URL: cropmask-0.1.tar.gz
  • Upload date:
  • Size: 25.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for cropmask-0.1.tar.gz
Algorithm Hash digest
SHA256 e5fdca49aa731a06dfb33a6db42550128f97a9573413f738d0e90dcba821b726
MD5 bb73db1052c60d3b3171f8134e61bc2e
BLAKE2b-256 7ce5ee15c4dbbf374dcd61a52493f2b1dd16cdbd8b630b5898258a6edf05908a

See more details on using hashes here.

File details

Details for the file cropmask-0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: cropmask-0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 291.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for cropmask-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f196d8520cec961375172d4b9dc19773df207c681542932514fcff7e75d02c04
MD5 e4e83364580f9b9b73a741a355406ca6
BLAKE2b-256 141193b686fb899fd80c296f9f93f168776564b6858044c0039ff2d5a45b0649

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page