function to get label from imu