A Learning-Based Framework for Collision-Free Motion Planning