{
  "id": 262387,
  "title": "Score decreases after applying WBF.",
  "url": "/competitions/siim-covid19-detection/discussion/262387",
  "author_name": "",
  "post_date": "2021-08-06T14:39:55.704216100Z",
  "votes": 1,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Hey, I am trying to merge my YOLO models with some public image models using WBF. But the score decreases a lot every time. I have tried IOU thresholds of 0.25, 0.5 and 0.9. Can somebody help me?<br>\nThanks.</p>",
  "messages": [
    {
      "id": "1455349",
      "postDate": "08/06/2021 14:39:55",
      "content": "<p>Hey, I am trying to merge my YOLO models with some public image models using WBF. But the score decreases a lot every time. I have tried IOU thresholds of 0.25, 0.5 and 0.9. Can somebody help me?<br>\nThanks.</p>",
      "rawMarkdown": "Hey, I am trying to merge my YOLO models with some public image models using WBF. But the score decreases a lot every time. I have tried IOU thresholds of 0.25, 0.5 and 0.9. Can somebody help me?\nThanks.",
      "votes": null
    },
    {
      "id": "1455563",
      "postDate": "08/06/2021 15:53:56",
      "content": "<p>You can try ensemble model by import 'attempt_load' from<br>\n<a href=\"https://github.com/ultralytics/yolov5/blob/master/models/experimental.py\" target=\"_blank\">https://github.com/ultralytics/yolov5/blob/master/models/experimental.py</a></p>\n<p>by passing string of path to the model </p>\n<blockquote>\n  <p>ex. weights_string = '/path/to/model1.pth /path/to/model2.pth /path/to/model3.pth ….'</p>\n</blockquote>\n<p>instead of using WBF, you can try standard NMS that they are offering inside<br>\n<a href=\"https://github.com/ultralytics/yolov5/blob/master/utils/general.py\" target=\"_blank\">https://github.com/ultralytics/yolov5/blob/master/utils/general.py</a></p>\n<p>You may take time to read through the source code but I think it is worth it<br>\nEspecially, attempt_load ensemble all the model and it takes less time for inference compare to inferencing one by one model. Essentially, what it does was pretty same as<br>\n<a href=\"https://github.com/ultralytics/yolov5/issues/318\" target=\"_blank\">https://github.com/ultralytics/yolov5/issues/318</a></p>",
      "rawMarkdown": "You can try ensemble model by import 'attempt_load' from\nhttps://github.com/ultralytics/yolov5/blob/master/models/experimental.py\n\nby passing string of path to the model \n> ex. weights_string = '/path/to/model1.pth /path/to/model2.pth /path/to/model3.pth ....'\n\ninstead of using WBF, you can try standard NMS that they are offering inside\nhttps://github.com/ultralytics/yolov5/blob/master/utils/general.py\n\nYou may take time to read through the source code but I think it is worth it\nEspecially, attempt_load ensemble all the model and it takes less time for inference compare to inferencing one by one model. Essentially, what it does was pretty same as\nhttps://github.com/ultralytics/yolov5/issues/318",
      "votes": null
    },
    {
      "id": "1455820",
      "postDate": "08/06/2021 17:43:15",
      "content": "<p>Thank you!</p>",
      "rawMarkdown": "Thank you!",
      "votes": null
    },
    {
      "id": "1457482",
      "postDate": "08/07/2021 12:37:48",
      "content": "<p>list of string path to model also worked btw</p>",
      "rawMarkdown": "list of string path to model also worked btw",
      "votes": null
    },
    {
      "id": "1457844",
      "postDate": "08/07/2021 15:34:54",
      "content": "<p>Did you try it? Despite I can merge yolov5x 5 folds but yolo5x and yolov5s threw error? Pls help me!!</p>",
      "rawMarkdown": "Did you try it? Despite I can merge yolov5x 5 folds but yolo5x and yolov5s threw error? Pls help me!!",
      "votes": null
    },
    {
      "id": "1457923",
      "postDate": "08/07/2021 16:17:11",
      "content": "<p>I managed to merge yolov5l and yolov5m but if you have different head, it is likely to threw an error.<br>\nFor example, one model predicting 1 class (opacity) and the other predicting 3 classes (included all classes that contain boxes). <br>\nIn that case, you need to inference those models separately and apply WBF after that. </p>\n<p>(My two different models has same setup (target class, etc.) despite the augmentations in hyp.yaml.)</p>",
      "rawMarkdown": "I managed to merge yolov5l and yolov5m but if you have different head, it is likely to threw an error.\nFor example, one model predicting 1 class (opacity) and the other predicting 3 classes (included all classes that contain boxes). \nIn that case, you need to inference those models separately and apply WBF after that. \n\n(My two different models has same setup (target class, etc.) despite the augmentations in hyp.yaml.)",
      "votes": null
    },
    {
      "id": "1457928",
      "postDate": "08/07/2021 16:20:39",
      "content": "<p>thank for your info but i tried WBF many times but it decrease my LB score</p>",
      "rawMarkdown": "thank for your info but i tried WBF many times but it decrease my LB score",
      "votes": null
    },
    {
      "id": "1457965",
      "postDate": "08/07/2021 16:40:55",
      "content": "<p>try to give it a weight to each model else stick to NMS might be best choice.</p>",
      "rawMarkdown": "try to give it a weight to each model else stick to NMS might be best choice.",
      "votes": null
    },
    {
      "id": "1457993",
      "postDate": "08/07/2021 16:52:57",
      "content": "<p>maybe i will submit single model, i don't have time to try more, thank you!</p>",
      "rawMarkdown": "maybe i will submit single model, i don't have time to try more, thank you!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1455563,
      "author_name": "sunpnwt12",
      "author_url": "",
      "post_date": "08/06/2021 15:53:56",
      "content": "<p>You can try ensemble model by import 'attempt_load' from<br>\n<a href=\"https://github.com/ultralytics/yolov5/blob/master/models/experimental.py\" target=\"_blank\">https://github.com/ultralytics/yolov5/blob/master/models/experimental.py</a></p>\n<p>by passing string of path to the model </p>\n<blockquote>\n  <p>ex. weights_string = '/path/to/model1.pth /path/to/model2.pth /path/to/model3.pth ….'</p>\n</blockquote>\n<p>instead of using WBF, you can try standard NMS that they are offering inside<br>\n<a href=\"https://github.com/ultralytics/yolov5/blob/master/utils/general.py\" target=\"_blank\">https://github.com/ultralytics/yolov5/blob/master/utils/general.py</a></p>\n<p>You may take time to read through the source code but I think it is worth it<br>\nEspecially, attempt_load ensemble all the model and it takes less time for inference compare to inferencing one by one model. Essentially, what it does was pretty same as<br>\n<a href=\"https://github.com/ultralytics/yolov5/issues/318\" target=\"_blank\">https://github.com/ultralytics/yolov5/issues/318</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1455820,
          "author_name": "shashwatraman",
          "author_url": "",
          "post_date": "08/06/2021 17:43:15",
          "content": "<p>Thank you!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1457482,
          "author_name": "sunpnwt12",
          "author_url": "",
          "post_date": "08/07/2021 12:37:48",
          "content": "<p>list of string path to model also worked btw</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1457844,
      "author_name": "magiccard",
      "author_url": "",
      "post_date": "08/07/2021 15:34:54",
      "content": "<p>Did you try it? Despite I can merge yolov5x 5 folds but yolo5x and yolov5s threw error? Pls help me!!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1457923,
          "author_name": "sunpnwt12",
          "author_url": "",
          "post_date": "08/07/2021 16:17:11",
          "content": "<p>I managed to merge yolov5l and yolov5m but if you have different head, it is likely to threw an error.<br>\nFor example, one model predicting 1 class (opacity) and the other predicting 3 classes (included all classes that contain boxes). <br>\nIn that case, you need to inference those models separately and apply WBF after that. </p>\n<p>(My two different models has same setup (target class, etc.) despite the augmentations in hyp.yaml.)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1457928,
          "author_name": "magiccard",
          "author_url": "",
          "post_date": "08/07/2021 16:20:39",
          "content": "<p>thank for your info but i tried WBF many times but it decrease my LB score</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1457965,
          "author_name": "sunpnwt12",
          "author_url": "",
          "post_date": "08/07/2021 16:40:55",
          "content": "<p>try to give it a weight to each model else stick to NMS might be best choice.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1457993,
          "author_name": "magiccard",
          "author_url": "",
          "post_date": "08/07/2021 16:52:57",
          "content": "<p>maybe i will submit single model, i don't have time to try more, thank you!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1455349": "Hey, I am trying to merge my YOLO models with some public image models using WBF. But the score decreases a lot every time. I have tried IOU thresholds of 0.25, 0.5 and 0.9. Can somebody help me?\nThanks.",
    "1455563": "You can try ensemble model by import 'attempt_load' from\nhttps://github.com/ultralytics/yolov5/blob/master/models/experimental.py\n\nby passing string of path to the model \n> ex. weights_string = '/path/to/model1.pth /path/to/model2.pth /path/to/model3.pth ....'\n\ninstead of using WBF, you can try standard NMS that they are offering inside\nhttps://github.com/ultralytics/yolov5/blob/master/utils/general.py\n\nYou may take time to read through the source code but I think it is worth it\nEspecially, attempt_load ensemble all the model and it takes less time for inference compare to inferencing one by one model. Essentially, what it does was pretty same as\nhttps://github.com/ultralytics/yolov5/issues/318",
    "1455820": "Thank you!",
    "1457482": "list of string path to model also worked btw",
    "1457844": "Did you try it? Despite I can merge yolov5x 5 folds but yolo5x and yolov5s threw error? Pls help me!!",
    "1457923": "I managed to merge yolov5l and yolov5m but if you have different head, it is likely to threw an error.\nFor example, one model predicting 1 class (opacity) and the other predicting 3 classes (included all classes that contain boxes). \nIn that case, you need to inference those models separately and apply WBF after that. \n\n(My two different models has same setup (target class, etc.) despite the augmentations in hyp.yaml.)",
    "1457928": "thank for your info but i tried WBF many times but it decrease my LB score",
    "1457965": "try to give it a weight to each model else stick to NMS might be best choice.",
    "1457993": "maybe i will submit single model, i don't have time to try more, thank you!"
  },
  "source": "meta"
}