Skip to main content

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]

See INSTALL.md for detailed installation instructions.

🔍 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

  1. Access the Nedo Vision frontend
  2. Navigate to Worker Management
  3. Create a new worker
  4. 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

  1. Worker Registration: Create a worker through the Nedo Vision frontend
  2. Token Generation: System generates a unique authentication token
  3. Service Initialization: Worker service authenticates using the token
  4. Connection Setup: Service establishes secure connections to backend services
  5. Task Processing: Worker receives and processes computer vision tasks
  6. 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/storage

The 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

  1. Command-line arguments (highest priority)
  2. Environment variables (legacy support)
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nedo_vision_worker-1.2.4.tar.gz (108.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nedo_vision_worker-1.2.4-py3-none-any.whl (157.4 kB view details)

Uploaded Python 3

File details

Details for the file nedo_vision_worker-1.2.4.tar.gz.

File metadata

  • Download URL: nedo_vision_worker-1.2.4.tar.gz
  • Upload date:
  • Size: 108.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for nedo_vision_worker-1.2.4.tar.gz
Algorithm Hash digest
SHA256 67acc34d0b83734457336902004dc72ef3a9820ecde633d87711756820deb8ef
MD5 0256b18a8586f8448c15b325fcafb447
BLAKE2b-256 84f4230c9dbcc252f10ad1cf3c1113a6df5085d7d046a97e191300e58516bf5a

See more details on using hashes here.

File details

Details for the file nedo_vision_worker-1.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nedo_vision_worker-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 799a0be82fb4c0399dc6d75a62dbea50e13009444260984c7f32a2eaa00b9514
MD5 eeb6d8a430d29aaf7f110178488d3192
BLAKE2b-256 f760843c9c3e1e670836225abb28d66e13ac400a451963f37ebef0230481a28d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page