Solved by Antonio_Ossa in post #2 
              
              
                Hi @mayool, 
I think that the answer is: it depends (as usual). 

The first code assumes you have one class: “1”. If you calculate the IoU score manually you have: 3 "1"s in the right position and 4 "1"s in the union of both matrices: 3/4 = 0.7500.
If you consider that you have two classes: “1” and …