Add mask and length energy in cv model