Nedo Vision Worker Service Library for AI Vision Processing
Project description
Nedo Vision Worker Service
A high-performance, multiplatform Python worker service for the Nedo Vision system that handles AI-powered computer vision tasks with GPU acceleration support.
🚀 Features
- 🎯 AI-Powered Computer Vision - Advanced object detection and video processing
- 🔐 Token-Based Authentication - Secure worker registration and management
- ⚡ GPU Acceleration - NVIDIA CUDA support for high-performance inference
- 🌍 Multiplatform Support - Linux, Windows, macOS, ARM devices, and cloud platforms
- 🚀 Jetson Optimized - Native support for NVIDIA Jetson devices
- ☁️ Cloud Ready - Docker, Kubernetes, and major cloud platform support
- 🔧 Self-Diagnostic - Built-in system requirements checker
- 📊 Real-time Monitoring - System usage and performance metrics
📋 System Requirements
Minimum Requirements
- Python: 3.8+
- CPU: 2 cores, 1.5 GHz
- RAM: 2 GB
- Storage: 1 GB free space
Recommended Requirements
- CPU: 4+ cores, 2.0+ GHz
- RAM: 4+ GB (8+ GB for GPU acceleration)
- GPU: NVIDIA GPU with CUDA support (optional)
- Storage: 5+ GB free space
Supported Platforms
- Linux (x86_64, ARM64, ARMv7) - Ubuntu, Debian, CentOS, Alpine
- Windows (x86_64) - Windows 10+, Server 2019+
- macOS (x86_64, Apple Silicon) - macOS 10.15+
- NVIDIA Jetson - Nano, Xavier NX, Xavier AGX, Orin
- Cloud Platforms - AWS, GCP, Azure (with GPU instance support)
🛠️ Installation
Quick Install (PyPI)
pip install nedo-vision-worker
Platform-Specific Installation
Standard Linux/Windows/macOS
# Install from PyPI
pip install nedo-vision-worker
# Verify installation
nedo-worker doctor
NVIDIA Jetson Devices
# Use system OpenCV for optimal performance
sudo apt install python3-opencv
# Install without OpenCV dependency
pip install nedo-vision-worker --no-deps
pip install alembic ffmpeg-python grpcio pika protobuf psutil pynvml requests SQLAlchemy
# Verify Jetson-specific features
nedo-worker doctor
ARM Devices (Raspberry Pi, etc.)
# Install with ARM-optimized packages
pip install nedo-vision-worker
# For headless servers, use lightweight OpenCV
pip install opencv-python-headless --upgrade
Docker Deployment
# GPU-enabled container
FROM nvidia/cuda:11.8-runtime-ubuntu20.04
RUN pip install nedo-vision-worker
# CPU-only container
FROM python:3.9-slim
RUN apt-get update && apt-get install -y ffmpeg
RUN pip install nedo-vision-worker
Development Installation
# Clone the repository
git clone https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
cd nedo-vision-worker-service
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .
# Install development dependencies
pip install -e .[dev]
🔍 System Diagnostics
Before running the worker service, use the built-in diagnostic tool to verify your system:
nedo-worker doctor
This will check:
- ✅ Platform compatibility and architecture
- ✅ Python version and dependencies
- ✅ FFmpeg installation and functionality
- ✅ OpenCV installation and optimizations
- ✅ NVIDIA GPU support and capabilities
- ✅ Storage permissions
📖 Quick Start
1. Get Your Worker Token
- Access the Nedo Vision frontend
- Navigate to Worker Management
- Create a new worker
- Copy the generated authentication token
2. Run System Check
nedo-worker doctor
3. Start the Worker Service
# Basic usage
nedo-worker run --token YOUR_TOKEN_HERE
# With custom configuration
nedo-worker run --token YOUR_TOKEN_HERE \
--server-host custom.server.com \
--storage-path /custom/storage/path \
--system-usage-interval 60
💻
💻 Usage
Command Line Interface
The service uses a modern CLI with subcommands:
# Check system compatibility and requirements
nedo-worker doctor
# Run the worker service
nedo-worker run --token YOUR_TOKEN
# Get help
nedo-worker --help
nedo-worker run --help
nedo-worker doctor --help
Available Commands
doctor - System Diagnostics
# Run comprehensive system check
nedo-worker doctor
# Check specific components
nedo-worker doctor --verbose
run - Start Worker Service
# Basic usage
nedo-worker run --token YOUR_TOKEN
# Advanced configuration
nedo-worker run \
--token YOUR_TOKEN \
--server-host be.vision.sindika.co.id \
--server-port 50051 \
--storage-path ./data \
--system-usage-interval 30
Configuration Options
| Parameter | Description | Default | Required |
|---|---|---|---|
--token |
Worker authentication token | - | ✅ |
--server-host |
Backend server hostname | be.vision.sindika.co.id |
❌ |
--server-port |
Backend server port | 50051 |
❌ |
--storage-path |
Local storage directory ⚠️* | ./data |
❌ |
--system-usage-interval |
System metrics interval (seconds) | 30 |
❌ |
⚠️ Storage Path Note: If using Nedo Vision Worker Core, both services must use the same storage path for proper data sharing and model access.
Programmatic Usage
from nedo_vision_worker.worker_service import WorkerService
# Create service instance
service = WorkerService(
server_host="be.vision.sindika.co.id",
token="your-token-here",
storage_path="./custom_storage",
system_usage_interval=60
)
# Initialize and run
if service.initialize():
print("Service initialized successfully")
service.run() # This blocks until service stops
else:
print("Failed to initialize service")
Connection Information Client
from nedo_vision_worker.services.ConnectionInfoClient import ConnectionInfoClient
# Create client
client = ConnectionInfoClient(
host="be.vision.sindika.co.id",
port=50051,
token="your-token-here"
)
# Get connection information
result = client.get_connection_info()
if result["success"]:
print(f"RabbitMQ Host: {result['rabbitmq_host']}")
print(f"RabbitMQ Port: {result['rabbitmq_port']}")
print(f"Database URL: {result['database_url']}")
else:
print(f"Error: {result['error']}")
🔐 Authentication Flow
- Worker Registration: Create a worker through the Nedo Vision frontend
- Token Generation: System generates a unique authentication token
- Service Initialization: Worker service authenticates using the token
- Connection Setup: Service establishes secure connections to backend services
- Task Processing: Worker receives and processes computer vision tasks
- Monitoring: Continuous system monitoring and health reporting
⚙️ Configuration Management
⚙️ Configuration Management
⚠️ Important Notice - Storage Path Coordination
If you're using Nedo Vision Worker Core alongside this service, ensure both services use the same storage path. This is critical for proper data sharing and model access between services.
# Example: Both services should use identical storage paths nedo-worker run --token YOUR_TOKEN --storage-path /shared/nedo/storage nedo-worker-core --storage-path /shared/nedo/storageThe storage path contains:
- 📁 Models - Shared AI models and weights
- 📁 Temporary files - Processing artifacts and cache
- 📁 Logs - Service operation logs
- 📁 Configurations - Runtime settings and preferences
Environment Variables (Legacy Support)
export NEDO_WORKER_TOKEN="your-token-here"
export NEDO_SERVER_HOST="be.vision.sindika.co.id"
export NEDO_STORAGE_PATH="./data"
# Run with environment variables (deprecated)
nedo-worker run
Configuration Priority
- Command-line arguments (highest priority)
- Environment variables (legacy support)
- Default values (lowest priority)
🚀 Platform-Specific Setup
Windows Setup
Prerequisites
# Install Chocolatey (package manager)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install FFmpeg
choco install ffmpeg -y
# Verify installation
ffmpeg -version
Worker Installation
# Install Python package
pip install nedo-vision-worker
# Run system check
nedo-worker doctor
# Start worker
nedo-worker run --token YOUR_TOKEN
Linux Setup
Ubuntu/Debian
# Update system
sudo apt update
# Install FFmpeg
sudo apt install ffmpeg python3-pip
# Install worker
pip3 install nedo-vision-worker
# Run diagnostics
nedo-worker doctor
CentOS/RHEL
# Install EPEL repository
sudo yum install epel-release
# Install dependencies
sudo yum install ffmpeg python3-pip
# Install worker
pip3 install nedo-vision-worker
NVIDIA Jetson Setup
# Ensure JetPack is installed
sudo apt update
# Use system OpenCV (optimized for Jetson)
sudo apt install python3-opencv
# Install worker without OpenCV
pip3 install nedo-vision-worker --no-deps
pip3 install alembic ffmpeg-python grpcio pika protobuf psutil pynvml requests SQLAlchemy
# Verify GPU support
nedo-worker doctor
# Check Jetson stats
sudo /usr/bin/tegrastats
macOS Setup
# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install FFmpeg
brew install ffmpeg
# Install worker
pip3 install nedo-vision-worker
# Run diagnostics
nedo-worker doctor
🔧 Troubleshooting
Common Issues
1. FFmpeg Not Found
# Check if FFmpeg is installed
ffmpeg -version
# Install FFmpeg
# Ubuntu/Debian: sudo apt install ffmpeg
# Windows: choco install ffmpeg
# macOS: brew install ffmpeg
2. OpenCV Issues on ARM
# For ARM devices, try headless version
pip uninstall opencv-python
pip install opencv-python-headless
3. GPU Not Detected
# Check NVIDIA drivers
nvidia-smi
# Check CUDA installation
nvcc --version
# Run system diagnostics
nedo-worker doctor
4. Connection Issues
# Test network connectivity
ping be.vision.sindika.co.id
# Check firewall settings
# Ensure port 50051 is accessible
# Verify token
nedo-worker run --token YOUR_TOKEN --verbose
Debug Mode
# Run with verbose logging
nedo-worker run --token YOUR_TOKEN --verbose
# Check logs
tail -f ~/.nedo_worker/logs/worker.log
Performance Optimization
For High-Performance Workloads
# Increase system usage interval
nedo-worker run --token YOUR_TOKEN --system-usage-interval 60
# Use dedicated storage path
nedo-worker run --token YOUR_TOKEN --storage-path /fast/ssd/storage
For Resource-Constrained Devices
# Use minimal configuration
nedo-worker run --token YOUR_TOKEN --system-usage-interval 120
Development Setup
# Clone and setup
git clone https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
cd nedo-vision-worker-service
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install in development mode
pip install -e .[dev]
# Run tests
pytest
# Format code
black .
isort .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nedo_vision_worker-1.2.0.tar.gz.
File metadata
- Download URL: nedo_vision_worker-1.2.0.tar.gz
- Upload date:
- Size: 108.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0751557966b4b6901326966acdfad6035047f1ba3a057991866ef0d0a7f403d
|
|
| MD5 |
045a34ee6bf11e851b9bdd0023dc81b8
|
|
| BLAKE2b-256 |
6a5d3d8766bdf962aba76753bb3be0bd5f2ef01fec3be6e9c768699fb27def11
|
File details
Details for the file nedo_vision_worker-1.2.0-py3-none-any.whl.
File metadata
- Download URL: nedo_vision_worker-1.2.0-py3-none-any.whl
- Upload date:
- Size: 156.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
962446d93d75752f1e90494fe770659f81bbda7e155130d59caf65f1d4593eb3
|
|
| MD5 |
71f11c80c66d9b923adb41ed89a75e63
|
|
| BLAKE2b-256 |
bac5cf71f7f21ad9ae7ec0e2576df13e806c110568df60759807f6cb6848f72e
|