Skip to content
OPQAI.
Sourced intermediate / 🎓 Academic & Research Free tools

Identify Birds and Plants Offline with TrailNote

Job to be done: Identify birds and plants from photos using an offline AI tool

🇳🇬 Ways to use this in Nigeria

Ideas to get you started, adapt to your situation.

  • Student

    For your university biology field trip, identify unknown plant species from photos taken in rural areas without internet, then use the results for your lab report.

  • 9-5 employee

    As an environmental officer on a field survey in a remote national park, quickly identify unknown plant species from photos taken offline, then add the data to your survey report.

What you’ll get

You will get a command-line tool that can identify birds and plants from photos you take on a walk. It provides the top 3 guesses with confidence scores, running entirely on your own computer without needing an internet connection or an account. This approach works because it uses an open-weight AI model that is downloaded once and then runs locally, making it ideal for use in areas with poor or no mobile service.

Tools you need

  • TrailNote (free): A command-line tool for identifying plants and birds from photos.
  • Python (free): A programming language used to run TrailNote and its dependencies.
  • Git (free): A system for managing code, used to download the TrailNote project.
  • OpenAI CLIP model (free): The AI model that analyzes images and predicts labels.
  • Hugging Face transformers library (free): A tool that helps run AI models like CLIP easily.
  • Gradio (free): A tool to create a simple web interface for the AI model.

Steps

  1. Install Python and Git: If you don’t have them, download and install Python (version 3.8 or higher recommended) and Git from their official websites. Make sure to check the option to add Python to your system’s PATH during installation.

  2. Download TrailNote: Open your terminal or command prompt. Navigate to a folder where you want to save the project. Then, run the following command to download the code from its online repository:

    git clone https://github.com/DhanushNehru/trialnote

    You should see messages indicating that the files are being downloaded into a new folder named trialnote.

  3. Navigate to the TrailNote folder: Change your current directory in the terminal to the newly downloaded trialnote folder:

    cd trialnote

    Your terminal prompt should now show that you are inside the trialnote directory.

  4. Install required Python libraries: TrailNote needs a few other tools to work. Run this command to install them. This might take a few minutes and download several files:

    pip install -r requirements.txt

    You should see messages about packages like torch, transformers, and gradio being installed successfully.

  5. Run TrailNote for the first time: To start the tool and download the AI model (this happens only once), run:

    python main.py --download-model

    This command will download the OpenAI CLIP model. It’s a large file (around 750MB for PyTorch), so it might take some time depending on your internet speed. You’ll see progress updates in the terminal. Once downloaded, the model is saved locally.

  6. Identify a plant or bird from a photo: Now you can use TrailNote. Place a photo (e.g., my_photo.jpg) in the trialnote folder. Then, run the identification command:

    python main.py --image my_photo.jpg

    Replace my_photo.jpg with the actual name of your photo file. The tool will process the image and show you the top 3 guesses with their confidence percentages, like this:

    robin (73.06%)
    cardinal (18.70%)
    a bird (5.39%)

    Remember, it’s a guesser, not a perfect identifier. Always verify before touching or eating anything.

  7. Optional: Use the web interface: If you want a graphical way to upload photos, run:

    python main.py --web

    This will start a local web server. The terminal will show you a URL (usually something like http://127.0.0.1:7860). Open this URL in your web browser. You can then upload photos through the web page to get identifications.

Original source

This workflow is based on the TrailNote project by Dhanush Nehru, shared as part of the Hacktoberfest Open-Source AI Challenge. It’s designed as a simple, offline tool for identifying nature photos during walks.

Notes & variations

  • Free tier alternative: This tool is already free and runs offline. The main cost is the initial download of the AI model and libraries.
  • Common mistake: Forgetting to install the Python requirements (pip install -r requirements.txt) before trying to run the tool will cause errors. Ensure you run this command in the trialnote directory.
  • Tip for better results: The tool uses a limited, hardcoded list of labels (about 35). For more accurate results, you can edit the labels.txt file in the trialnote folder to include more specific species or objects you want to identify. You might also explore replacing the default CLIP model with one specifically trained for bird or plant identification if you have the technical skill.

Keep going

More Academic & Research workflows