weixin_39699912
2020-12-28 12:30 阅读 21

Overlap threshold

Hi,

the issue is probably related with https://github.com/NVIDIA/retinanet-examples/issues/166.

I am fine-tuning an object detector as shown in example (https://github.com/NVIDIA/retinanet-examples/blob/master/TRAINING.md). Objects in my dataset are marked with rectangles with the same size of 84 x 15 pixels. During training box_loss is constantly equal to 0.000. I have uncovered that in box.py, function snap_to_anchors(.), there are hardcoded overlap threshold parameters 0.4 and 0.5, which discard elongated objects. When I change these parameters, training runs successfully. When I change annotation rectangles to squares, training runs successfully. Could you please make these threshold parameters adjustable? Or would you prefer a PR?

Thank you!

Rosty

该提问来源于开源项目:NVIDIA/retinanet-examples

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

8条回答 默认 最新

  • weixin_39802020 weixin_39802020 2020-12-28 12:30

    Rosty, This is on our "to do" list, but we have been focussing on backbones recently. We always welcome PRs if you've already done the work. Have you had luck detecting your objects?

    I'll close this and treat it as a feature request, unless you raise a PR.

    点赞 评论 复制链接分享
  • weixin_39699912 weixin_39699912 2020-12-28 12:30

    James,

    thanks for your reply! I have it working in a "workaround" mode, will check if there is a way to adjust the parameters in an argparse way.

    Rosty

    点赞 评论 复制链接分享
  • weixin_39802020 weixin_39802020 2020-12-28 12:30

    We can add a new --foreground-iou parameter for the next release if you'd like. What value are you using?

    点赞 评论 复制链接分享
  • weixin_39802020 weixin_39802020 2020-12-28 12:30

    Also, if you are able to share example outputs, or how you are using the repo, I'd love to see them.

    点赞 评论 复制链接分享
  • weixin_39699912 weixin_39699912 2020-12-28 12:30

    I am using 0.3 instead of 0.4 and 0.4 instead of 0.5 for training and the losses are converging to something < 1. When validation starts, depending on nms and threshold parameters, I get either "no detections" or AP/AR equal to 0 or -1. Still playing with nms and threshold parameters for inference. There is something filtering out detections during inference.

    点赞 评论 复制链接分享
  • weixin_39699912 weixin_39699912 2020-12-28 12:30

    I use this fork https://github.com/aidonchuk/retinanet-examples with parameters:

    retinanet train mymodel.pth \ --fine-tune retinanet_rn50fpn.pth \ --batch 3 \ --iters 50000 \ --val-iters 5000 \ --lr 0.1 \ --classes 3 \ --jitter 700 1520 \ --max-size 1520 \ --images images \ --annotations labels/via_region_data.json \ --val-images images \ --val-annotations labels/via_region_data.json \ --full-precision \ --logdir output \ --model-threshold 0.05 \ --model-top-n 1000 \ --model-nms 0.5 \ --model-detections 100

    Disclaimer: I am aware that I validate on the train data, expecting to see overfitting.

    点赞 评论 复制链接分享
  • weixin_39802020 weixin_39802020 2020-12-28 12:30

    --full-precision is probably not adding much, but will increase your training time. Please let me know what happens with this.

    点赞 评论 复制链接分享
  • weixin_39699912 weixin_39699912 2020-12-28 12:30

    Same, in the fork it is FP32 by default

    点赞 评论 复制链接分享

相关推荐