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.
- Train Object Detector: Implement and train an object detection model on the StrawDI dataset.
- Integrate Tracking Algorithm: Incorporate the trained object detector into a tracking algorithm to perform strawberry tracking on the provided video sequence (
test.mp4
).
- 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 Approach: Implement tracking using the Hungarian Algorithm combined with Intersection-over-Union (IoU) metrics to track detected strawberries across video frames.
- Python 3.x
- Required libraries:
torch
,torchvision
,opencv-python
,numpy
, etc.
-
Clone the Repository
git clone https://github.com/yourusername/strawberry-tracker.git cd strawdi_tracking
-
Create a Virtual Environment
python -m venv env
source env/bin/activate # On Windows use `env\Scripts\activate`
- Install Dependencies
pip install -r requirements.txt
Download the StrawDI dataset from here and run:
cd strawdi_tracking
unzip dataset.zip
python train_detector.py --dataset_path /path/to/strawdi/dataset
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.
Detection: The object detector should be able to identify strawberries with high accuracy.
Tracking: The tracking algorithm should maintain the identity of each detected strawberry throughout the video sequence.
Feel free to contribute to this project by submitting issues or pull requests. Contributions are always welcome!
For any questions or further information, please contact:
- Author: Warakorn Jetlohasiri
- Email: warakornjetlohasiri@gmail.com