Skip to content

anishk85/yolo-keyboard-key-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLO Keyboard Key Detection

A project for detecting keyboard keys using YOLOv8, optimized for NVIDIA RTX 4060 (8GB VRAM).


🎥 Demo Video

YOLO Keyboard Key Detection Demo

Watch the full demonstration: YOLO Keyboard Key Detection in Action


🚀 Features

  • Train YOLOv8 models for keyboard key detection
  • Inference on images and real-time webcam streams
  • Easy integration with Roboflow datasets
  • Optimized for consumer GPUs

📁 Project Structure

.
├── scripts/
│   ├── train_keyboard_detector.py
│   └── test_inference.py
├── data/
│   └── keyboard_dataset/         # (excluded from repo, see below)
├── results/                      # (excluded from repo)
├── requirements.txt
├── .gitignore
└── README.md

🗂️ Dataset

Dataset is NOT included in this repository.

  • Download your dataset from Roboflow (export in YOLOv8 format).
  • Place it in:
    data/keyboard_dataset/
  • Your folder should look like:
    data/keyboard_dataset/
      images/
        train/
        valid/
        test/
      labels/
        train/
        valid/
        test/
      data.yaml
    

⚙️ Setup

  1. Clone this repo:

    git clone https://github.com/anishk85/yolo-keyboard-key-detection.git
    cd yolo_keyboard_project
  2. Create and activate a Python environment (optional but recommended):

    python3 -m venv yolo_keyboard_env
    source yolo_keyboard_env/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

🏋️‍♂️ Training

Train your YOLO model with:

python3 scripts/train_keyboard_detector.py
  • Adjust parameters in train_keyboard_detector.py as needed.

Before training or inference, you can verify that your environment and dependencies are set up correctly:

python3 scripts/verify_installation.py

This script will:

  • Check your system info (CPU, RAM, Python version)
  • Check GPU and CUDA availability
  • Check all required Python libraries and their versions
  • Test YOLO model loading and inference (CPU and GPU)
  • Test GPU memory usage and recommend a batch size

If all tests pass, your system is ready for YOLO keyboard detection!


🔍 Inference

On a single image:

python3 scripts/test_inference.py --model <path_to_best.pt> --image <path_to_image>

With your webcam:

python3 scripts/test_inference.py --model <path_to_best.pt> --webcam

List available cameras:

python3 scripts/test_inference.py --list-cameras

📝 Notes

  • Do NOT commit large datasets or model weights.
    See .gitignore for excluded files.
  • For best results, use a GPU.
  • For dataset details and annotation format, see Roboflow documentation

📄 License

This project is licensed under the MIT License.


🙏 Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors