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

pp humanseg v2 lite人像模型预测人像mask存在偏移 #3438

Closed
3 tasks done
sidluther opened this issue Aug 7, 2023 · 5 comments
Closed
3 tasks done

pp humanseg v2 lite人像模型预测人像mask存在偏移 #3438

sidluther opened this issue Aug 7, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@sidluther
Copy link

问题确认 Search before asking

Bug描述 Describe the Bug

pp humanseg v2 lite人像模型预测人像mask存在一定几率向下或向右偏移
可视化结果:
baby-boy-hat-covered-101537_1
baby-boy-hat-covered-101537_2
baby-boy-hat-covered-101537_3
baby-boy-hat-covered-101537_4

girl-dress-bounce-nature-160826_1
girl-dress-bounce-nature-160826_2
girl-dress-bounce-nature-160826_3
girl-dress-bounce-nature-160826_4

模型推理代码

python ../../predict.py \
  --config configs/human_pp_humansegv2_lite.yml \
  --model_path pretrained_models/human_pp_humansegv2_lite_192x192_pretrained/model.pdparams \
  --image_path data/images/XXXXX.jpg \
  --save_dir ./data/images_result

原图和结果上传在files.zip
files.zip

复现环境 Environment

------------Environment Information-------------
platform: Linux-5.4.0-153-generic-x86_64-with-glibc2.10
Python: 3.8.0 (default, Nov 6 2019, 21:49:08) [GCC 7.3.0]
Paddle compiled with cuda: True
NVCC: Build cuda_11.2.r11.2/compiler.29373293_0
cudnn: 8.1
GPUs used: 1
CUDA_VISIBLE_DEVICES: 2
GPU: ['GPU 0: NVIDIA TITAN', 'GPU 1: NVIDIA TITAN', 'GPU 2: NVIDIA TITAN', 'GPU 3: NVIDIA TITAN', 'GPU 4: NVIDIA TITAN', 'GPU 5: NVIDIA TITAN', 'GPU 6: NVIDIA TITAN']
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PaddleSeg: 2.8.0
PaddlePaddle: 2.3.2
OpenCV: 4.5.5

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@sidluther sidluther added the bug Something isn't working label Aug 7, 2023
@Asthestarsfalll
Copy link
Contributor

是指输入图片横过来的时候预测结果有偏移?

@sidluther
Copy link
Author

正常拍摄图像预测结果也很容易有偏移情况,比如观察肩膀位置很容易向下偏移了几个像素(图片横着看能更加明显感觉到向下偏移,所以上传了几张横着的)。

hard275_254

image_13
image_16

比如这几张图像模型预测的mask如果向上移动几个像素值会更加贴合。
所以感觉什么地方有问题使最终推理结果偏移了些。

原图和结果打包上传
results.zip

@Asthestarsfalll
Copy link
Contributor

个人认为边界预测还是比较正常的事情(因为分割就是为了界定不同种类之间的界限,如果能完美解决这个问题,就不需要再研究了),一是模型比较小,因此精度也会低一点,二是这些图像和训练数据的不在同一个分布上,三可能是图片比例的原因,包括各种插值的影响、模型的泛化性等。

对于横着的图片偏移更大的原因,我推测训练集中并没有这样的数据,况且卷积的旋转不变性可能也没有那么强,只是靠局部的特征的进行分类。

至于向下偏移,可能检查一下输入的分辨率和比例,可能是网络中插值的影响

@sidluther
Copy link
Author

@Asthestarsfalll
应该不是这个原因,我试了把模型预测的mask沿h方向向上偏移了一个像素再插值到原图尺寸后就贴合多了。

hard275_254
image_13

image_16

具体原因我还是要深究下代码。

@Asthestarsfalll
Copy link
Contributor

代码中应该不会含有任何偏移的行为,能造成这种现象的感觉还是插值的问题,可以试试不同的分辨率推理看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants