I am afraid I am net an expert in AI and OpenCV, but I do know how to build a custom desktop. I would research what hardware other people are finding effective, and then just double check Ubuntu/Debian will have the driver support (its pretty good nowadays) for what you want. Building a rig is a great experience and quite fun too!