This project utilizes the YOLOv5 object detection model to identify forklifts within images or video frames. Forklift detection is crucial in industrial and logistical contexts for ensuring safety and operational efficiency. By leveraging deep learning techniques, particularly YOLOv5, we aim to develop an accurate and efficient solution for forklift detection.
Result
-
Clone the YOLOv5 repository:
git clone https://github.com/ultralytics/yolov5.git
-
Install dependencies:
pip install -r requirements.txt
-
Clone this project repository:
git clone <https://github.com/ToanNguyenKhanh/Forklift-Object-detection>
-
Navigate to the project directory:
cd yolov5
-
Prepare your dataset:
-
Prepare your dataset:
- Download the forklift detection dataset from Roboflow.
- Ensure your dataset contains images or video frames with annotated forklift instances.
- Organize the dataset into appropriate directories, such as 'train' and 'val' for training and validation data.
-
Train the YOLOv5 model:
- Modify the training configuration in the
train.yaml
file according to your dataset. - Train the model using the following command:
python train.py --img 640 --epochs 50 --data forklift.yaml --weights yolov5n.pt
- Modify the training configuration in the
-
Evaluate the trained model:
- Evaluate the trained model's performance on the validation set:
python val.py --data dataset.yaml --weights runs/train/exp3/weights/best.pt --task val
- Evaluate the trained model's performance on the validation set:
-
Test the model on new images or video:
- Use the trained model to detect forklifts in images:
python detect.py --source <image_path> --weights runs/train/exp3/weights/best.pt --img 640
- For video detection, replace
<image_path>
with the path to your video file.
- Use the trained model to detect forklifts in images:
-
Result
Ensure your dataset contains a sufficient number of diverse images or video frames depicting forklifts in various orientations, lighting conditions, and backgrounds. Annotated bounding boxes should accurately enclose the forklifts in the images.
Experiment with different YOLOv5 model variants (e.g., yolov5s
, yolov5m
, yolov5l
, yolov5x
) and adjust parameters such as input image size, batch size, and training epochs to optimize performance based on your specific requirements and computational resources.
Contributions to this project are welcome. Feel free to submit pull requests for bug fixes, enhancements, or additional features.
This project is licensed under the MIT License. See the LICENSE
file for details.
- We acknowledge the YOLOv5 developers for their outstanding work on the object detection framework.
- Special thanks to the contributors and open-source community for their valuable contributions and support.
For any inquiries or feedback, please contact [nktoan163@gmail.com].
- YOLOv5 GitHub Repository: https://github.com/ultralytics/yolov5
- YOLOv5 Paper: [YOLOv5: End-to-End Real-Time Object Detection with YOLO]
This project is for educational and research purposes only.