This project leverages the YOLOv8 model for object detection, enabling users to train custom models, make predictions on images and videos, and perform utility tasks such as moving the cursor and extracting text from the screen. The scripts are designed to be run with minimal configuration and can be easily adapted to different use cases.
This project is designed to facilitate object detection tasks using the YOLOv8 model. It includes scripts for training the model, making predictions on both images and videos, and a utility script for moving the cursor and extracting text from the screen. The goal is to provide a comprehensive toolkit for developing and deploying object detection applications.
-
Clone the repository:
git clone https://github.com/yourusername/yourproject.git cd yourproject
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
To train the YOLOv8 model, run the train.py
script. Make sure you have the configuration files (yolov8s.yaml
and config.yaml
) properly set up.
python train.py
To run predictions on images, use the predict.py script. Specify the input and output directories in the script.
python predict.py
To run predictions on videos, use the predict_video.py script. Set the video_path to the path of your input video.
python predict_video.py
The movecursor.py script allows you to move the cursor randomly within a specified range and extract text from a screen region.
python movecursor.py
Python 3.8+ ultralytics cv2 (OpenCV) pytesseract pyautogui numpy easyocr To install dependencies, run:
pip install -r requirements.txt