Menu

1 / 2

Building an Offline-First Livestock Counter with YOLOv8 and CoreML

DEV Community·Todd Sullivan·7 months ago
#TKV3e8ks
#ios#swift#machinelearning#count#inference
Long article (600 words) — no AI summary yet.
Reading 0:00
15s threshold

I built a livestock counting app for smallholders. No internet required, no subscription, no server. You take a photo of your chickens, sheep, or cattle, and it counts them — entirely on-device. Here's how it actually works.

The Problem

Smallholders regularly need to count animals. In a field. In a barn. Where there's no signal. The apps that exist are either generic (bad accuracy for farm animals), require a server round-trip, or charge you monthly to count your own chickens. None of that made sense to me.

So I built Muster.

The Stack

iOS 17, SwiftUI, SwiftData — no third-party dependencies, ships as a one-time purchase

YOLOv8n — the nano variant, exported to CoreML format

Apple's Vision framework — handles the ML request lifecycle, orientation correction, and bounding box coordinate normalisation

Zero backend — no server, no account, no ongoing cost

The model is small enough to run on-device without breaking a sweat. YOLOv8n sits at about 6MB in CoreML format.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.