Skip to content

Commit

Permalink
update sam groundingdino README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
LokeZhou committed Sep 18, 2023
1 parent df4fbe3 commit 3372c30
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
12 changes: 6 additions & 6 deletions deploy/groundingdino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

## 1. 模型简介

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


## 2. Demo
## 2. 示例

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

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


#inference
#静态图预测
python predict.py \
--text_encoder_type GroundingDino/groundingdino-swint-ogc \
--model_path output_groundingdino/GroundingDino/groundingdino-swint-ogc \
Expand Down
18 changes: 10 additions & 8 deletions deploy/sam/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
#
# Segment Anything

## 1. 模型简介

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.
该模型是 [Segment Anything](https://ai.facebook.com/research/publications/segment-anything/)的 paddle 实现, 可输入点或框进行分割。


## 2. Demo
## 2. 示例

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

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



#boxs prompt
#bbox 提示词
python predict.py
--input_image image_you_want_to_detect.jpg \
--box_prompt 548 372 593 429 443 374 482 418 \
--input_type boxs \
--model_name_or_path Sam/SamVitH-1024 \
--cfg sam_export_SamVitH_boxs/deploy.yaml

#points prompt
#points 提示词
python predict.py \
--input_image mage_you_want_to_detect.jpg \
--points_prompt 548 372 \
--input_type points \
--model_name_or_path Sam/SamVitH-1024 \
--cfg sam_export_SamVitH_points/deploy.yaml
```
2 changes: 1 addition & 1 deletion deploy/sam/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def parse_args():
parser = argparse.ArgumentParser(description="Export Inference Model.")
parser.add_argument(
"--model_type",
choices=["SamVitL", "SamVitB", "SamVitH"],
choices=["Sam/SamVitH-1024", "Sam/SamVitB", "Sam/SamVitL"],
required=True,
help="The model type.",
type=str,
Expand Down
2 changes: 1 addition & 1 deletion deploy/sam/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class ModelArguments:
"""

model_name_or_path: str = field(
default="Sam/SamVitH",
default="Sam/SamVitH-1024",
metadata={"help": "Path to pretrained model or model identifier"},
)
input_type: str = field(
Expand Down
9 changes: 5 additions & 4 deletions paddlemix/examples/Sam/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#
# Segment Anything

## 1. 模型简介

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.
该模型是 [Segment Anything](https://ai.facebook.com/research/publications/segment-anything/)的 paddle 实现, 可输入点或框进行分割。


## 2. Demo

## 2.1 dynamic inference
## 2. 示例

## 2.1 动态图推理
```bash
#box
python run_predict.py \
Expand Down
6 changes: 3 additions & 3 deletions paddlemix/examples/groundingdino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

## 1. 模型简介

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


## 2. Demo

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

```
## 2.2 dynamic inference
## 2.2 动态图推理
```bash
python run_predict.py \
--input_image image_you_want_to_detect.jpg \
Expand Down

0 comments on commit 3372c30

Please sign in to comment.