added a license and readme
All checks were successful
Build MuCaPy Executable / build-and-package (push) Successful in 1m49s

This commit is contained in:
rattatwinko
2025-05-30 21:43:27 +02:00
parent e7b4cc0f92
commit 1546528550
4 changed files with 201 additions and 9 deletions

41
LICENSE Normal file
View File

@@ -0,0 +1,41 @@
MuCaPy Proprietary Software License
Version 1.0 — May 30, 2025
Copyright © 2025 Rattatwinko
All Rights Reserved.
This software, including all source code, binaries, documentation, and associated files (collectively, the "Software"), is the exclusive property of the copyright holder.
The Software is proprietary and confidential. It is licensed, not sold, solely for internal, non-commercial use by the copyright holder or explicitly authorized individuals.
1. License Grant
The copyright holder does not grant any rights to use, copy, modify, distribute, sublicense, or create derivative works from the Software except as explicitly authorized in writing.
2. Restrictions
You shall not, under any circumstances:
Redistribute the Software in any form (source or binary).
Publish, transmit, upload, or make the Software publicly available.
Reverse engineer, decompile, or disassemble the Software.
Use the Software for any commercial or revenue-generating purpose.
Share the Software with third parties, contractors, or external collaborators.
Access to the Software must remain confined to private, secure environments under the control of the copyright holder.
3. Ownership
All title, ownership rights, and intellectual property rights in and to the Software remain solely with the copyright holder.
4. Termination
Any unauthorized use of the Software automatically terminates any implied rights and may result in legal action.
5. Disclaimer of Warranty
The Software is provided "AS IS" without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.
6. Limitation of Liability
In no event shall the copyright holder be liable for any damages, including direct, indirect, incidental, special, or consequential damages arising out of or related to the use or inability to use the Software.
This license is not OSI-approved and must not be interpreted as open-source. For internal use only.

156
README.md Normal file
View File

@@ -0,0 +1,156 @@
# MuCaPy: Multi-Camera Python🎥🧠
[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)
[![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey)]()
[![OpenCV](https://img.shields.io/badge/OpenCV-4.x-brightgreen)](https://opencv.org/)
[![Qt](https://img.shields.io/badge/PyQt5-Used-informational)](https://riverbankcomputing.com/software/pyqt/)
[![YOLO](https://img.shields.io/badge/YOLOv4-Supported-orange)]()
---
## 📌 Overview
**MuCaPy** (Multi-Camera Python) is a modern, robust, and user-friendly real-time multi-camera object detection platform powered by **YOLOv4** and **OpenCV**, designed with a professional PyQt5 GUI. It supports both **local** and **network IP cameras**, allows dynamic camera selection, advanced configuration, and comes with a beautiful dark-themed UI. CUDA support ensures high performance where available.
---
## ✨ Features
- 🔁 Connect multiple **local USB or IP cameras**
- 💡 Real-time **YOLOv4 object detection**
- 🎛️ Intelligent UI with **PyQt5**, collapsible dock widgets, and tabbed views
- 📸 Take **screenshots** per camera feed
- ⚙️ **Model loader** for dynamic YOLO weight/config/class sets
- 🔌 **Network camera support** with authentication
- 🖥️ **Hardware monitor** (CPU and per-core utilization via `psutil`)
- 🖼️ Fullscreen camera views & dynamic layout switcher
- 💾 Persistent **configuration management**
- 🧪 **Camera connectivity test tools**
---
## 📦 Requirements
```bash
pip install -r requirements.txt
```
<details>
<summary><strong>Dependencies:</strong></summary>
- Python 3.8+
- OpenCV (cv2)
- PyQt5
- NumPy
- Requests
- psutil
</details>
---
## 🚀 Getting Started
```bash
python main.py
```
> ✅ Make sure your YOLOv4 model directory contains `.weights`, `.cfg`, and `.names` files.
---
## 📁 Model Directory Structure
This is important! If you dont have the correct directory structure, the model loader won't work.
Models are Included in the Git Repository!
```bash
model/
├── yolov4.cfg
├── yolov4.weights
└── coco.names
```
---
## 🎮 UI Highlights
- **Model Loader**: Easily select model directory
- **Camera Selection**: Mix and match local/network sources
- **Layouts**: Switch between 1, 2, 3, 4, or grid layouts
- **FPS Control**: Adjustable frame rate
- **Dark Theme**: Developer-friendly aesthetic
- **Screenshot Button**: Save current camera frame
- **Hardware Stats**: Monitor CPU load in real-time
---
## 🔗 Recommended YOLOv4 Model Links
- [YOLOv4.cfg](https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4.cfg)
- [YOLOv4.weights](https://github.com/AlexeyAB/darknet/releases/download/yolov4/yolov4.weights)
- [COCO.names](https://github.com/pjreddie/darknet/blob/master/data/coco.names)
---
## 🔐 Network Camera Example
Supports URLs like:
- `http://192.168.1.101:8080/video`
- `http://username:password@ip:port/stream`
Authentication is optional and can be configured per-camera.
---
## 🧪 Camera Test Tools
- Test connectivity to any selected camera
- Auto-handle reconnection on failures
- Preview all selected feeds with drag-and-drop reordering
---
## ⚙️ Configuration & Persistence
This is also Very Important if you have multiple cameras or want to save / delete your settings. You can save your settings to a file and load them later.
Settings (last model, selected cameras, layout, FPS, etc.) are saved to:
- **Linux/macOS**: `~/.config/mucapy/config.json`
- **Windows**: `%APPDATA%\MuCaPy\config.json`
---
## 📸 Screenshot Storage
Default directory: `~/Pictures/MuCaPy` (can be changed from the UI)
---
## 📖 About
> _I built MuCaPy to learn about OpenCV, Python, and to have a simple, easy-to-use camera viewer for my Camera Server, since ContaCam doesn't work on my system (not well atleast!)._
---
## 🔮 To Be Added
- **YOLOv5 / YOLOv8 / YOLO-NAS support**
- **RTSP stream handling** _( Currently works but is fuzzy / crashes easily)_
- **Real-time performance dashboards**
- **WebSocket remote monitoring**
- **Not-so-laggy UI improvements**
- **Better CUDA implementation**
---
## 📄 License
This Project is currently under a Proprietary Licsence and shouldnt be distributed!
---
## 🧑‍💻 Maintainers
- 👤 Rattatwinko

View File

@@ -75,7 +75,6 @@ class Config:
def load_setting(self, key, default=None):
"""Load a setting from configuration"""
return self.settings.get(key, default)
class CameraThread(QThread):
"""Thread class for handling camera connections and frame grabbing"""
frame_ready = pyqtSignal(int, np.ndarray) # Signal to emit when new frame is ready (camera_index, frame)
@@ -300,7 +299,6 @@ class CameraThread(QThread):
if self.cap:
self.cap.release()
self.running = False
class MultiCamYOLODetector(QObject):
def __init__(self, parent=None):
super().__init__(parent)
@@ -553,7 +551,6 @@ class MultiCamYOLODetector(QObject):
print(f"Detection error: {e}")
return frame
class CameraDisplay(QLabel):
"""Custom QLabel for displaying camera feed with fullscreen support"""
def __init__(self, parent=None):
@@ -707,7 +704,6 @@ class CameraDisplay(QLabel):
# Draw text
painter.setPen(QPen(QColor(255, 255, 255)))
painter.drawText(rect, Qt.AlignCenter, self.camera_name)
class CollapsibleDock(QDockWidget):
"""Custom dock widget with collapse/expand functionality"""
def __init__(self, title, parent=None):
@@ -762,7 +758,6 @@ class CollapsibleDock(QDockWidget):
self.resize(self.original_size)
self.toggle_button.setIcon(QIcon.fromTheme("arrow-left"))
self.collapsed = False
class AboutWindow(QDialog):
def __init__(self, parent=None): # Add parent parameter with default None
super().__init__(parent) # Pass parent to QDialog
@@ -846,7 +841,6 @@ class AboutWindow(QDialog):
""")
self.setLayout(layout)
class NetworkCameraDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
@@ -982,7 +976,6 @@ class NetworkCameraDialog(QDialog):
if self.detector:
self.detector.remove_network_camera(name)
self.load_cameras()
class CameraSelectorDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
@@ -1311,11 +1304,10 @@ class CameraSelectorDialog(QDialog):
dialog = NetworkCameraDialog(self)
if dialog.exec_() == QDialog.Accepted:
self.refresh_cameras()
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Multi-Camera YOLO Detection")
self.setWindowTitle("MuCaPy - V1")
self.setGeometry(100, 100, 1200, 800)
# Initialize configuration
@@ -2245,6 +2237,9 @@ class MainWindow(QMainWindow):
self.stop_btn.setEnabled(False)
if __name__ == "__main__":
# Set the env
os.environ["XDG_SESSION_TYPE"] = "xcb"
app = QApplication(sys.argv)
# Set application style to Fusion for better dark mode support

BIN
mucapy/v7m/yolov7.pt Normal file

Binary file not shown.