📚 Documentation & Downloads
For full documentation, publication details, and pre-built executables, please visit our official website: onsightpathology.github.io
This document describes how to run OnSight Pathology locally, how to build the application from source on Windows and macOS, and where to find model training pipelines.
Pre-built packages and additional resources are available through the following platforms:
OnSight Pathology is designed to be cross-platform.
linux branch).python -m venv onsight_env
onsight_env\Scripts\activate # Windows
source onsight_env/bin/activate # macOS / Linux
Confirm Python version:
python --version
Recommended: Python 3.11.9
Two dependency files are provided:
| File | Description |
|---|---|
requirements.txt | GPU version (CUDA 12.8 PyTorch wheels) |
requirements_cpu.txt | CPU-only version |
GPU:
pip install -r requirements.txt
CPU:
pip install -r requirements_cpu.txt
Device selection at runtime is handled by device_compat.py, which transparently picks CUDA → MPS → CPU in that order. No code changes are needed when switching machines.
python app.py
This launches the PyQt6 desktop application. No additional configuration is required when running directly from source.
Two build modes are supported and shared between Windows (app.spec) and macOS (app_mac.spec):
| Mode | Env var | What it does |
|---|---|---|
| Local + HF (default) | ONSIGHT_BUILD=local | Bundles model weights directly into the build. Larger, but works fully offline. |
| HF-only | ONSIGHT_BUILD=hf | No bundled weights. Models are downloaded from HuggingFace Hub on first launch. |
On Windows, you can also choose the output format:
| Format | Env var | Notes |
|---|---|---|
onedir (default for local) | ONSIGHT_FORMAT=onedir | Folder of files. Wrapped by Inno Setup into an installer. |
onefile (default for hf) | ONSIGHT_FORMAT=onefile | Single self-extracting .exe. |
Ensure PyInstaller is installed:
pip install pyinstaller
PowerShell:
$env:ONSIGHT_BUILD="local"
pyinstaller app.spec --noconfirm
Command Prompt:
set ONSIGHT_BUILD=local
pyinstaller app.spec --noconfirm
Output: dist\app_local\
$env:ONSIGHT_BUILD="hf"
pyinstaller app.spec --noconfirm
Output: dist\OnSight_HF.exe
For machines without an NVIDIA GPU, set BUILD_TYPE=CPU before building.
$env:BUILD_TYPE="CPU"
$env:ONSIGHT_BUILD="local"
pyinstaller app.spec --noconfirm
The full Mac build pipeline is automated in build_mac.sh:
chmod +x build_mac.sh
./build_mac.sh
This script performs:
build/ and dist/.app_mac.spec (defaults to ONSIGHT_BUILD=local)..dylib / .so with the ad-hoc identity..app bundle with onsight.entitlements.Outputs:
dist/OnSightPathology_App.app
For an HF-only Mac build, set ONSIGHT_BUILD=hf before invoking the script (or run PyInstaller directly with app_mac.spec).
macOS-specific runtime permission handling (Screen Recording, Accessibility, Input Monitoring) is centralized in mac_permissions.py and surfaced through MacPermissionDialog.py.
OnSight Pathology can be packaged using Inno Setup 6.5 or newer.
Download: https://jrsoftware.org/isdl.php
Two installer scripts are provided:
| Script | Purpose |
|---|---|
installer.iss | Wraps the onedir build (dist\app_local\ or dist\app_hf\). Supports a BuildMode define to switch between the two. Includes 2 GB disk-spanning for large local builds. |
installer_hf.iss | Wraps the single-file OnSight_HF.exe. Smaller, no disk spanning. |
Default (local with bundled weights):
iscc installer.iss
HF-only onedir mode:
iscc installer.iss /DBuildMode=hf
iscc installer_hf.iss
Compiled installers are written to output/.
The repository includes a:
training/
directory containing scripts used to train the models bundled with OnSight Pathology.
Each model has its own subdirectory within training/ that contains:
Detailed instructions for reproducing model training can be found in the respective README.md files within each model's training directory. These materials are provided for transparency and reproducibility.
To integrate additional models into OnSight Pathology:
metadata/ (see existing files such as cell_vit.json, mib_yolo_1024.json, lingshu.json for reference).settings.py to add a dropdown entry referencing the metadata file.utils.py to define how the model is initialized and loaded when selected.process_region_*.py file to define how the model performs inference on captured screen frames and how outputs are structured.Existing implementations (process_region_cellpose.py, process_region_cellvit.py, process_region_YOLO.py, etc.) may be used as references.
The project was built on top of excellent open-source repositories including MIDOG++, CellViT, Cellpose, and the Lingshu medical VLM. We thank the authors and developers for their contributions.
If you use OnSight Pathology in research, please cite the associated publication listed at:
153 commits
1 commits
Python
98.0%
Jupyter Notebook
1.0%
📚 Documentation & Downloads
For full documentation, publication details, and pre-built executables, please visit our official website: onsightpathology.github.io
This document describes how to run OnSight Pathology locally, how to build the application from source on Windows and macOS, and where to find model training pipelines.
Pre-built packages and additional resources are available through the following platforms:
OnSight Pathology is designed to be cross-platform.
linux branch).python -m venv onsight_env
onsight_env\Scripts\activate # Windows
source onsight_env/bin/activate # macOS / Linux
Confirm Python version:
python --version
Recommended: Python 3.11.9
Two dependency files are provided:
| File | Description |
|---|---|
requirements.txt | GPU version (CUDA 12.8 PyTorch wheels) |
requirements_cpu.txt | CPU-only version |
GPU:
pip install -r requirements.txt
CPU:
pip install -r requirements_cpu.txt
Device selection at runtime is handled by device_compat.py, which transparently picks CUDA → MPS → CPU in that order. No code changes are needed when switching machines.
python app.py
This launches the PyQt6 desktop application. No additional configuration is required when running directly from source.
Two build modes are supported and shared between Windows (app.spec) and macOS (app_mac.spec):
| Mode | Env var | What it does |
|---|---|---|
| Local + HF (default) | ONSIGHT_BUILD=local | Bundles model weights directly into the build. Larger, but works fully offline. |
| HF-only | ONSIGHT_BUILD=hf | No bundled weights. Models are downloaded from HuggingFace Hub on first launch. |
On Windows, you can also choose the output format:
| Format | Env var | Notes |
|---|---|---|
onedir (default for local) | ONSIGHT_FORMAT=onedir | Folder of files. Wrapped by Inno Setup into an installer. |
onefile (default for hf) | ONSIGHT_FORMAT=onefile | Single self-extracting .exe. |
Ensure PyInstaller is installed:
pip install pyinstaller
PowerShell:
$env:ONSIGHT_BUILD="local"
pyinstaller app.spec --noconfirm
Command Prompt:
set ONSIGHT_BUILD=local
pyinstaller app.spec --noconfirm
Output: dist\app_local\
$env:ONSIGHT_BUILD="hf"
pyinstaller app.spec --noconfirm
Output: dist\OnSight_HF.exe
For machines without an NVIDIA GPU, set BUILD_TYPE=CPU before building.
$env:BUILD_TYPE="CPU"
$env:ONSIGHT_BUILD="local"
pyinstaller app.spec --noconfirm
The full Mac build pipeline is automated in build_mac.sh:
chmod +x build_mac.sh
./build_mac.sh
This script performs:
build/ and dist/.app_mac.spec (defaults to ONSIGHT_BUILD=local)..dylib / .so with the ad-hoc identity..app bundle with onsight.entitlements.Outputs:
dist/OnSightPathology_App.app
For an HF-only Mac build, set ONSIGHT_BUILD=hf before invoking the script (or run PyInstaller directly with app_mac.spec).
macOS-specific runtime permission handling (Screen Recording, Accessibility, Input Monitoring) is centralized in mac_permissions.py and surfaced through MacPermissionDialog.py.
OnSight Pathology can be packaged using Inno Setup 6.5 or newer.
Download: https://jrsoftware.org/isdl.php
Two installer scripts are provided:
| Script | Purpose |
|---|---|
installer.iss | Wraps the onedir build (dist\app_local\ or dist\app_hf\). Supports a BuildMode define to switch between the two. Includes 2 GB disk-spanning for large local builds. |
installer_hf.iss | Wraps the single-file OnSight_HF.exe. Smaller, no disk spanning. |
Default (local with bundled weights):
iscc installer.iss
HF-only onedir mode:
iscc installer.iss /DBuildMode=hf
iscc installer_hf.iss
Compiled installers are written to output/.
The repository includes a:
training/
directory containing scripts used to train the models bundled with OnSight Pathology.
Each model has its own subdirectory within training/ that contains:
Detailed instructions for reproducing model training can be found in the respective README.md files within each model's training directory. These materials are provided for transparency and reproducibility.
To integrate additional models into OnSight Pathology:
metadata/ (see existing files such as cell_vit.json, mib_yolo_1024.json, lingshu.json for reference).settings.py to add a dropdown entry referencing the metadata file.utils.py to define how the model is initialized and loaded when selected.process_region_*.py file to define how the model performs inference on captured screen frames and how outputs are structured.Existing implementations (process_region_cellpose.py, process_region_cellvit.py, process_region_YOLO.py, etc.) may be used as references.
The project was built on top of excellent open-source repositories including MIDOG++, CellViT, Cellpose, and the Lingshu medical VLM. We thank the authors and developers for their contributions.
If you use OnSight Pathology in research, please cite the associated publication listed at:
153 commits
1 commits
Python
98.0%
Jupyter Notebook
1.0%