File tree 6 files changed +26
-23
lines changed
6 files changed +26
-23
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## 1. 模型简介
4
4
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 实现。
6
6
7
7
8
- ## 2. Demo
8
+ ## 2. 示例
9
9
10
- ## 2.1 prepare
10
+ ## 2.1 依赖安装 (可选)
11
11
``` bash
12
12
# Multi-scale deformable attention custom OP compilation
13
13
cd /paddlemix/models/groundingdino/csrc/
14
14
python setup_ms_deformable_attn_op.py install
15
15
16
16
```
17
- ## 2.2 Export model for static inference
17
+ ## 2.2 静态图导出与预测
18
18
``` bash
19
- # export grounding dino model
19
+ # 静态图模型导出
20
20
python export.py \
21
21
--dino_type GroundingDino/groundingdino-swint-ogc
22
22
23
23
24
- # inference
24
+ # 静态图预测
25
25
python predict.py \
26
26
--text_encoder_type GroundingDino/groundingdino-swint-ogc \
27
27
--model_path output_groundingdino/GroundingDino/groundingdino-swint-ogc \
Original file line number Diff line number Diff line change 1
- #
1
+ # Segment Anything
2
2
3
3
## 1. 模型简介
4
4
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 实现, 可输入点或框进行分割。
6
6
7
7
8
- ## 2. Demo
8
+ ## 2. 示例
9
9
10
- ## 2.2 Export model for static inference
10
+ ## 2.1 静态图导出与预测
11
11
``` bash
12
- # export sam model input_type box
12
+ # 导出输入类型是 bbox 的静态图
13
13
python export.py --model_type Sam/SamVitH-1024 --input_type boxs --save_dir sam_export
14
14
15
- # export sam model input_type points
15
+ # 导出输入类型是 points 的静态图
16
16
python export.py --model_type Sam/SamVitH-1024 --input_type points --save_dir sam_export
17
17
18
18
19
19
20
- # boxs prompt
20
+ # bbox 提示词推理
21
21
python predict.py
22
22
--input_image image_you_want_to_detect.jpg \
23
23
--box_prompt 548 372 593 429 443 374 482 418 \
24
24
--input_type boxs \
25
+ --model_name_or_path Sam/SamVitH-1024 \
25
26
--cfg sam_export_SamVitH_boxs/deploy.yaml
26
27
27
- # points prompt
28
+ # points 提示词推理
28
29
python predict.py \
29
30
--input_image mage_you_want_to_detect.jpg \
30
31
--points_prompt 548 372 \
31
32
--input_type points \
33
+ --model_name_or_path Sam/SamVitH-1024 \
32
34
--cfg sam_export_SamVitH_points/deploy.yaml
33
35
```
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def parse_args():
26
26
parser = argparse .ArgumentParser (description = "Export Inference Model." )
27
27
parser .add_argument (
28
28
"--model_type" ,
29
- choices = ["SamVitL " , "SamVitB" , "SamVitH " ],
29
+ choices = ["Sam/SamVitH-1024 " , "Sam/ SamVitB" , "Sam/SamVitL " ],
30
30
required = True ,
31
31
help = "The model type." ,
32
32
type = str ,
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ class ModelArguments:
244
244
"""
245
245
246
246
model_name_or_path : str = field (
247
- default = "Sam/SamVitH" ,
247
+ default = "Sam/SamVitH-1024 " ,
248
248
metadata = {"help" : "Path to pretrained model or model identifier" },
249
249
)
250
250
input_type : str = field (
Original file line number Diff line number Diff line change 1
- #
1
+ # Segment Anything
2
2
3
3
## 1. 模型简介
4
4
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 实现, 可输入点或框进行分割。
6
6
7
7
8
- ## 2. Demo
9
8
10
- ## 2.1 dynamic inference
9
+ ## 2. 示例
10
+
11
+ ## 2.1 动态图推理
11
12
``` bash
12
13
# box
13
14
python run_predict.py \
Original file line number Diff line number Diff line change 2
2
3
3
## 1. 模型简介
4
4
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 实现。
6
6
7
7
8
8
## 2. Demo
9
9
10
- ## 2.1 prepare
10
+ ## 2.1 依赖安装(可选)
11
11
``` bash
12
12
# Multi-scale deformable attention custom OP compilation
13
13
cd /paddlemix/models/groundingdino/csrc/
14
14
python setup_ms_deformable_attn_op.py install
15
15
16
16
```
17
- ## 2.2 dynamic inference
17
+ ## 2.2 动态图推理
18
18
``` bash
19
19
python run_predict.py \
20
20
--input_image image_you_want_to_detect.jpg \
You can’t perform that action at this time.
0 commit comments