简体中文 | English
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 .
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:
conda is recommended for installation:
conda install gdal
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
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.
See here.
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)
Please refer to this document.
Please refer to this document.