PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

关于ppyoloer训练目标框体旋转角度近似0度时的框体时角度拟合程度很差的问题

Open hxuaj opened this issue 1 year ago • 4 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

我在使用ppyoloer训练旋转框目标检测模型时发现目标框体旋转角度近似0度时的框体角度拟合程度很差。相比较有一定角度的目标框拟合却没什么问题。TrainerReader中的配置如下:

TrainReader:
  sample_transforms:
    - Decode: {}
    - Poly2Array: {}
    - RandomRFlip: {}
    - RandomRRotate: {angle_mode: 'value', angle: [0, 90, 180, -90]}
    - RandomRRotate: {angle_mode: 'value', angle: [30, 60], rotate_prob: 0.5}
    - RResize: {target_size: *image_size, keep_ratio: True, interp: 2}
    - Poly2RBox: {filter_threshold: 2, filter_mode: 'edge', rbox_type: 'oc'}

排除了后处理过程中的rbox2poly和dl_loss计算的问题。是因为目标0度时的loss过小导致的吗?不太确定是bug还是模型本身缺陷。请问有什么修改或者优化的空间?

hxuaj avatar Aug 08 '24 10:08 hxuaj

您好,你的0度框的数量多吗?如果很少,可以尝试下对这些数据进行采样扩充。

Sunting78 avatar Aug 09 '24 02:08 Sunting78

您好,你的0度框的数量多吗?如果很少,可以尝试下对这些数据进行采样扩充。

您好,0度框的数量挺多的,在数据集中比重近一半。后来我选取了若干张0度框的图片尝试过拟合,通过调高dfl的比重能把0度框过拟合到可接受的程度,目前正在原数据集上验证。请问有哪些除了直接在数据集中扩充相关图片采样的方式?

hxuaj avatar Aug 09 '24 02:08 hxuaj

图像级别采样,比如把包含0度框的样本重采样,可以加一定的颜色/亮度变化;框级别采样,可以crop出来 粘贴到其他样本图上。不过如果你0的数量很多,可能就不太必要了。可以看下拟合效果。

Sunting78 avatar Aug 09 '24 02:08 Sunting78

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

TingquanGao avatar Aug 17 '24 11:08 TingquanGao

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

TingquanGao avatar Sep 17 '24 12:09 TingquanGao