A lightweight, standalone desktop application for real-time surgical instrument and anatomical structure detection using computer vision and AI. Designed to run efficiently on systems with Intel i3 and 8GB RAM.
- Real-time Video Processing: Live camera feed from laparoscopic/endoscopic cameras
- AI Object Detection: Lightweight detection of surgical instruments and anatomical structures
- 3D Mapping: Basic SLAM implementation for surgical environment reconstruction
- User-friendly GUI: PyQt5-based interface with intuitive controls
- Offline Operation: No internet connection required
- Cross-platform: Runs on both Windows and Linux
- Low Resource Usage: Optimized for Intel i3 + 8GB RAM systems
- OS: Windows 10+ or Ubuntu 20.04+
- CPU: Intel i3 or equivalent
- RAM: 8GB
- Storage: 2GB free space
- Camera: USB or IP laparoscopic camera
- Display: 1280x720 minimum resolution
- CPU: Intel i5 or better
- RAM: 16GB
- GPU: Dedicated GPU (optional, for faster processing)
- Download the latest release from the Releases page
- Windows: Run
SurgicalNavigation.exe
- Linux: Run
./SurgicalNavigation.AppImage
or use the installer
# Install Python 3.8+
python3 --version
# Install pip
python3 -m pip install --upgrade pip
# Clone the repository
git clone https://github.com/your-username/surgical-navigation.git
cd surgical-navigation
# Install dependencies
pip install -r requirements.txt
# Run the application
python main.py
# Run the Windows build script
python build_scripts/build_windows.py
# The executable will be created in dist/SurgicalNavigation.exe
# Run the Linux build script
chmod +x build_scripts/build_linux.sh
./build_scripts/build_linux.sh
# Multiple outputs will be created:
# - dist/SurgicalNavigation (executable)
# - dist/SurgicalNavigation.AppImage (if appimagetool is available)
# - dist/install.sh (system installer)
- Connect your laparoscopic/USB camera
- Launch the application
- Go to Camera tab in the control panel
- Select your camera device and click Connect Camera
- Click Start Video to begin live feed
- Ensure camera is connected and video is running
- Go to AI Detection tab
- Adjust confidence threshold if needed (default: 0.50)
- Click Start Detection to enable real-time object detection
- Live Feed: Main window shows camera feed with detection overlays
- Detection Info: Right panel shows detection statistics
- 3D Mapping: Basic SLAM reconstruction (when enabled)
- Display Settings: Toggle detection overlays and FPS display
- System Info: View current system resources
- Performance: Monitor detection speed and accuracy
The application uses YAML configuration files located in the config/
directory:
# config/default_config.yaml
camera:
default_device: 0
resolution: [1280, 720]
fps: 30
ai:
confidence_threshold: 0.5
model_path: assets/models/surgical_detector.onnx
gui:
window_size: [1200, 800]
show_fps: true
The system supports ONNX models for object detection. Default classes include:
Surgical Instruments:
- Scalpel, Forceps, Scissors, Needle Holder
- Retractor, Suction Tube, Cautery, Clip Applier
- Trocar, Grasper
Anatomical Structures:
- Liver, Kidney, Heart, Lung, Stomach
- Intestine, Blood Vessel, Nerve, Tumor, Cyst
To use your own trained models:
- Convert your model to ONNX format
- Place it in
assets/models/
- Update the
model_path
in configuration - Modify class names in
src/ai/detector.py
surgical_app/
โโโ main.py # Application entry point
โโโ src/
โ โโโ gui/ # GUI components
โ โโโ camera/ # Camera management
โ โโโ ai/ # AI detection
โ โโโ slam/ # 3D mapping
โ โโโ utils/ # Utilities
โโโ config/ # Configuration files
โโโ assets/ # Models and resources
โโโ build_scripts/ # Build automation
โโโ tests/ # Unit tests
# Install test dependencies
pip install pytest pytest-qt
# Run tests
pytest tests/
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
- Reduce camera resolution to 640x480
- Lower FPS to 15-20
- Disable 3D mapping if not needed
- Use CPU-only inference
- Close other applications
camera:
resolution: [640, 480]
fps: 15
ai:
use_gpu: false
max_detections: 20
slam:
enabled: false # Disable for better performance
Camera not detected:
- Check USB connection
- Try different camera device IDs (0, 1, 2...)
- Ensure camera is not used by other applications
Low performance:
- Reduce video resolution
- Lower detection confidence threshold
- Disable SLAM if not needed
- Check system resources
Detection not working:
- Verify model file exists
- Check confidence threshold settings
- Ensure adequate lighting
- Try different camera angles
Application logs are stored in:
- Windows:
logs/surgical_nav_YYYYMMDD.log
- Linux:
~/.surgical-navigation/logs/
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV for computer vision capabilities
- PyQt5 for the GUI framework
- ONNX Runtime for AI inference
- ORB-SLAM2 for SLAM inspiration
For support, please:
- Check the Issues page
- Review the troubleshooting section
- Create a new issue with detailed information
- GPU acceleration support
- Advanced SLAM with loop closure
- Integration with surgical robots
- Voice command interface
- Cloud-based model updates
- Multi-camera support
- AR/VR headset integration
Developed by Sandip Hembram | Version 1.0 | June 2025