def ubyteToBool(x):
    assert isinstance(x,np.ndarray)
    assert x.dtype in [np.ubyte]
    assert len(x.shape) == 1
    
    out = np.zeros(x.shape[0]*8,dtype=np.bool)
    
    out[7::8] = 1&x > 0
    out[6::8] = 2&x > 0
    out[5::8] = 4&x > 0
    out[4::8] = 8&x > 0
    out[3::8] = 16&x > 0
    out[2::8] = 32&x > 0
    out[1::8] = 64&x > 0
    out[0::8] = 128&x > 0
    
    return out
Convert a byte vector to a bool vector.
dataset/ETHPy150Open bolme/pyvision/src/pyvision/other/distance.py/ubyteToBool