Skip to content

Latest commit

 

History

History
104 lines (69 loc) · 2.66 KB

quick_start_en.md

File metadata and controls

104 lines (69 loc) · 2.66 KB

简体中文 | English

Quick Start

Prerequisites

  1. Install PaddlePaddle
  • Version requirements: PaddlePaddle>=2.5.0
  1. Install PaddleRS

Check out releases of PaddleRS here. Download and extract the source code and run:

pip install -r requirements.txt
pip install .

The PaddleRS code will be updated as the development progresses. You can also install the develop branch to use the latest features as follows:

git clone https://github.com/PaddlePaddle/PaddleRS
cd PaddleRS
git checkout develop
pip install -r requirements.txt
pip install .
  1. (Optional) Install GDAL

PaddleRS supports reading of various types of satellite data. To use the full data reading functionality of PaddleRS, you need to install GDAL as follows:

  • Linux / MacOS

conda is recommended for installation:

conda install gdal
  • Windows

Windows users can download GDAL wheels from this site. Please choose the wheel according to the Python version and the platform. Take GDAL‑3.3.3‑cp39‑cp39‑win_amd64.whl as an example, run the following command to install:

pip install GDAL‑3.3.3‑cp39‑cp39‑win_amd64.whl
  1. (Optional) Install ext_op

PaddleRS supports rotated object detection, which requires the installation of the ext_op library before use. you need ti install ext_op as follows:

cd paddlers/models/ppdet/ext_op
python setup.py install

We also provide a Docker image for installation. Please see here for more details.

Model Training

See here.

Model Evaluation

After the model training is completed, you can evaluate the model by executing the following snippet (take DeepLab V3+ as an example):

import paddlers as pdrs
from paddlers import transforms as T

# Load the trained model
model = pdrs.load_model('output/deeplabv3p/best_model')

# Combine data transformation operators
eval_transforms = [
    T.Resize(target_size=512),
    T.Normalize(
        mean=[0.5] * NUM_BANDS, std=[0.5] * NUM_BANDS),
    T.ReloadMask()
]

# Load the validation dataset
dataset = pdrs.datasets.SegDataset(
    data_dir='dataset',
    file_list='dataset/val/list.txt',
    label_list='dataset/labels.txt',
    transforms=eval_transforms)

# Do the evaluation
result = model.evaluate(dataset)

print(result)

Model Deployment

Model Exporting

Please refer to this document.

Deployment Using Python

Please refer to this document.