Installation
Prerequisites
Before starting, make sure you have:
- Python 3.6+: The codebase uses Python 3.6 or newer. Check your version with
python --version - Git: To clone the repository. Check with
git --version - Bash or Zsh: For running shell scripts
- ~500 MB of disk space: For Python packages and sample models
Depending on your installation method, you may also need:
- Docker (for Docker setup): Version 20.10+ recommended
- CUDA/GPU support (optional): For training on GPUs, requires CUDA 11.0+ and NVIDIA GPU
- Virtual environment (for local setup): Python venv or virtualenv
Method 1: Docker (Recommended for First-Time Users)
Docker is the easiest way to get started. It provides a complete, self-contained environment with all dependencies.
Step 1: Clone the Repository
git clone https://github.com/yourorg/deepsentry.git
cd deepsentry
Step 2: Build the Docker Image
bash docker_image_build.sh
This builds a Docker image with Python 3.8, TensorFlow, Keras, and all required dependencies.
Step 3: Verify the Installation
docker run -it deepsentry:latest python --version
Running Commands in Docker
Use the provided scripts in dockerrun/ to run training and evaluation.
Method 2: Local Installation with Virtual Environment
For development or local execution:
Step 1: Clone and Create Virtual Environment
git clone https://github.com/yourorg/deepsentry.git
cd deepsentry
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Step 2: Install Dependencies
pip install --upgrade pip
pip install -r requirements.txt
Step 3: Verify Installation
python -c "import tensorflow; print(tensorflow.__version__)"
pytest t/ -v
Method 3: GPU Support
For NVIDIA GPU acceleration, install GPU-specific dependencies after Method 2:
pip install --upgrade tensorflow[and-cuda]
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Project Structure
After installation:
deepsentry/
├── src/
│ ├── tx/ # Text encoding
│ ├── an/ # Anomaly detection
│ ├── live/ # Live monitoring
│ └── ...
├── ta/ # Text autoencoder
├── kad/ # Keras anomaly detector
├── dockerconfig/ # Config files
├── dockerrun/ # Run scripts
└── docs/ # Documentation