Skip to content

karthikeya-ms/label-lwf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Labeling Tool for Camera Trap Images at LWF

A custom Python-based labeling tool with a modern Tkinter GUI for annotating wildlife images based on species gender, age class, and behavior. This tool integrates image processing (using OpenCV and Pillow) and data management (with Pandas and NumPy) to streamline the labeling process and export data for AI training.

Features

  • Intuitive GUI:
    Easily select folders, view images, and label images with radio buttons for Sex/Gender, Age_Class, and Behaviour.
  • Image Processing:
    Automatically crops images using a red bounding box and resizes images to fit the display area.
  • Data Management:
    Loads images from a folder and exports labeling data to a CSV file.
  • Modular Codebase:
    Organized into separate modules for GUI, image processing, and data management.
  • Packaging Support:
    Can be built into a standalone executable (.exe) using PyInstaller.

GUI Screenshot

Below is a screenshot of the application's GUI:

GUI Screenshot

Note: Place your screenshot image (e.g., gui_screenshot.png) in the repository root or update the path accordingly.

Repository Structure

LabelingTool/
├── pyproject.toml         # Poetry configuration file
├── README.md              # This file
├── .gitignore             # Files/directories to ignore in git
└── src/
    ├── __init__.py
    ├── main.py            # Application entry point
    ├── gui.py             # GUI code and layout
    ├── image_processing.py  # Functions for image cropping and resizing
    └── data_management.py   # Functions for data loading and CSV generation

Installation

Prerequisites

  • Python: Recommended version: 3.12 (supported up to 3.14).
  • pyenv: For managing your Python versions.
  • Poetry: For dependency management and project isolation.

Setup with pyenv & Poetry

  1. Clone the Repository:

    git clone https://github.com/your-username/label-lwf.git
    cd label-lwf
  2. Set the Python Version:

    Install and set the local Python version using pyenv:

    pyenv install 3.12.0  # if not already installed
    pyenv local 3.12.0
  3. Configure and Install Dependencies:

    Install all dependencies (ensure your pyproject.toml has python = ">=3.12,<3.14"):

    poetry install
  4. Add PyInstaller as a Development Dependency:

    poetry add --group dev pyinstaller
  5. Activate the Poetry Shell:

    poetry shell

Usage

Running the Application

With your Poetry environment active, run the application using:

python -m src.main

This command launches the GUI for the labeling tool.

Packaging as a Standalone Executable

To package the tool as a Windows executable (.exe):

  1. From the project root, run:

    poetry run pyinstaller --onefile --windowed src/main.py
  2. The executable will be created in the dist directory (e.g., main.exe).

  3. Test the executable by navigating to the dist folder and running:

    ./main.exe

Contributing

Contributions are welcome! Please open issues or submit pull requests. Follow the project's coding style and add tests as needed.

License

This project is licensed under the MIT License.

Contact

For questions or suggestions, please open an issue or contact writetokarthikeya99@gmail.com.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published