DEV Community

Dhanush N
Dhanush N

Posted on

TrailNote: an offline photo guesser for birds and plants

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

TrailNote is a small command-line tool for walks. Take a photo of a bird or plant, run one command, and it gives you its top 3 guesses with confidence scores. It runs on your own machine with no API key and no account. There is an optional walk log that saves each guess with the date to a local JSON file, and a simple Gradio page for uploading photos.

It is a guess tool, not a field guide. It checks the photo against a hardcoded list of about 35 labels (a few trees, flowers and common birds, plus generic ones like "a plant" or "an insect"), so it often lands on something general and can be wrong. Every result ends with a reminder to verify before touching or eating anything.

Repo: https://github.com/DhanushNehru/trialnote

Demo

A real run on a public-domain photo of an American robin from Wikimedia Commons:

  1. robin (73.06%)
  2. cardinal (18.70%)
  3. a bird (5.39%)

That was a good result. It won't always be: anything outside the ~35 labels gets pushed to the nearest wrong or generic one.

How I Built It

The model is OpenAI's CLIP (clip-vit-base-patch32), an open-weight model, run through the Hugging Face transformers zero-shot image classification pipeline. I give it the candidate labels and it scores the photo against each. The CLI uses argparse, the log is a JSON file in the home folder, and the web page is Gradio. The model downloads once; after that it works from the local cache (I checked with HF_HUB_OFFLINE=1). On my CPU a run took about 7 seconds. PyTorch alone is around 750MB.

Why Does Open Innovation Matter?

This only works outside because the weights are open. No API key, no server, no signal needed after the first download. Anyone can open the code, see the short label list, and replace it or swap in a better model. Open weights make the limits visible and fixable.

Next steps: a bigger local-species label list, and a model built for bird or plant ID.

Top comments (1)

Collapse
Β 
koda2026 profile image
Harun - solo dev β€’

the "guess tool, not a field guide" disclaimer is top-tier engineering honesty. too many ai wrappers pretend to be perfect and hide their edge cases.

running clip locally for zero-shot classification without an api key is exactly how offline-first tools should be built. the fact that it caches the weights and runs with HF_HUB_OFFLINE=1 means it actually works in the woods where there's no cell service. that's the real "touch grass" test.

curious about the 750mb pytorch footprint though. have you experimented with exporting the clip model to ONNX runtime or quantizing it to INT8? i'm obsessed with keeping my own edge-compute ai tool lightweight, so i'm always looking at ways to shrink model payloads for cpu/mobile environments.

great week 1 submission. the local json walk log is a brilliant, simple touch. 🐯🌿