Skip to content

Xiw2000/strawdi_tracking

 
 

Repository files navigation

Strawberry Tracker

Project Description

Strawberry Tracker is an experiment designed to detect and count strawberries on trees using computer vision algorithms. The main objectives are to implement and train an object detector using the StrawDI dataset and to integrate this trained detector into a tracking algorithm for analyzing video sequences.

Objectives

  1. Train Object Detector: Implement and train an object detection model on the StrawDI dataset.
  2. Integrate Tracking Algorithm: Incorporate the trained object detector into a tracking algorithm to perform strawberry tracking on the provided video sequence (test.mp4).

Method

Object Detection

  • Pretrained Model: Utilize the Faster R-CNN (Region-based Convolutional Neural Network) model as a pretrained object detector for identifying strawberries in images.
  • Training: Fine-tune the pretrained Faster R-CNN model using the StrawDI dataset to adapt it for strawberry detection.

Tracking Algorithm

  • Tracking Approach: Implement tracking using the Hungarian Algorithm combined with Intersection-over-Union (IoU) metrics to track detected strawberries across video frames.

Setup and Installation

Prerequisites

  • Python 3.x
  • Required libraries: torch, torchvision, opencv-python, numpy, etc.

Installation

  1. Clone the Repository

    git clone https://github.com/yourusername/strawberry-tracker.git
    cd strawdi_tracking
  2. Create a Virtual Environment

python -m venv env
source env/bin/activate  # On Windows use `env\Scripts\activate`
  1. Install Dependencies
pip install -r requirements.txt

Usage

Prepare the Dataset

Download the StrawDI dataset from here and run:

cd strawdi_tracking
unzip dataset.zip

Train the Object Detector

python train_detector.py --dataset_path /path/to/strawdi/dataset

Run the Tracking Algorithm

python track_strawberries.py --video_path /path/to/test.mp4 --model_path /path/to/trained/model
  • --video_path: Path to the video file (test.mp4).
  • --model_path: Path to the trained object detection model.

Results

Detection: The object detector should be able to identify strawberries with high accuracy.

Demo

Tracking: The tracking algorithm should maintain the identity of each detected strawberry throughout the video sequence.

Demo

Contributing

Feel free to contribute to this project by submitting issues or pull requests. Contributions are always welcome!

Contact

For any questions or further information, please contact:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.4%
  • Python 0.6%