Skip to content

I was able to have some fun over the weekend and build out a simple project that uses Swift, AVKIt, & CoreML to detect that an object was a person, centered, and stationary. This is used to detect when a person is about to swing!

Notifications You must be signed in to change notification settings

Betzer09/GolfSwingDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

I was able to have some fun over the weekend and build out a simple project that uses Swift, AVKIt, & CoreML to detect that an object was a person, centered, and stationary. This is used to detect when a person is about to swing!

GolfSwingDetection.mp4

Here's a little information about some of the more complex piecs of the code

Archtecture

The project follows MVC, leverages progrmatic UI, and uses the Coordinator pattern for navigating in the app.

BoundingBoxAnalyzer

The BoundingBoxAnalyzer class is a Swift component designed to analyze and track bounding boxes associated with objects in video frames. It implements the BoundingBoxAnalyzerProtocol and offers functionality to determine whether an object is moving or stationary based on its bounding box's positional changes over time. This class is particularly useful in scenarios where real-time object tracking and movement detection are required.

Key Features

Bounding Box Storage: The class maintains an array of bounding boxes, allowing it to keep track of the object's historical positions.

Movement Threshold: Objects are considered to be moving if their positional change exceeds a specified movement threshold (default: 0.02).

Stationary Detection: It counts consecutive frames where an object is stationary and can signal when an object becomes stationary, making it suitable for applications such as gesture recognition.

About

I was able to have some fun over the weekend and build out a simple project that uses Swift, AVKIt, & CoreML to detect that an object was a person, centered, and stationary. This is used to detect when a person is about to swing!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages