Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YOLO-World forward and inference #530

Merged
merged 19 commits into from
May 24, 2024

Conversation

InsaneOnion
Copy link
Contributor

@InsaneOnion InsaneOnion commented May 11, 2024

Add YOLO-World forward and inference
some examples of forward alignment:

  1. bus.jpg
    torch commands: python image_demo.py configs/pretrain/yolo_world_v2_x_vlpan_bn_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py /home/onion/workspace/code/PaddleMIX/ppdiffusers/examples/YOLO-World/pretrain/yolo_world_v2_x_obj365v1_goldg_cc3mlite_pretrain-8698fbfa.pth /home/onion/
    bus.jpg 'person,bus' --topk 100 --threshold 0.001 --output-dir /home/onion/out/
    paddle commands: python infer.py --config configs/yolo_world_x.yml -o weights=./pretrain/yolo_world_v2_x_obj365v1_goldg_cc3mlite_pretrain-8698fbfa.pdparams --image /home/onion/bus.jpg --text 'person,bus' --topk 100 --threshold 0.01 --output_dir "/home/onion/out"
  1. zidane.jpg
    torch commands: python image_demo.py configs/pretrain/yolo_world_v2_x_vlpan_bn_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py /home/onion/workspace/code/PaddleMIX/ppdiffusers/examples/YOLO-World/pretrain/yolo_world_v2_x_obj365v1_goldg_cc3mlite_pretrain-8698fbfa.pth /home/onion/
    zidane.jpg 'bald man,white haired man' --topk 100 --threshold 0.001 --output-dir /home/onion/out/
    paddle commands: python infer.py --config configs/yolo_world_x.yml -o weights=./pretrain/yolo_world_v2_x_obj365v1_goldg_cc3mlite_pretrain-8698fbfa.pdparams --image /home/onion/zidane.jpg --text 'bald man,white haired man' --topk 100 --threshold 0.001 --output_dir "/home/onion/out"

Copy link

paddle-bot bot commented May 11, 2024

Thanks for your contribution!

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label May 17, 2024
@luotao1 luotao1 assigned luotao1 and LokeZhou and unassigned zhiboniu May 17, 2024
```bash
python pretrain/torch2paddle.py <path_to_weight.pth> -p <path_to_weight.pdparams>
```

Copy link
Collaborator

Choose a reason for hiding this comment

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

可以把转后的权重分享,这边上传自动下载,省略这一步

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的, 已在README中修改~

# 安装2.6.0版本的paddlepaddle-gpu,当前我们选择了cuda12.0的版本,可以查看 https://www.paddlepaddle.org.cn/ 寻找自己适合的版本
python -m pip install paddlepaddle-gpu==2.6.0.post120 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

# 进入目录
Copy link
Collaborator

@LokeZhou LokeZhou May 20, 2024

Choose a reason for hiding this comment

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

是不是少了一步pyproject里面的包安装?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

在30行 有提示使用 pip install -e . 安装pyproject中依赖

import cv2
import paddle.nn as nn
import supervision as sv
from ppdet.core.workspace import create, load_config, merge_config
Copy link
Collaborator

Choose a reason for hiding this comment

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

supervision是否第三方库?如果是需要写一个requirments.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

supervision是第三方库,但已经作为依赖添加到了pyproject中,还需要另写一个requirments.txt吗?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, pyproject有了就行

@LokeZhou
Copy link
Collaborator

整体文件移到PaddleMIX/paddlemix/examples下

@LokeZhou LokeZhou merged commit 5622aa6 into PaddlePaddle:develop May 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants