soap117 / DeepRule

BSD 3-Clause "New" or "Revised" License
128 stars 44 forks source link

what is "lighting" transformation #10

Open crazysal opened 3 years ago

crazysal commented 3 years ago

How were the hard coded values below calculated :

db> coco.py> Line> init()

self._eig_val = np.array([0.2141788, 0.01817699, 0.00341571], dtype=np.float32)
 self._eig_vec = np.array([
            [-0.58752847, -0.69563484, 0.41340352],
            [-0.5832747, 0.00994535, -0.81221408],
            [-0.56089297, 0.71832671, 0.41158938]], dtype=np.float32)

These are then used in this function : utils>image.py> lighting_


def lighting_(data_rng, image, alphastd, eigval, eigvec):
    alpha = data_rng.normal(scale=alphastd, size=(3, ))
    image += np.dot(eigvec, eigval * alpha)

Please explain.

crazysal commented 3 years ago

Digging deeper these are values from original coco dataset. And redundant for this paper.