VisionGuard is a comprehensive Python library for computer vision tasks, specializing in object detection, image classification, and real-time video analysis. It provides a modular framework for building, training, and deploying robust vision models, leveraging popular libraries like OpenCV and PyTorch. The project aims to offer high-performance solutions for security, surveillance, and automated inspection systems.
- Real-time Object Detection: Implementations of popular object detection models (e.g., YOLO, SSD) for live video streams.
- Image Classification: Tools for training and evaluating image classification models on custom datasets.
- Advanced Preprocessing: Utilities for image augmentation, normalization, and resizing.
- Model Training & Evaluation: Customizable training loops with support for various loss functions and metrics.
- Deployment Ready: Optimized for efficient inference on edge devices and cloud platforms.
- Interactive Visualization: Functions for drawing bounding boxes, displaying class labels, and visualizing model predictions.
To get started with VisionGuard, clone the repository and install the required dependencies:
git clone https://github.com/Eation5/VisionGuard.git
cd VisionGuard
pip install -r requirements.txtHere's a quick example of how to use VisionGuard for real-time object detection:
import cv2
import torch
from visionguard.models import YOLOv5
from visionguard.utils import draw_boxes
# 1. Initialize YOLOv5 model (pre-trained)
model = YOLOv5(model_path=\'yolov5s.pt\') # Assuming yolov5s.pt is downloaded
# 2. Open video capture (0 for webcam, or path to video file)
cap = cv2.VideoCapture(0)
if not cap.isOpened():
print("Error: Could not open video stream.")
exit()
while True:
ret, frame = cap.read()
if not ret:
break
# 3. Perform inference
detections = model.predict(frame)
# 4. Draw bounding boxes on the frame
annotated_frame = draw_boxes(frame, detections)
# 5. Display the result
cv2.imshow("VisionGuard Object Detection", annotated_frame)
# Break loop on 'q' key press
if cv2.waitKey(1) & 0xFF == ord(\'q\'):
break
# 6. Release resources
cap.release()
cv2.destroyAllWindows()VisionGuard/
├── README.md
├── requirements.txt
├── setup.py
├── visionguard/
│ ├── __init__.py
│ ├── models.py
│ ├── preprocessing.py
│ ├── utils.py
│ └── datasets.py
└── tests/
├── __init__.py
└── test_models.py
We welcome contributions! Please see CONTRIBUTING.md for details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries, please open an issue on GitHub or contact Matthew Wilson at matthew.wilson.ai@example.com.