This model is a
Mask R-CNN with a
ResNet-50 FPN backbone, trained for multi-class object detection on very high resolution (VHR) remote sensing imagery using the
NWPU-VHR-10 benchmark dataset.
The
NWPU-VHR-10 dataset was constructed by researchers at Northwestern Polytechnical University (NWPU). It contains:
Evaluated on the validation set (128 images) using standard COCO detection metrics:
1import geoai
2
3# Run inference on a remote sensing image
4result_path, inference_time, detections = geoai.multiclass_detection(
5 input_path="your_image.tif",
6 output_path="detections.tif",
7 model_path="best_model.pth",
8 num_classes=11,
9 class_names=[
10 "background", "airplane", "ship", "storage_tank",
11 "baseball_diamond", "tennis_court", "basketball_court",
12 "ground_track_field", "harbor", "bridge", "vehicle",
13 ],
14 window_size=512,
15 overlap=256,
16 confidence_threshold=0.5,
17)
18
19# Visualize results
20geoai.visualize_multiclass_detections(
21 image_path="your_image.tif",
22 detections=detections,
23 class_names=[
24 "background", "airplane", "ship", "storage_tank",
25 "baseball_diamond", "tennis_court", "basketball_court",
26 "ground_track_field", "harbor", "bridge", "vehicle",
27 ],
28)
1import torch
2import torchvision
3from torchvision.models.detection import maskrcnn_resnet50_fpn
4
5# Load model
6model = maskrcnn_resnet50_fpn(weights=None, num_classes=11)
7checkpoint = torch.load("best_model.pth", map_location="cpu")
8model.load_state_dict(checkpoint)
9model.eval()
10
11# Run inference
12from PIL import Image
13from torchvision import transforms
14
15img = Image.open("your_image.jpg").convert("RGB")
16img_tensor = transforms.ToTensor()(img).unsqueeze(0)
17
18with torch.no_grad():
19 predictions = model(img_tensor)
20
21# predictions[0] contains 'boxes', 'labels', 'scores', 'masks'
For a complete end-to-end example including dataset download, training, evaluation, and inference, see the
NWPU-VHR-10 Object Detection notebook.
1@article{cheng2014multi,
2 title={Multi-class geospatial object detection and geographic image classification based on collection of part detectors},
3 author={Cheng, Gong and Han, Junwei and Zhou, Peicheng and Guo, Lei},
4 journal={ISPRS Journal of Photogrammetry and Remote Sensing},
5 volume={98},
6 pages={119--132},
7 year={2014}
8}
9
10@article{cheng2016survey,
11 title={A survey on object detection in optical remote sensing images},
12 author={Cheng, Gong and Han, Junwei},
13 journal={ISPRS Journal of Photogrammetry and Remote Sensing},
14 volume={117},
15 pages={11--28},
16 year={2016}
17}
This model is released under the
MIT License. The NWPU-VHR-10 dataset is for research purposes only.