It’s a balancing act between competing parameters, as always, and the “right” choice will depend on so many factors that only you can know. If it’s just a one-off installation, I’d probably be optimizing for a path that involves low effort to get your prototype running, so probably a similar PC. If you plan on developing this into a product to sell to the market, many other factors become important - cost, reliability, product support lifetime etc. Maybe it makes sense to port your code to a raspberry pi in that case, but then you have to consider whether it’s powerful enough to do what you are doing, etc.
Probably the biggest factors I would focus on, knowing what I know about your project (which isn’t much), are reliability / suitability for the environment you are operating in, and ease / cost of getting and deploying replacements.
There are so many factors in a decision like this. It would help if you shared some of your goals, concerns, etc.