Skip to content

Commit 0578c13

Browse files
authored
Merge pull request #165 from LokeZhou/deploy
Deploy
2 parents df4fbe3 + 8096914 commit 0578c13

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

deploy/groundingdino/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
## 1. 模型简介
44

5-
Paddle implementation of [Grounding DINO](https://arxiv.org/abs/2303.05499), a stronger open-set object detector.
5+
该模型是 [Grounding DINO](https://arxiv.org/abs/2303.05499) 的 paddle 实现。
66

77

8-
## 2. Demo
8+
## 2. 示例
99

10-
## 2.1 prepare
10+
## 2.1 依赖安装 (可选)
1111
```bash
1212
#Multi-scale deformable attention custom OP compilation
1313
cd /paddlemix/models/groundingdino/csrc/
1414
python setup_ms_deformable_attn_op.py install
1515

1616
```
17-
## 2.2 Export model for static inference
17+
## 2.2 静态图导出与预测
1818
```bash
19-
#export grounding dino model
19+
#静态图模型导出
2020
python export.py \
2121
--dino_type GroundingDino/groundingdino-swint-ogc
2222

2323

24-
#inference
24+
#静态图预测
2525
python predict.py \
2626
--text_encoder_type GroundingDino/groundingdino-swint-ogc \
2727
--model_path output_groundingdino/GroundingDino/groundingdino-swint-ogc \

deploy/sam/README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
1-
#
1+
# Segment Anything
22

33
## 1. 模型简介
44

5-
Paddle implementation of [Segment Anything](https://ai.facebook.com/research/publications/segment-anything/), produces high quality object masks from input prompts such as points or boxes.
5+
该模型是 [Segment Anything](https://ai.facebook.com/research/publications/segment-anything/) 的 paddle 实现, 可输入点或框进行分割。
66

77

8-
## 2. Demo
8+
## 2. 示例
99

10-
## 2.2 Export model for static inference
10+
## 2.1 静态图导出与预测
1111
```bash
12-
#export sam model input_type box
12+
#导出输入类型是 bbox 的静态图
1313
python export.py --model_type Sam/SamVitH-1024 --input_type boxs --save_dir sam_export
1414

15-
#export sam model input_type points
15+
#导出输入类型是 points 的静态图
1616
python export.py --model_type Sam/SamVitH-1024 --input_type points --save_dir sam_export
1717

1818

1919

20-
#boxs prompt
20+
#bbox 提示词推理
2121
python predict.py
2222
--input_image image_you_want_to_detect.jpg \
2323
--box_prompt 548 372 593 429 443 374 482 418 \
2424
--input_type boxs \
25+
--model_name_or_path Sam/SamVitH-1024 \
2526
--cfg sam_export_SamVitH_boxs/deploy.yaml
2627

27-
#points prompt
28+
#points 提示词推理
2829
python predict.py \
2930
--input_image mage_you_want_to_detect.jpg \
3031
--points_prompt 548 372 \
3132
--input_type points \
33+
--model_name_or_path Sam/SamVitH-1024 \
3234
--cfg sam_export_SamVitH_points/deploy.yaml
3335
```

deploy/sam/export.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def parse_args():
2626
parser = argparse.ArgumentParser(description="Export Inference Model.")
2727
parser.add_argument(
2828
"--model_type",
29-
choices=["SamVitL", "SamVitB", "SamVitH"],
29+
choices=["Sam/SamVitH-1024", "Sam/SamVitB", "Sam/SamVitL"],
3030
required=True,
3131
help="The model type.",
3232
type=str,

deploy/sam/predict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class ModelArguments:
244244
"""
245245

246246
model_name_or_path: str = field(
247-
default="Sam/SamVitH",
247+
default="Sam/SamVitH-1024",
248248
metadata={"help": "Path to pretrained model or model identifier"},
249249
)
250250
input_type: str = field(

paddlemix/examples/Sam/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#
1+
# Segment Anything
22

33
## 1. 模型简介
44

5-
Paddle implementation of [Segment Anything](https://ai.facebook.com/research/publications/segment-anything/), produces high quality object masks from input prompts such as points or boxes.
5+
该模型是 [Segment Anything](https://ai.facebook.com/research/publications/segment-anything/) 的 paddle 实现, 可输入点或框进行分割。
66

77

8-
## 2. Demo
98

10-
## 2.1 dynamic inference
9+
## 2. 示例
10+
11+
## 2.1 动态图推理
1112
```bash
1213
#box
1314
python run_predict.py \

paddlemix/examples/groundingdino/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
## 1. 模型简介
44

5-
Paddle implementation of [Grounding DINO](https://arxiv.org/abs/2303.05499), a stronger open-set object detector.
5+
该模型是 [Grounding DINO](https://arxiv.org/abs/2303.05499) 的 paddle 实现。
66

77

88
## 2. Demo
99

10-
## 2.1 prepare
10+
## 2.1 依赖安装(可选)
1111
```bash
1212
#Multi-scale deformable attention custom OP compilation
1313
cd /paddlemix/models/groundingdino/csrc/
1414
python setup_ms_deformable_attn_op.py install
1515

1616
```
17-
## 2.2 dynamic inference
17+
## 2.2 动态图推理
1818
```bash
1919
python run_predict.py \
2020
--input_image image_you_want_to_detect.jpg \

0 commit comments

Comments
 (0)