Inspiration

ShotForge started with a simple question: why should getting useful feedback from a basketball shooting session require a coach, specialized equipment, or hours of manual video review?

Most tools focus on either results or mechanics. A shot tracker can tell you whether the ball went in, while motion- analysis tools may explain body movement without connecting it to real shooting performance. We wanted to bring both sides together using hardware players already own: an iPhone and, optionally, an Apple Watch.

Our goal is not to force every player into one definition of “perfect form.” ShotForge helps players understand their own movement, measure their consistency, and connect changes in technique with changes in performance.

## What it does

ShotForge is a local-first iOS basketball training app built around two complementary experiences:

  • Track Performance detects shot attempts and organizes makes, misses, shooting volume, court locations, shot types, and trends.
  • Analyze Mechanics uses a face-on camera view to measure movements such as knee and hip flexion, elbow angle, release height, joint speed, and pre-release foot movement.

Players can review individual attempts alongside their recorded video. When the visual evidence is ambiguous, ShotForge can leave the result unconfirmed instead of confidently giving the wrong answer. Videos and training data stay on the device by default, with no account required.

## How we built it

We built ShotForge as a native Swift and SwiftUI application, using AVFoundation for video capture, SwiftData for sessions and shot records, and Apple’s Vision framework for body-pose extraction.

The video pipeline processes camera frames through several independent stages:

  1. Detect the player, basketball, and rim.
  2. Track the ball across frames.
  3. identify potential shooting events.
  4. Classify the result as made, missed, or unknown.
  5. Send each shot to either the performance-tracking or mechanics-analysis module.

We also created a separate offline evaluation system for experimenting with pose models, ball detectors, trajectory logic, and make-or-miss classification before moving those changes into the app. This allowed us to compare approaches against manually verified shooting videos instead of relying only on visual demos.

For small-ball detection, we trained and evaluated an RF-DETR-based model on basketball footage. We then combined its detections with temporal tracking and physically meaningful trajectory rules. The Apple Watch prototype can capture high- frequency wrist motion, but we deliberately kept it optional so the iPhone experience remains complete on its own.

## Challenges we ran into

The hardest problem was not detecting a person—it was reliably following a very small, fast-moving basketball through motion blur, occlusion, changing lighting, and visually noisy gyms.

A ball may disappear near the rim, merge with the backboard, split into multiple track fragments, or re-enter the rim area after a bounce. A simple “ball crossed the rim” rule can therefore mistake a rim bounce for a made shot.

We learned to treat uncertainty as useful information. Instead of forcing every attempt into “made” or “missed,” ShotForge can abstain when the evidence is ambiguous. This made the system more trustworthy and created a natural workflow in which players only need to review uncertain attempts.

Another challenge was camera geometry. A midcourt view is useful for ball flight, shot location, and makes or misses, while an under-rim face-on view is better for measuring bilateral body mechanics. Rather than pretending one angle could reliably produce everything, we designed two focused capture modes with clear responsibilities.

## Accomplishments that we are proud of

On our current three-video development benchmark, the latest pipeline reached approximately 90.1% precision and 94.4% recall for shot detection. For attempts where the system produced a known result, make-or-miss accuracy reached approximately 87.6%, with 82.9% coverage. It also classified all eight short validation clips correctly.

We treat these as development results, not universal accuracy claims. The current footage comes from a limited set of recording conditions, so testing on new courts, players, camera positions, and lighting remains essential.

We are equally proud of the engineering discipline behind those numbers: reproducible datasets, manually audited labels, visual debugging overlays, regression tests, and evaluation at the complete shot-event level rather than only at the individual-frame level.

## What we learned

The most important lesson was that a strong detector does not automatically create a strong product. Frame-level accuracy, tracking continuity, event timing, rim calibration, and result classification must all work together.

We also learned that evaluation metrics can be misleading when they measure the wrong thing. Reviewing real failure cases frame by frame was often more valuable than another round of threshold tuning.

Finally, we learned that honest uncertainty builds more trust than confident mistakes. For a training tool, giving the player a quick confirmation step is better than presenting unreliable automation as certainty.

## What's next for ShotForge

Our next milestone is validating ShotForge on genuinely new courts and recording conditions. We also plan to move the research-grade ball detector into an optimized on-device Core ML pipeline, improve real-time performance, simplify court calibration, and make uncertain-shot review even faster.

Longer term, ShotForge will connect mechanics and results across sessions so players can answer a more meaningful question than “How many shots did I make?”: What changed in my movement—and did it actually make me a better shooter?

Built With

Share this project:

Updates