Be careful with the compliments. They have to be real and sincere. And they should be short. Like: You look nice today. That's a pretty dress. Thanks for making sure we always have food for the baby.
DO NOT TALK ABOUT SEX OR BEING SEXY. She is insecure. Compliments give her reassurance. This is where you begin to break the story on her head that you don't value her.
Don't blame your W for your issues with sex. I did the same thing. My W put on considerable weight with our children. I thought that if she lost the weight I would be more sexual with her. But that is a lie. I don't care if you say, "I just am naturally attracted to thinner women." That is an excuse for your issues. Your W could have lost the weight, but she hasn't. Why? Because you don't treat her like she's sexually attractive. We don't love beautiful women. We lust after them, but we don't love them. Women become beautiful when you love them. I bet your W is more attractive now than she was 3 months ago. That's because she has forced you to change your priorities and you are looking at her with loving eyes.
I say this because this is what I've done.
Do not blame your W for anything. Stop it. Nobody chooses to make bad choices. She has done the best she could, just like you. A marriage is not a union in which two are made into one. That's codependancy. A marriage is a choice two individuals make everyday to actively love each other and serve the other person. The more actively you show your love in a marriage, the better the marriage will be. You've been pretty inactive in yours. So that's why you're here.
Don't beat yourself up about it. That will just make things worse. Remember we are all humans doing the best we can. Now you have to start doing better. To do that you need to change your actions. Changing how you behave will change how you feel about yourself. How you feel about yourself will change how your W thinks and feels about you. And that may get her back.
This process is not about your W. it is about you becoming who you want to be. You've had a rude awakening. So now that you are awake, begin working on you. This is a great opportunity. Take advantage of it. It feels like crap, I know, but start finding the positive in your situation. If you don't, you'll stay in the negative. And why would a woman want to be married to someone who is sad and negative?