I saw an app a while ago that uses the camera to just track the top of your head, and alerts you if it lowers too much. It's a simple solution that works great for slouching.
It may have been this: https://nekoze.app
It may have been this: https://nekoze.app