Contextual Visual Recognition From Images And Videos