Yeah, so with girls at the gym you have to realize that they are there to workout primarily, and yet they wear outfits that are eyecatching, and yes, they realize that most of the people there are men, so they're not dumb. They know they are going to get some attention, it's just that most guys are too shy to say something. The key is to disarm them by not going in hot, build rapport.
Just today at the gym a girl handed me her phone and asked me to input my number. This is someone I've been friendly and playful with for a few weeks. Here are some openers I've used:
The thing with the gym is that you are going to keep running into these people, so there's less of a rush to move to a close. Typically I establish that I'm friendly and safe, then I move on to interesting and playful, and that's when the demonstrations of higher value come in.
Note: women at the gym almost always have an earbud in or headphones on. So, when you make eye contact, deliberately remove your own earbud and give a little wave, lifting your head and opening your mouth like you want to say something. They'll take theirs out too and all attention is on you now! Make sure you are quick and aren't interrupting them from something they are already doing, like in the middle of a set.