ancasag / ensembleObjectDetection

MIT License
155 stars 30 forks source link

Ensemble Options Explanation #82

Closed sidnetopia closed 1 year ago

sidnetopia commented 1 year ago

Hello,

Could you please explain how ensemble options work using code?

Ensemble Options As indicated previously, three different voting strategies can be applied for TTA:

Affirmative. This means that whenever one of the methods that produce the initial predictions says that a region contains an object, such a detection is considered as valid. Consensus. This means that the majority of the initial methods must agree to consider that a region contains an object. The consensus strategy is analogous to the majority voting strategy commonly applied in ensemble methods for images classification. Unanimous. This means that all the methods must agree to consider that a region contains an object.

joheras commented 1 year ago

You have an example in the following notebook: https://colab.research.google.com/drive/1Tg9WaI_Cd-lPXDMuj6tHDlqakxo4-CLK

sidnetopia commented 1 year ago

I was hoping that it wouldn't be necessary to train another model, as I already have a set of predictions from different models. I believe my scenario is different from the link you shared.

sidnetopia commented 1 year ago

It has something to do with this:

            if option == 'consensus':
                if len(np.array(lista))>=math.ceil(numFich/2):#if the number of boxes is greater than half the number of files
                    pick,prob = ensemble.nonMaximumSuppression(np.array(lista), 0.3)
                    pick[0][5] = prob/numFich

            elif option == 'unanimous':
                if len(np.array(lista))==numFich:#if the number of boxes is greater than half the number of files
                    pick,prob = ensemble.nonMaximumSuppression(np.array(lista), 0.3)
                    pick[0][5] = prob / numFich

            elif option == 'affirmative':
                pick,prob = ensemble.nonMaximumSuppression(np.array(lista), 0.3)
                pick[0][5] = prob / numFich