Train With an AI
Swupnil Sahai uses artificial intelligence to up his game—and yours.
SwingVision: A.I. Tennis App
Scoring, Stats & Line Calling
‣ Company: Mangolytics
‣ Founders: Swupnil Sahai and Richard Hsu
‣ Mission: To give all tennis players access to pro-level metrics.
‣ App launched: 2016 (on Apple Watch); 2019 (on iPhone and iPad)
‣ Team size: 7
‣ Most-used emoji: 🎾
When Swupnil Sahai started building SwingVision, he had never programmed a single line of code—but he had played a lot of tennis. “I wanted to have the same stats and insights as the pros,” he says. “That’s where the idea came from.”
SwingVision is a virtual tennis coach and highlight-reel creator all in one. Point your iPhone or iPad’s camera at the court as you play and the app shows you the speed of your serves, whether you’re hitting consistently, and how to shape up your posture and footwork.
It can also show you video of every backhand you missed as well as your highlights. “I can find my five best rallies and share them with my friends and family, which is something I do often,” says Sahai. In a forthcoming release, it’ll be able to serve as line judge too.
We caught up with the California-based dev to talk about the ease of programming with Swift, the weirdness of tennis scoring, and the time he helped Andy Roddick find his iPhone.
SwingVision is one of the most advanced AI-powered sports apps out there, but you started with no coding experience?
Yeah, I basically taught myself Swift so I could make an Apple Watch app to track my shots and keep score. I was at Columbia University doing my PhD when Swift came out. It seemed more approachable than Objective-C, so I thought, “Maybe I can pick this up on my own.” Swift was incredible; it’s a great first language for anyone who’s trying to learn coding.
How did you move the app from Apple Watch to iPhone?
After I graduated, I worked on autonomous driving and became well versed in computer vision—tracking cars and pedestrians using AI. While doing that, I thought, “Wait, I could do this for tennis too.” Apple was making iPhones with bionic chips that were so powerful, and I realized this could actually be possible. Apple Watch is an integral part of SwingVision, but the iPhone opens up so much because you can use its camera.
What has been your biggest challenge?
About a year and a half ago, we were building the AI that would track shots with the single camera. With most machine-learning models, you train it on a computer and then convert it to Core ML to run on iPhone. That conversion step wasn’t working properly, and we were panicking, like, “We’re never going to figure this out! This company is gonna fail!” It took several weeks hunting online forums, but we found the fix—and it was literally one line. We changed one line of code on the computer in Python before making the conversion, and then everything worked.
Tennis pros Andy Roddick and James Blake are investors. How did that come about?
I’ll tell you a story: James was the first tennis pro I met. We were in Texas at an exhibition match with Andy Roddick, John McEnroe, and Jim Courier. We’re in the locker room, and I pitched all of them , but Andy was the most interested. But I think what really sold him was that he had to leave to catch a flight and couldn’t find his iPhone. James tried to call it, but it was on silent. So I was like, “You know, if you log into Find My iPhone, it can ping the phone for you.” And he said, “Is that real? Is that a thing?” So that’s how we found his iPhone.
Where do you see SwingVision going?
Right now, it’s most popular among club players, adults who are playing competitively maybe once a week. But really it’s for anyone who’s keeping score. We’re starting to see more high school players as well as people who just rally with their friends, and for me that’s the biggest opportunity: How can we teach people to play tennis? How can we automate scoring, make it more accessible? Because tennis has a really weird scoring system. [Laughs.] It’s rare to have judges on the court. In baseball, you have umpires. And even middle-school basketball has refs. Somehow in tennis you have to do everything yourself: call the lines, keep score. There’s a big need there. We’re not trying to replace what’s already there, but make tennis more accessible.
Mangolytics is a part of the App Store Small Business Program. If you are a developer and would like to learn more about the program, follow the link below.