Skip to content
Β 
Β 

Latest commit

Β 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project Kestrel πŸ¦…

A Machine Learning-powered bird photography analysis and curation system that automatically detects, classifies, and evaluates bird images from RAW photography collections.

Python License Platform Donate | Visit Projectkestrel.org

At a Glance

Are you a bird photographer? Do you take hundreds or thousands of bird photos, often in bursts? Project Kestrel scans through your bird photos, grouping them by scene, finding the birds in each photo, and sorting them by the sharpness of the bird.

After Kestrel is done scanning, run the visualizer tool to instantly discover your favorite photos. As you drag your mouse across your photos, you'll see a zoom-in crop on the bird, so you can focus on evaluating the bird's pose or actions, rather than painstakingly finding images with slightly better sharpness.

  • NEW! Complete overhaul of the folder visualizer, now using a web-based framework that is extremely fast and responsive.
  • NEW! No more command lines needed! Kestrel's analyzer has a new GUI that shows you the analysis progress.
  • NEW! Rudimentary support for non-bird images. Use Kestrel to analyze other wildlife species! Note: this feature is in beta, and wildlife categories will not be accurate.
  • NEW! Bird Family Classification. Kestrel may understand that your bird is of one specific family (ex. a Sparrow), but unsure which exact species it is (Fox Sparrow or Song Sparrow). Kestrel now supports family classification, so you can search by "Sparrow sp." for these situations.

Gallery

Kestrel sorts all of your bird photos into scenes. alt text

Simply double-click on a scene to view all your photos, sorted by quality! Find a pose you like? Double-click to open in darktable, lightroom, or whatever photo software you prefer. alt text

Kestrel has sorted your photos from sharp to blurry. No more time painstakingly reviewing each bird! alt text

You can even search by bird species! (Note: Species detection is experimental and may be incorrect.) alt text

NEW! Kestrel's analyzer is more intuitive than ever before! Just open the GUI, pick your bird photo folder, and hit "Start!" alt text

🌟 Features

  • πŸ” Automatic Bird Detection: Kestrel will find exactly where the bird is in your photo
  • 🐦 Species Classification: (BETA) Kestrel will guess the bird species, allowing you to search by species!
  • ⭐ Quality Assessment: Sort your photos by image quality, from sharp to blurry! Kestrel will assign quality scores using a custom Machine Learning model.
  • πŸ“‚ Smart Organization: Groups similar images or bursts of photos into scenes to easily compare all images within a scene!
  • πŸ–ΌοΈ Interactive Visualizer: Responsive and fast. Shows close-ups of each bird. Double-click to open in your favorite editor (darktable is supported for now)
  • πŸ“Έ RAW File Support: Processes CR2, CR3, NEF, ARW, DNG, and other RAW formats
  • πŸ”— External Tool Integration: Direct integration with Darktable so you can stop sorting and start editing!

πŸš€ Quick Start

Prerequisites

  • Python 3.12+
  • Windows OS (primary support, macOS support is planned)
  • ImageMagick (for RAW file reading via Wand)

To install ImageMagick, visit their download page and install the latest Q8 dynamic release.

Installation

  1. Clone the repository:
git clone https://github.com/SanjaySoniLV/ProjectKestrel.git
cd ProjectKestrel
  1. Install dependencies:
pip install -r requirements.txt

Usage

1. Analyze a Photo Directory

First open the analyzer.

python analyzer.py

Select a folder and hit start. The script will:

  • Process each image to detect birds, classify species, and assess quality
  • Generate a database of results in .kestrel/kestrel_database.csv
  • Create export JPEGs and cropped bird images

image

Note: The script will take some time to run. All progress is saved automatically. If you encounter any errors, try re-running the script, and Kestrel will continue where it left off.

Note: Kestrel comes with a set of test images. Simply open the test_imgs folder and hit Start.

2. Visualize Results

Launch the interactive visualizer to browse your analyzed photos:

python visualizer.py

Open the folder that you analyzed to explore its contents and Kestrel's analysis: alt text

Features of the visualizer:

  • Scene View: Browse grouped similar images
  • Species Search: Filter by bird species keywords
  • Quality Sorting: Images automatically sorted by quality score
  • Detailed View: Examine individual images with metadata
  • External Tools: Open original files or simply double-click to launch Darktable

πŸ“Š How It Works

1. Bird Detection

  • Uses PyTorch's Mask R-CNN ResNet50 FPN v2 model
  • Detects and segments birds in images
  • Generates precise masks to ensure image quality is assessed on bird pixels only, not background pixels.

2. Species Classification

  • A custom machine learning model was trained for bird species identification for North American birds.
  • Improvements to classification are planned.

3. Quality Assessment

  • A custom machine learning model was trained to analyze the quality of the images.
  • Factors in noise, motion blur, out-of-focus images, and other artifacts into one score.
  • Only evaluates image regions corresponding to the bird, NOT any branches, backgrounds, or other regions.
  • Quality scores are used to rank images within a scene by sharpness.

4. Scene Grouping

  • A custom image similarity algorithm was developed to identify images that belong to the same scene.
  • Bursts are automatically grouped together, allowing their relative quality to be ranked with ease.

πŸ—‚οΈ Project Structure

ProjectKestrel/
β”œβ”€β”€ analyze_directory.py    # Main analysis script
β”œβ”€β”€ visualizer.py          # Visualization interface
β”œβ”€β”€ models/                # AI model files
β”‚   β”œβ”€β”€ model.onnx        # Species classifier
β”‚   β”œβ”€β”€ labels.txt        # Species labels
β”‚   └── quality.keras     # Quality assessment model
β”œβ”€β”€ package-list.txt       # Conda environment specification
└── README.md             # This file

🎯 Supported File Formats

Kestrel's quality scoring model is trained on RAW images, and may not work as well for JPG images. Kestrel relies on ImageMagick to read RAW files. If your camera's RAW format is not listed below, please create a pull request, and we will add it to the list.

RAW Formats (preferred):

  • Canon: .cr2, .cr3
  • Nikon: .nef
  • Sony: .arw
  • Adobe: .dng
  • Olympus: .orf
  • Fuji: .raf
  • Panasonic: .rw2
  • Pentax: .pef
  • Samsung: .sr2
  • Sigma: .x3f

Note: If this list does not support your camera's RAW file, please reach out via the email below. It is very easy to add new RAW file formats thanks to the ImageMagick Library.

Standard Formats (fallback):

  • JPEG: .jpg, .jpeg
  • PNG: .png

πŸ”§ Configuration

GPU Acceleration

When running analyze_directory.py, you'll be prompted to choose between:

  • GPU Mode: Uses DirectML execution provider (faster, requires compatible GPU)
  • CPU Mode: Uses CPU execution provider (slower, but works on all systems)

NOTE: Not all models are run on the GPU, and GPU acceleration is in Beta development and may be unstable. If you run into errors or instability, please use CPU mode.

Output Structure

Processed images are organized in a .kestrel folder within your photo directory:

your_photos/
β”œβ”€β”€ .kestrel/
β”‚   β”œβ”€β”€ export/           # Resized JPEG exports
β”‚   β”œβ”€β”€ crop/            # Cropped bird images
β”‚   └── kestrel_database.csv  # Analysis results
└── [your original photos]

The .kestrel folder will require an additional 1MB of disk space for every ~100MB of RAW files. Once the .kestrel folder has been created,

🀝 Contributing

Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest features.

Donations are welcome. Please donate via PayPal/Card

❓ Contact Me

Direct questions or comments to support@projectkestrel.org

πŸ“„ License

This project is licensed under the GPL v3 License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • PyTorch team for Mask R-CNN implementation
  • TensorFlow/Keras for the neural network framework
  • ONNX Runtime for efficient model inference
  • ImageMagick/Wand for robust image file handling
  • PyQt5 for the user interface framework

Note: This project is designed primarily for bird photography analysis. Functionality for other wildlife is planned but not a priority at this time.

About

Empowering bird photographers to find their favorite photos quickly and effortlessly

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages