… has too many hobbies.

Automatically sort trail camera images with trailcamai

For the past year or so I've been occasionally placing trail cameras in an attempt to get interesting photos of coyotes, beavers, and other animals out doing their thing. (Unfortunately I've mostly achieved photos of deer and other less-interesting animals, but eventually I'll get something neat!)

This hobby creates work: you need to go through the resulting images — typically, hundreds of them at once — to find anything interesting. This is a good fit for AI!

GitHub - cdzombak/trailcamai: AI-powered trail camera image and video organizer
AI-powered trail camera image and video organizer. Contribute to cdzombak/trailcamai development by creating an account on GitHub.

trailcamai is installable via Homebrew or Apt; see the README for instructions. It's a simple tool that uses a vision-capable LLM (self-hosted or via an OpenAPI-compatible provider) to sort trail camera photos & video into directories based on which animal, if any, is in the shot. It also organizes poor-quality photos into their own directory.

Lately I've been using it with Gemini 2.5 Flash; this is relatively expensive but is the first model I've tried where I'm reasonably happy with its animal identifications. Invocation with OpenRouter looks like this:

trailcamai -dir . -region Michigan -openai-endpoint "https://openrouter.ai/api/v1" -openai-key "redacted" -model "google/gemini-2.5-flash" -min-quality 3 -concurrency 4

It's not perfect. Here are the directories it created from one example batch (several days & nights) of trail camera images:

.
├── _lowq
├── cat
├── coyote
├── crane
├── cranes
├── deer
├── dog
├── DSCF0152.MP4
├── heron
├── human
├── none
├── orange-breasted
├── rabbit
├── raccoon
├── rose-breasted
├── sandhillcrane
├── sandhillcranes
└── woodchuck

Some of those are nonsense, and some animals are misidentified (for example, it classified an opossum as a woodchuck), but overall it's a useful starting point for reviewing what you've found.

Trail Camera Recommendation

I've been reasonably happy lately with this trail camera from the SPYPOINT brand. It has a solar panel that helps reduce battery usage, and the resolution is a good tradeoff between picture quality and disk usage. I prefer SD card storage instead of cellular models, since I don't want to deal with a SIM card or a subscription.

You'll also want rechargeable, lithium-ion batteries. Trail camera eat batteries quickly, and NiMH rechargeables don't do well in the cold.

Here's a representative picture and video:

A muskrat working on its lodge at night.
0:00
/0:20

A video of a muskrat having a snack at night.