Skip to content

Conversation

xiaoshenlong17
Copy link

PR 类型

新增案例:PyTorch → Paddle 模型迁移

描述

  • 复现并迁移 ConvTemporalAttentionNet,用于 Sentinel-2 时间序列全景分割。
  • 提供完整训练/验证脚本、预训练权重、配置文件及 README。

包含文件

  • examples/satellite_panoptic/pretrained/model.pdparams
  • examples/satellite_panoptic/src/model_paddle.py
  • examples/satellite_panoptic/src/dataset_paddle.py
  • examples/satellite_panoptic/src/utils_paddle.py
  • examples/satellite_panoptic/train.py
  • examples/satellite_panoptic/validate.py
  • examples/satellite_panoptic/conf/satellite_panoptic.yaml
  • examples/satellite_panoptic/README.md

本地测试结果

  • SQ: 0.806
  • RQ: 0.494
  • PQ: 0.403

关联 Issue

Close #(如有)

备注

已在本地运行通过,CI 检查通过。

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

paddle-bot bot commented Aug 30, 2025

Thanks for your contribution!

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢提交PR,有几处修改建议,在代码提交前请使用pre-commit格式化代码

Image

Comment on lines 26 to 71
"""
Paddle Dataset class to load samples from the PASTIS dataset, for semantic and
panoptic segmentation.
The Dataset yields ((data, dates), target) tuples, where:
- data contains the image time series
- dates contains the date sequence of the observations expressed in number
of days since a reference date
- target is the semantic or instance target
Args:
folder (str): Path to the dataset
norm (bool): If true, images are standardised using pre-computed
channel-wise means and standard deviations.
reference_date (str, Format : 'YYYY-MM-DD'): Defines the reference date
based on which all observation dates are expressed. Along with the image
time series and the target tensor, this dataloader yields the sequence
of observation dates (in terms of number of days since the reference
date). This sequence of dates is used for instance for the positional
encoding in attention based approaches.
target (str): 'semantic' or 'instance'. Defines which type of target is
returned by the dataloader.
* If 'semantic' the target tensor is a tensor containing the class of
each pixel.
* If 'instance' the target tensor is the concatenation of several
signals, necessary to train the Parcel-as-Points module:
- the centerness heatmap,
- the instance ids,
- the voronoi partitioning of the patch with regards to the parcels'
centers,
- the (height, width) size of each parcel
- the semantic label of each parcel
- the semantic label of each pixel
cache (bool): If True, the loaded samples stay in RAM, default False.
mem16 (bool): Additional argument for cache. If True, the image time
series tensors are stored in half precision in RAM for efficiency.
They are cast back to float32 when returned by __getitem__.
folds (list, optional): List of ints specifying which of the 5 official
folds to load. By default (when None is specified) all folds are loaded.
class_mapping (dict, optional): Dictionary to define a mapping between the
default 18 class nomenclature and another class grouping, optional.
mono_date (int or str, optional): If provided only one date of the
available time series is loaded. If argument is an int it defines the
position of the date that is loaded. If it is a string, it should be
in format 'YYYY-MM-DD' and the closest available date will be selected.
sats (list): defines the satellites to use (only Sentinel-2 is available
in v1.0)
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类的docstring请移动到类名下方

## 参考
原始 PyTorch 实现:[GitHub Link](https://github.com/xxx)

---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除该行

Suggested change
---

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请在mkdocs.yml、README.md和index.md里新增案例链接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants