Skip to content

Commit

Permalink
prepare for 3.0b2 (#2432)
Browse files Browse the repository at this point in the history
* prepare for 3.0b2

* precommit all files
  • Loading branch information
cuicheng01 authored Nov 8, 2024
1 parent 58a6f48 commit cae6039
Show file tree
Hide file tree
Showing 54 changed files with 464 additions and 393 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/1_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ assignees: ''

## Checklist:

1. 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
2. 翻阅[FAQ常见问题汇总和答疑](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md)
3. 确认bug是否在新版本里还未修复
4. 翻阅[PaddleX数据准备文档](https://github.com/PaddlePaddle/PaddleX/tree/develop#2-%E6%95%B0%E6%8D%AE%E5%87%86%E5%A4%87)
- [ ] 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
- [ ] 翻阅[FAQ](https://paddlepaddle.github.io/PaddleX/main/FAQ.html)
- [ ] 翻阅[PaddleX 文档](https://paddlepaddle.github.io/PaddleX/main/index.html)
- [ ] 确认bug是否在新版本里还未修复

## 描述问题

Expand Down
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/2--paddlex-api----.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ assignees: ''

## Checklist:

1. 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
2. 翻阅[FAQ常见问题汇总和答疑](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md)
3. 确认bug是否在新版本里还未修复
4. 翻阅[PaddleX API文档说明](https://github.com/PaddlePaddle/PaddleX/tree/develop#paddlex-%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3)
- [ ] 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
- [ ] 翻阅[FAQ](https://paddlepaddle.github.io/PaddleX/main/FAQ.html)
- [ ] 翻阅[PaddleX 文档](https://paddlepaddle.github.io/PaddleX/main/index.html)
- [ ] 确认bug是否在新版本里还未修复

## 描述问题

## 复现

1. 您是否已经正常运行我们提供的[教程](https://github.com/PaddlePaddle/PaddleX/tree/develop/tutorials)
1. 您是否已经正常运行我们提供的[教程](https://paddlepaddle.github.io/PaddleX/main/index.html)

2. 您是否在教程的基础上修改代码内容?还请您提供运行的代码

Expand Down
34 changes: 19 additions & 15 deletions .github/ISSUE_TEMPLATE/3_deploy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 3. 模型部署
about: 模型部署相关问题,包括C++、Python、C#部署等
about: 模型部署相关问题,包括高性能推理、服务化部署、端侧部署等
title: ''
labels: ''
assignees: ''
Expand All @@ -9,38 +9,42 @@ assignees: ''

## Checklist:

1. 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
2. 翻阅[FAQ常见问题汇总和答疑](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md)
3. 确认bug是否在新版本里还未修复
4. 翻阅[PaddleX 部署文档说明](https://github.com/PaddlePaddle/PaddleX/tree/develop#5-%E6%A8%A1%E5%9E%8B%E9%83%A8%E7%BD%B2)
- [ ] 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
- [ ] 翻阅[FAQ](https://paddlepaddle.github.io/PaddleX/main/FAQ.html)
- [ ] 翻阅[PaddleX 文档](https://paddlepaddle.github.io/PaddleX/main/index.html)
- [ ] 确认bug是否在新版本里还未修复

## 描述问题

## 复现

1. c++部署方式
1. 高性能推理

* 您是否按照文档教程已经正常运行我们提供的[demo](https://github.com/PaddlePaddle/PaddleX/tree/develop/deploy/cpp/demo)
* 您是否完全按照[高性能推理文档教程](https://paddlepaddle.github.io/PaddleX/main/pipeline_deploy/high_performance_inference.html)跑通了流程

* 您是否在demo基础上修改代码内容?还请您提供运行的代码
* 您使用的是离线激活方式还是在线激活方式?

2. c#部署方式
2. 服务化部署

* 您是否按照文档教程已经正常运行我们提供的[demo](https://github.com/PaddlePaddle/PaddleX/tree/develop/examples/C%23_deploy)
* 您是否完全按照[服务化部署文档教程](https://paddlepaddle.github.io/PaddleX/main/pipeline_deploy/service_deploy.html)跑通了流程

* 您是否在demo基础上修改代码内容?还请您提供运行的代码
* 您在服务化部署中是否有使用高性能推理插件,如果是,您使用的是离线激活方式还是在线激活方式?

* 如果是多语言调用的问题,请给出调用示例子。

3. 端侧部署
* 您是否完全按照[端侧部署文档教程](https://paddlepaddle.github.io/PaddleX/main/pipeline_deploy/edge_deploy.html)跑通了流程?

* 您使用的端侧设备是?对应的PaddlePaddle版本和PaddleLite版本分别是什么?

* 如果c# demo无法正常运行,c++ [demo](https://github.com/PaddlePaddle/PaddleX/tree/develop/deploy/cpp/demo)是否已经正常运行?

3. 您使用的**模型****数据集**是?

4. 请提供您出现的报错信息及相关log

## 环境

1. 如果您使用的是python部署方式,请提供您使用的PaddlePaddle、PaddleX版本号、Python版本号

2. 如果您使用的是c++或c#部署方式,请提供您使用的PaddleX分支、推理引擎(例如PaddleInference)版本号
1. 请提供您使用的PaddlePaddle、PaddleX版本号、Python版本号

3. 请提供您使用的操作系统信息,如Linux/Windows/MacOS

Expand Down
20 changes: 8 additions & 12 deletions .github/ISSUE_TEMPLATE/4_gui.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 4. PaddleX可视化客户端使用问题
about: PaddleX可视化客户端使用问题
name: 4. 星河零代码产线使用问题
about: 星河零代码产线使用问题
title: ''
labels: ''
assignees: ''
Expand All @@ -9,19 +9,15 @@ assignees: ''

## Checklist:

1. 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
2. 翻阅[FAQ常见问题汇总和答疑](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md)
3. 确认bug是否在新版本里还未修复
4. 如果bug是由PaddleX API 2.0导致,且该bug在develop分支里已修复,参考[FAQ Q4](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md#gui%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98)替换内置PaddleX API
- [ ] 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
- [ ] 翻阅[FAQ](https://paddlepaddle.github.io/PaddleX/main/FAQ.html)
- [ ] 翻阅[PaddleX 文档](https://paddlepaddle.github.io/PaddleX/main/index.html)
- [ ] 如果是数据校验问题,请确保在开源PaddleX中可以通过数据校验

## 描述问题

## 复现

1. 请提供您出现的报错信息及相关log(log的查找见 [FAQ Q2](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md#gui%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98)
1. 请提供您出现的报错信息及相关log

2. 请提供您使用的GUI版本号

3. 请提供您使用的操作系统信息,如Linux/Windows/MacOS

4. 请问您使用的CUDA/cuDNN的版本号是?
2. 请提供您的星河uid和产线id
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/5_other.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ assignees: ''

## Checklist:

1. 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
2. 翻阅[FAQ常见问题汇总和答疑](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/FAQ/FAQ.md)
3. 确认bug是否在新版本里还未修复
4. 翻阅[PaddleX 使用文档](https://github.com/PaddlePaddle/PaddleX/tree/develop#paddlex-%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3)
- [ ] 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
- [ ] 翻阅[FAQ](https://paddlepaddle.github.io/PaddleX/main/FAQ.html)
- [ ] 翻阅[PaddleX 文档](https://paddlepaddle.github.io/PaddleX/main/index.html)
- [ ] 确认bug是否在新版本里还未修复

## 描述问题

## 复现

1. 您是否已经正常运行我们提供的[教程](https://github.com/PaddlePaddle/PaddleX/tree/develop/tutorials)
1. 您是否已经正常运行我们提供的[教程](https://paddlepaddle.github.io/PaddleX/main/index.html)

2. 您是否在教程的基础上修改代码内容?还请您提供运行的代码

Expand Down
16 changes: 14 additions & 2 deletions .github/ISSUE_TEMPLATE/6_hardware_contribute.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# 说明
---
name: 6. 新硬件贡献
about: 请描述您准备贡献的模型与芯片信息
title: ''
labels: ''
assignees: ''

---

## Checklist:

- [ ] 查找[历史相关issue](https://github.com/PaddlePaddle/PaddleX/issues)寻求解答
- [ ] 翻阅[FAQ](https://paddlepaddle.github.io/PaddleX/main/FAQ.html)
- [ ] 翻阅[PaddleX 文档](https://paddlepaddle.github.io/PaddleX/main/index.html)

1. 请描述您准备贡献的模型与芯片信息

# 环境

Expand Down
13 changes: 0 additions & 13 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
## 此为PR说明模版

如提交的为部署C++代码,请确认以下自测点是否完成(完成勾选即可),并保留以下的自测点列表,便于Reviewer知晓。

- [ ] Linux下测试通过
- - [ ] batch = 1 预测
- - [ ] batch > 1预测
- - [ ] 多GPU卡预测
- - [ ] TensorRT预测
- - [ ] Triton预测
- [ ] Windows下测试通过
- - [ ] batch = 1预测
- - [ ] batch > 1预测
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ PaddleX的各个产线均支持本地**快速推理**,部分模型支持在[AI

### 🛠️ 安装

> ❗安装 PaddleX 前请先确保您有基础的 **Python 运行环境**(注:当前支持Python 3.8 ~ Python 3.10下运行,更多Python版本适配中)。
> ❗安装 PaddleX 前请先确保您有基础的 **Python 运行环境**(注:当前支持Python 3.8 ~ Python 3.10下运行,更多Python版本适配中)。PaddleX 3.0-beta2 版本依赖的 PaddlePaddle 版本为 3.0.0b2。
* **安装 PaddlePaddle**
```bash
Expand All @@ -377,7 +377,7 @@ python -m pip install paddlepaddle-gpu==3.0.0b2 -i https://www.paddlepaddle.org.
* **安装PaddleX**

```bash
pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0b1-py3-none-any.whl
pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0b2-py3-none-any.whl
```

> ❗ 更多安装方式参考 [PaddleX 安装教程](https://paddlepaddle.github.io/PaddleX/latest/installation/installation.html)
Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ In addition, PaddleX provides developers with a full-process efficient model tra

### 🛠️ Installation

> ❗Before installing PaddleX, please ensure you have a basic **Python environment** (Note: Currently supports Python 3.8 to Python 3.10, with more Python versions being adapted).
> ❗Before installing PaddleX, please ensure you have a basic **Python environment** (Note: Currently supports Python 3.8 to Python 3.10, with more Python versions being adapted). The PaddleX 3.0-beta2 version depends on PaddlePaddle version 3.0.0b2.
* **Installing PaddlePaddle**

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/installation.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ After installing PaddlePaddle (refer to the [PaddlePaddle Local Installation Tut
> ❗ <b>Note</b>: Please ensure that PaddlePaddle is successfully installed before proceeding to the next step.
```bash
pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0b1-py3-none-any.whl
pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0b2-py3-none-any.whl
```

### 1.2 Plugin Installation Mode
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PaddleX为您提供了两种安装模式:<b>Wheel包安装</b>和<b>插件安
> ❗ 注:请务必保证 PaddlePaddle 安装成功,安装成功后,方可进行下一步。
```bash
pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0b1-py3-none-any.whl
pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0b2-py3-none-any.whl
```
### 1.2 插件安装模式
若您使用PaddleX的应用场景为<b>二次开发</b> (例如重新训练模型、微调模型、自定义模型结构、自定义推理代码等),那么推荐您使用<b>功能更加强大</b>的插件安装模式。
Expand Down
2 changes: 1 addition & 1 deletion paddlex/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0.beta1
3.0.0.beta2
2 changes: 0 additions & 2 deletions paddlex/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

# copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion paddlex/inference/models/object_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _build_components(self):
"img_size": "img_size",
}
)

self._add_component(
[
predictor,
Expand Down
9 changes: 7 additions & 2 deletions paddlex/inference/pipelines/ppchatocrv3/ppchatocrv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,13 @@ def get_visual_result(
if isinstance(all_curve_res, dict):
all_curve_res = [all_curve_res]
for sub, curve_res in zip(curve_subs, all_curve_res):
dt_polys_list = [list(map(list, sublist)) for sublist in curve_res["dt_polys"]]
sorted_items = sorted(zip(dt_polys_list, curve_res["rec_text"]), key=lambda x: (x[0][0][1], x[0][0][0]))
dt_polys_list = [
list(map(list, sublist)) for sublist in curve_res["dt_polys"]
]
sorted_items = sorted(
zip(dt_polys_list, curve_res["rec_text"]),
key=lambda x: (x[0][0][1], x[0][0][0]),
)
_, sorted_text = zip(*sorted_items)
structure_res.append(
{
Expand Down
6 changes: 3 additions & 3 deletions paddlex/inference/utils/official_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@
"RT-DETR-H_layout_3cls": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/RT-DETR-H_layout_3cls_infer.tar",
"RT-DETR-H_layout_17cls": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/RT-DETR-H_layout_17cls_infer.tar",
"PicoDet_LCNet_x2_5_face": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/PicoDet_LCNet_x2_5_face_infer.tar",
"BlazeFace": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/BlazeFace_infer.tar",
"BlazeFace-FPN-SSH": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/BlazeFace-FPN-SSH_infer.tar",
"BlazeFace": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/BlazeFace_infer.tar",
"BlazeFace-FPN-SSH": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/BlazeFace-FPN-SSH_infer.tar",
"PP-YOLOE_plus-S_face": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/PP-YOLOE_plus-S_face_infer.tar",
"MobileFaceNet": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/MobileFaceNet_infer.tar",
"ResNet50_face": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/ResNet50_face_infer.tar"
"ResNet50_face": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b1_v2/ResNet50_face_infer.tar",
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def check_dataset(dataset_dir, output, sample_num=10):
mapping_file = osp.join(dataset_dir, f"{tag}.txt")
if not osp.exists(mapping_file):
info(f"The mapping file ({mapping_file}) doesn't exist, ignored.")
info("If you are using MVTec_AD dataset, add args below in your training commands:")
info(
"If you are using MVTec_AD dataset, add args below in your training commands:"
)
info("-o CheckDataset.convert.enable=True")
info("-o CheckDataset.convert.src_dataset_type=MVTec_AD")
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from .....utils import logging
from .....utils.logging import info


def convert_dataset(dataset_type, input_dir):
"""convert to paddlex official format"""
if dataset_type == "LabelMe":
Expand Down Expand Up @@ -166,7 +167,7 @@ def polygon2mask(img_size, points):

def save_item_to_txt(items, file_path):
try:
with open(file_path, 'a') as file:
with open(file_path, "a") as file:
file.write(items)
file.close()
except Exception as e:
Expand All @@ -177,34 +178,53 @@ def save_training_txt(cls_root, mode, cat):
imgs = os.listdir(os.path.join(cls_root, mode, cat))
imgs.sort()
for img in imgs:
if mode == 'train':
if mode == "train":
item = os.path.join(cls_root, mode, cat, img)
items = item + ' ' + item + '\n'
save_item_to_txt(items, os.path.join(cls_root, 'train.txt'))
elif mode == 'test' and cat != 'good':
items = item + " " + item + "\n"
save_item_to_txt(items, os.path.join(cls_root, "train.txt"))
elif mode == "test" and cat != "good":
item1 = os.path.join(cls_root, mode, cat, img)
item2 = os.path.join(cls_root, 'ground_truth', cat, img.split('.')[0]+'_mask.png')
items = item1 + ' ' + item2 + '\n'
save_item_to_txt(items, os.path.join(cls_root, 'val.txt'))
item2 = os.path.join(
cls_root, "ground_truth", cat, img.split(".")[0] + "_mask.png"
)
items = item1 + " " + item2 + "\n"
save_item_to_txt(items, os.path.join(cls_root, "val.txt"))


def check_old_txt(cls_pth, mode):
set_name = 'train.txt' if mode == 'train' else 'val.txt'
set_name = "train.txt" if mode == "train" else "val.txt"
pth = os.path.join(cls_pth, set_name)
if os.path.exists(pth):
os.remove(pth)


def convert_mvtec_dataset(input_dir):
classes = ['bottle', 'cable', 'capsule', 'hazelnut', 'metal_nut', 'pill', 'screw',
'toothbrush', 'transistor', 'zipper', 'carpet', 'grid', 'leather', 'tile', 'wood']
classes = [
"bottle",
"cable",
"capsule",
"hazelnut",
"metal_nut",
"pill",
"screw",
"toothbrush",
"transistor",
"zipper",
"carpet",
"grid",
"leather",
"tile",
"wood",
]
clas = os.path.split(input_dir)[-1]
assert clas in classes, info(f"Make sure your class: '{clas}' in your dataset root in\n {classes}")
modes = ['train', 'test']
assert clas in classes, info(
f"Make sure your class: '{clas}' in your dataset root in\n {classes}"
)
modes = ["train", "test"]
cls_root = input_dir
for mode in modes:
check_old_txt(cls_root, mode)
cats = os.listdir(os.path.join(cls_root, mode))
for cat in cats:
save_training_txt(cls_root, mode, cat)
info(f"Add train.txt/val.txt successfully for {input_dir}")
info(f"Add train.txt/val.txt successfully for {input_dir}")
4 changes: 1 addition & 3 deletions paddlex/modules/anomaly_detection/model_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@
# limitations under the License.


MODELS = [
"STFPM"
]
MODELS = ["STFPM"]
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def check_train(dataset_dir, output, sample_num=10):
attrs["train_sample_paths"] = sample_paths
return attrs


def check_val(dataset_dir, output, sample_num=10):
"""check dataset"""
dataset_dir = osp.abspath(dataset_dir)
Expand Down
Loading

0 comments on commit cae6039

Please sign in to comment.