Using Python (or something else?) to remove a green screen from image?

My son and I have built a photo booth app using Flutter. We’d like to allow the user to send an image via API call to a Raspberry Pi (or other small SoC device, which we use it with anyway, to control the printers) I know both OpenCV or ImageMagick can do it, and those would run on a Raspberry Pi (or similar “cheap” device), but using some of the AI technologies that are capable of handling something like this. The benefit of going this route would be that we could forego the green screen and remove a wide range of backgrounds.

Ideally, I’d find something I could run off a Raspberry Pi with a Coral accelerator to handle the AI background removal, but if they work well enough, I’m open to buying something like an Nvidia Jetson.

Anybody have any input on something like this?