PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

PPYOLO将训练图片resize会造成失真吗?原图是4096*2106的,貌似源码中是resize为正方形?

Open xinliyangguang opened this issue 5 years ago • 4 comments

如题,想要自己修改resize方式的话在哪个函数里呢?

xinliyangguang avatar Apr 22 '21 07:04 xinliyangguang

@xinliyangguang 你的原图很大,resize到608左右的话可能会失真,如果resize成长方形,可以在将配置https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0/configs/ppyolo/base/ppyolo_reader.yml#L13 从BatchRandomResize: {target_size: [320, 352, 384, ... 改成BatchRandomResize: {target_size: [[640, 320], [704, 352], [768,384],... 图像尺寸需要是32的倍数

yghstill avatar Apr 22 '21 08:04 yghstill

@xinliyangguang 你的原图很大,resize到608左右的话可能会失真,如果resize成长方形,可以在将配置https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0/configs/ppyolo/base/ppyolo_reader.yml#L13 从BatchRandomResize: {target_size: [320, 352, 384, ... 改成BatchRandomResize: {target_size: [[640, 320], [704, 352], [768,384],... 图像尺寸需要是32的倍数

我的原图尺寸并不是很大,是2784, 1856,我按照你的进行配置resize, batch_transforms: - BatchRandomResize: {target_size: [[1392, 928], [1740, 1160], [2088, 1392], [2436, 1624], [2784, 1856]], random_size: True, random_interp: True, keep_ratio: False} 出现这样的问题 File "mtrand.pyx", line 904, in numpy.random.mtrand.RandomState.choice ValueError: a must be 1-dimensional 请问现在还是不支持resize长方形吗?

VJoer avatar Apr 28 '21 06:04 VJoer

@xinliyangguang 你的原图很大,resize到608左右的话可能会失真,如果resize成长方形,可以在将配置https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0/configs/ppyolo/base/ppyolo_reader.yml#L13 从BatchRandomResize: {target_size: [320, 352, 384, ... 改成BatchRandomResize: {target_size: [[640, 320], [704, 352], [768,384],... 图像尺寸需要是32的倍数

我的原图尺寸并不是很大,是2784, 1856,我按照你的进行配置resize, batch_transforms:

  • BatchRandomResize: {target_size: [[1392, 928], [1740, 1160], [2088, 1392], [2436, 1624], [2784, 1856]], random_size: True, random_interp: True, keep_ratio: False} 出现这样的问题 File "mtrand.pyx", line 904, in numpy.random.mtrand.RandomState.choice ValueError: a must be 1-dimensional 请问现在还是不支持resize长方形吗?

我把keep_ratio: False 改为 keep_ratio: True 就会得到下面错误,请问这个是不是保持图像原来的长宽比? SystemError: (Fatal) Blocking queue is killed because the data reader raises an exception. [Hint: Expected killed_ != true, but received killed_:1 == true:1.] (at D:\v2.0.2\paddle\paddle/fluid/operators/reader/blocking_queue.h:158)

VJoer avatar Apr 30 '21 01:04 VJoer

Since this issue has not been updated for more than three months, it will be closed, if it is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于该问题超过三个月未更新,将会被关闭,若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。

paddle-bot-old avatar Mar 16 '22 06:03 paddle-bot-old