This guide covers different installation options for ShortKit-ML.
- Python 3.9, 3.10, or 3.11
- pip or uv package manager
- PyTorch (torch) and torchvision (included in core install; see PyTorch with CUDA for GPU)
pip install shortcut-detectgit clone https://github.com/criticaldata/ShortKit-ML.git
cd Shortcut_Detect
pip install -e .The library has several optional dependency groups for different use cases:
Core functionality with all detection methods:
pip install shortcut-detectFor the interactive Gradio web interface:
pip install "shortcut-detect[dashboard]"For running examples in Jupyter notebooks:
pip install "shortcut-detect[jupyter]"For PDF/HTML report generation:
pip install "shortcut-detect[reporting]"For embedding generation from HuggingFace models:
pip install "shortcut-detect[hf]"VAE shortcut detection requires torch and torchvision; both are core dependencies and included in the default install. To explicitly install VAE support:
pip install "shortcut-detect[vae]"Install everything (recommended for development):
pip install "shortcut-detect[all]"uv is a fast Python package installer:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment
uv venv --python 3.10
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install with all dependencies
uv pip install -e ".[all]"For GPU acceleration (optional):
# CUDA 12.1
pip install torch==2.1.0+cu121 torchvision==0.16.0+cu121 \
--index-url https://download.pytorch.org/whl/cu121
# CUDA 11.8
pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 \
--index-url https://download.pytorch.org/whl/cu118To use the library in Jupyter notebooks:
# Install Jupyter support
pip install "shortcut-detect[jupyter]"
# Register the kernel
python -m ipykernel install --user --name=shortcut_detect --display-name="Python (Shortcut_Detect)"
# Launch Jupyter
jupyter labimport shortcut_detect
print(shortcut_detect.__version__) # Should print: 0.1.0
# Test imports
from shortcut_detect import ShortcutDetector, HBACDetector, SKLearnProbe
print("All imports successful!")If you get import errors, ensure all dependencies are installed:
pip install -e ".[all]" --force-reinstallIf PyTorch doesn't detect your GPU:
import torch
print(torch.cuda.is_available()) # Should be True
print(torch.cuda.device_count()) # Number of GPUsWeasyPrint requires system dependencies:
=== "Ubuntu/Debian"
```bash
sudo apt-get install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0
```
=== "macOS"
```bash
brew install pango gdk-pixbuf libffi
```
=== "Windows"
Install GTK3 runtime from [gtk.org](https://www.gtk.org/docs/installations/windows/)
- Quick Start Guide - Run your first shortcut detection
- Interactive Dashboard - Launch the web interface
- Detection Methods - Learn about each method