ZFTurbo / Weighted-Boxes-Fusion

Set of methods to ensemble boxes from different object detection models, including implementation of "Weighted boxes fusion (WBF)" method.
MIT License
1.72k stars 238 forks source link

Bbox is 'Nan' when weights have 0 #44

Open Yangr116 opened 2 years ago

Yangr116 commented 2 years ago

Hello, thanks for your nice work!

Recently, I used your method in my own project, and the mAP is improved indeed. However, When I check the JSON format result, most of the bounding boxes are Nan.

The below are the parameters: iou_thr=0.5, skip_box_thr=0.01, weights=[1, 0]

when weights have 0, there will be warnings: RuntimeWarning: invalid value encountered in true_divide box[4:] /= conf But there are also 0 in the benchmark you have given.

Could you give me some suggestions? Looking forward to your reply, Thanks!

ZFTurbo commented 2 years ago

The easiest solution is to remove predictions from ensemble you don't need to use (e. g. weight = 0).

Yangr116 commented 2 years ago

Yeah, that's right. Weights [1, 0] made the ensembled model improve 0.03 mAP than the single model, 0.51 to 0.54 mAP ,but weights [1, 1] only obtained 0.002 mAP. Maybe more models show the ability of the ensemble method better?

ZFTurbo commented 2 years ago

I meant you can remove second set of boxes and set weights to weights=[1], then WBF will be applied to first set of boxes only. It's the equiualent to weights=[1, 0]. Looks like you have some of boxes intersected in the predictions of same model, so they fuse in process.

Yangr116 commented 2 years ago

Oh, thanks for your reply!   I will try it. 

---Original--- From: @.> Date: Mon, Oct 11, 2021 21:51 PM To: @.>; Cc: @.**@.>; Subject: Re: [ZFTurbo/Weighted-Boxes-Fusion] Bbox is 'Nan' when weights have 0 (#44)

I meant you can remove second set of boxes and set weights to weights=[1], then WBF will be applied to first set of boxes only. It's the equiualent to weights=[1, 0]. Looks like you have some of boxes intersected in the predictions of same model, so they fuse in process.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.