Factory Automation: How AI is Revolutionizing Assembly Lines and Defect Detection