FIX: Changed bitwise and to logical and
Added script to generate detector training data