Giter Club home page Giter Club logo

mask-rcnn-for-off-nadir-building-detection's Introduction

Mask RCNN for Spacenet Off Nadir Building Detection

This repository reuses Matterport's Mask RCNN implementation. Kindly refer their repository here for further details on the core implementation. The pretrained weights were obtained from crowdAI's implementation found here.

Current Score:

mAP F1
30.4 37.9

Dataset

You can download the data via the following links:

Training data imagery:

aws s3 cp s3://spacenet-dataset/SpaceNet_Off-Nadir_Dataset/SpaceNet-Off-Nadir_Train/ . --exclude "*geojson.tar.gz" --recursive

Training data labels:

aws s3 cp s3://spacenet-dataset/SpaceNet_Off-Nadir_Dataset/SpaceNet-Off-Nadir_Train/geojson.tar.gz .

Refer the SpaceNet Off Nadir challenge page (link) for more details

Latest weights can be found here

Sample results

Sample results of using this model on Nadir (left, nadir angle=13°), Off Nadir (center, nadir angle=27°) and Very Off Nadir (right, nadir angle=50°) images are shown below.

Example result of MaskRCNN on SpaceNet Example result of MaskRCNN on SpaceNet Example result of MaskRCNN on SpaceNet

Notes:

  1. Currently, the model requires the training data to be in jpg. By default, the images in the SpaceNet dataset are in geotiff. You can do the conversion via gdal_translate from the GDAL library.
  2. Expected data format: MS COCO
  3. There is some issue with using the default cocoeval.py script for evaluating this dataset. Refer this notebook for calculating metrics.

About cocoeval

Be aware of area ranges and max detections in cocoeval.py. By default, the cocoeval script has the following configuration:

# Area Ranges

[[0 ** 2, 1e5 ** 2],   # all
[0 ** 2, 32 ** 2],      # small 
[32 ** 2, 96 ** 2],    # medium
[96 ** 2, 1e5 ** 2]]  #  large

# Max Detections
[1, 10, 100]

These area ranges and max detection settings might be appropriate for natural images (as in the COCO dataset) but tis not the case for satellite images. Objects in satellite images are generally smaller and much more numerous. Depending on your use case and your test set, you might need to alter these params accordingly for a better evaluation of your model.

mask-rcnn-for-off-nadir-building-detection's People

Contributors

ashnair1 avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mask-rcnn-for-off-nadir-building-detection's Issues

Getting the result of the prediction inference on large images

am using maskrcnn for the detection of oil slicks on the sea surface using radar images.
In fact, I trained Maskrcnn on a dataset of SAR images(tif). Everything works fine for the training. However, I have some issues to run the prediction on big images. When I give as input small images (2000,2000), it works. However, when I try bigger sized images, for instance, (8000,5000), it generates the error below:
Resource exhausted: OOM when allocating tensor with shape[1,64,7264,7264] .

Could you please give me more insight on the above issues?

I am trying to solve this by dividing the images into crops and running the prediction on every crop, then reconstructing the whole result of the image. The problem is that I don't know how to reconstruct the hole result:
for each crop I get the dictionary of the below arrays.
The dict contains -masks: [H, W, N] instance binary masks.
-rois: [N, (y1, x1, y2, x2)] detection bounding boxes
-class_ids: [N] int class IDs
-scores: [N] float probability scores for the class IDs
I manage to reconstruct the mask as I know the position of the crop in the big image.
However, for the rest of the dictionary elements, I can't figure out how to group them properly in one array each with respect to the original large image.
I thank you a lot in advance for your collaboration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.