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

请问可以在训练过程中添加RandomGrayscaleErasing的实现么 #384

Open
qiaosuobutouche opened this issue Sep 6, 2023 · 2 comments

Comments

@qiaosuobutouche
Copy link

qiaosuobutouche commented Sep 6, 2023

这个函数https://github.com/layumi/Person_reID_baseline_pytorch/blob/master/random_erasing.py#L57,可以加入到train.py中的解析器中以方便使用么,感谢

@qiaosuobutouche
Copy link
Author

qiaosuobutouche commented Sep 6, 2023

自己写了一下,添加了解析器语句
parser.add_argument('--grayscale_erasing_p', default=0, type=float, help='probability of applying grayscale erasing') 在https://github.com/layumi/Person_reID_baseline_pytorch/blob/4dae9cdf42f71c72a44a64fb23bfc470c501085f/train.py#L48C103-L48C103
这一行下
以及调用语句
if opt.grayscale_erasing_p > 0:
transform_train_list = transform_train_list + [RandomGrayscaleErasing(probability=opt.grayscale_erasing_p)]
添加在了https://github.com/layumi/Person_reID_baseline_pytorch/blob/4dae9cdf42f71c72a44a64fb23bfc470c501085f/train.py#L141
这一行下
大佬可以帮忙看看这样写有问题么

@layumi
Copy link
Owner

layumi commented Oct 7, 2023

你好 @qiaosuobutouche
看上去没有问题!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants