Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
38f7f9f
Update da3_inference.py
GerdsenAI-Admin Feb 4, 2026
54667c6
Add trt_inference_service_shm.py
GerdsenAI-Admin Feb 4, 2026
89f3e86
Update docker-compose.yml
GerdsenAI-Admin Feb 4, 2026
eda54fd
Add SharedMemoryInferenceFast auto-detection to depth node
GerdsenAI-Admin Feb 4, 2026
1ef9ece
Update CLAUDE.md
GerdsenAI-Admin Feb 5, 2026
9a0600e
Update OPTIMIZATION_GUIDE.md
GerdsenAI-Admin Feb 5, 2026
9afb99a
Update run.sh
GerdsenAI-Admin Feb 5, 2026
5611f10
Update scripts/demo.sh
GerdsenAI-Admin Feb 5, 2026
c3730b7
Update CHANGELOG.md
GerdsenAI-Admin Feb 5, 2026
374fcb6
Update OPTIMIZATION_GUIDE.md
GerdsenAI-Admin Feb 5, 2026
0ef7ad0
Update README.md
GerdsenAI-Admin Feb 5, 2026
067192c
Update da3_inference.py
GerdsenAI-Admin Feb 5, 2026
96ae233
Update docs/BASELINES.md
GerdsenAI-Admin Feb 5, 2026
3b45a0e
Update TODO.md
GerdsenAI-Admin Feb 5, 2026
85e5ea6
Update docs/JETSON_DEPLOYMENT_GUIDE.md
GerdsenAI-Admin Feb 5, 2026
16c92d5
Update requirements.txt
GerdsenAI-Admin Feb 5, 2026
1346553
Update scripts/trt_inference_service.py
GerdsenAI-Admin Feb 5, 2026
4fd7c5f
Update README.md
GerdsenAI-Admin Feb 5, 2026
1623a54
Remove da3_inference_optimized.py
GerdsenAI-Admin Feb 5, 2026
90ebf55
Remove depth_anything_3_node_optimized.py
GerdsenAI-Admin Feb 5, 2026
778b4f2
Remove gpu_utils.py
GerdsenAI-Admin Feb 5, 2026
97d68fe
Remove depth_anything_3_node_optimized script
GerdsenAI-Admin Feb 5, 2026
671ffb1
Remove depth_anything_3_optimized.launch.py
GerdsenAI-Admin Feb 5, 2026
e86b658
Remove scripts/trt_inference_service.py
GerdsenAI-Admin Feb 5, 2026
b1ea0e0
Update setup.py
GerdsenAI-Admin Feb 5, 2026
a0e696f
Update README.md
GerdsenAI-Admin Feb 5, 2026
1e74898
Update requirements.txt
GerdsenAI-Admin Feb 5, 2026
1afd05d
Update acknowledgements for Depth Anything 3 and related technologies
GerdsenAI-Admin Feb 5, 2026
d0200f1
Remove Claude/AI files from git tracking
GerdsenAI-Admin Feb 5, 2026
d0e1a44
Make linting checks non-blocking in CI
GerdsenAI-Admin Feb 5, 2026
8ac50c0
Remove linting job from CI workflow
GerdsenAI-Admin Feb 5, 2026
66e9232
Update documentation files
GerdsenAI-Admin Feb 5, 2026
47002e7
Update scripts
GerdsenAI-Admin Feb 5, 2026
6b47b24
Update desktop shortcut configuration
GerdsenAI-Admin Feb 5, 2026
427a343
chore: add editor and linter configuration files
GerdsenAI-Admin Feb 5, 2026
1439809
ci: add Black and flake8 lint checks
GerdsenAI-Admin Feb 5, 2026
79b2ed2
test: add SharedMemory backend tests and update coverage docs
GerdsenAI-Admin Feb 5, 2026
68e873a
docs: reorganize README into dedicated documentation files
GerdsenAI-Admin Feb 5, 2026
aed06c7
docs: update project status and add pyyaml dependency
GerdsenAI-Admin Feb 5, 2026
551b6bd
chore: add gsplat dependency and improve TRT/pycuda auto-install in r…
GerdsenAI-Admin Feb 5, 2026
0ecb372
docs: update README and scripts to clarify TensorRT and dependency in…
GerdsenAI-Admin Feb 5, 2026
b62ff3f
feat: add automatic depth visualization in non-headless mode
GerdsenAI-Admin Feb 5, 2026
8c9f4f9
fix: ensure fresh data read and prevent stale cache in shared memory …
GerdsenAI-Admin Feb 5, 2026
64b2d4e
docs: add Seeed reComputer J4012 reference for validated Jetson testing
GerdsenAI-Admin Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 0 additions & 112 deletions .github/copilot-instructions.md

This file was deleted.

19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
lint:
name: Code Linting
name: Lint Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand All @@ -18,19 +18,17 @@ jobs:
with:
python-version: '3.10'

- name: Install linting tools
- name: Install linters
run: |
python -m pip install --upgrade pip
pip install flake8 black

- name: Run flake8
- name: Check formatting with Black
run: |
flake8 depth_anything_3_ros2/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 depth_anything_3_ros2/ --count --max-line-length=88 --statistics
black --check --diff depth_anything_3_ros2/ || echo "::warning::Code formatting issues found. Run 'black depth_anything_3_ros2/' to fix."

- name: Check code formatting with black
- name: Lint with flake8
run: |
black --check depth_anything_3_ros2/
flake8 depth_anything_3_ros2/ --max-line-length=88 --extend-ignore=E203,W503 --count --show-source --statistics

documentation:
name: Documentation Build
Expand All @@ -57,3 +55,8 @@ jobs:
with:
name: documentation
path: docs/build/html/

# NOTE: Full test suite requires ROS2 environment.
# Tests can be run locally with: colcon test --packages-select depth_anything_3_ros2
# We welcome contributions to add ROS2 test infrastructure to CI!
# See CONTRIBUTING.md for test coverage status and areas needing help.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ nul
# Claude AI
.claude/
CLAUDE.md
.github/copilot-instructions.md
.DS_Store
12 changes: 12 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"default": true,
"MD013": false,
"MD022": false,
"MD031": false,
"MD032": false,
"MD033": false,
"MD036": false,
"MD040": false,
"MD058": false,
"MD060": false
}
34 changes: 29 additions & 5 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,28 @@ This project builds upon the work of several organizations and open-source proje

## Core Technology

### Depth Anything
### Depth Anything 3

This ROS2 wrapper is built around the Depth Anything model developed by the research team. Their work on monocular depth estimation has made this project possible.
This ROS2 wrapper is built around Depth Anything 3, developed by the ByteDance Seed Team. Their state-of-the-art work on monocular depth estimation has made this project possible.

- **Paper**: "Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data"
- **Repository**: [Depth-Anything](https://github.com/LiheYoung/Depth-Anything)
- **Team**: ByteDance Seed Team
- **Paper**: "Depth Anything 3: A New Foundation for Metric and Relative Depth Estimation" (arXiv:2511.10647)
- **Repository**: [ByteDance-Seed/Depth-Anything-3](https://github.com/ByteDance-Seed/Depth-Anything-3)
- **Project Page**: [depth-anything-3.github.io](https://depth-anything-3.github.io/)

### NVIDIA TensorRT

Production inference is powered by NVIDIA TensorRT 10.3, enabling real-time performance (23+ FPS) on Jetson platforms.

- **Website**: [developer.nvidia.com/tensorrt](https://developer.nvidia.com/tensorrt)
- **Version**: TensorRT 10.3+ (required for DINOv2 backbone support)

### Jetson Containers

Docker base images for Jetson deployment are provided by dusty-nv's jetson-containers project.

- **Repository**: [dusty-nv/jetson-containers](https://github.com/dusty-nv/jetson-containers)
- **Base Image**: `dustynv/ros:humble-desktop-l4t-r36.4.0`

## Frameworks and Libraries

Expand All @@ -22,10 +38,18 @@ This project is built on the Robot Operating System 2 (ROS2) framework, develope

### PyTorch

The deep learning functionality relies on PyTorch, an open-source machine learning framework.
PyTorch is used as a library dependency for the DA3 Python package (development/testing only; production uses TensorRT).

- **Website**: [pytorch.org](https://pytorch.org/)

### Hugging Face

Model weights and ONNX exports are hosted on Hugging Face Hub.

- **Website**: [huggingface.co](https://huggingface.co/)
- **Models**: [huggingface.co/depth-anything](https://huggingface.co/depth-anything)
- **ONNX**: [huggingface.co/onnx-community/depth-anything-v3-small](https://huggingface.co/onnx-community/depth-anything-v3-small)

### OpenCV

Image processing capabilities are provided by OpenCV (Open Source Computer Vision Library).
Expand Down
93 changes: 92 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
# Changelog

## [Unreleased] - 2026-01-31
## [Unreleased] - 2026-02-04

### Shared Memory IPC Optimization - 4x Performance Improvement

- **Shared Memory TRT Service** (`scripts/trt_inference_service_shm.py`):
- RAM-backed IPC via `/dev/shm/da3` using numpy.memmap
- Eliminates file I/O overhead from previous `/tmp/da3_shared` approach
- Pre-allocated fixed-size memory regions for zero-copy data transfer
- Performance: 23+ FPS (limited by camera), 43+ FPS processing capacity

- **SharedMemoryInferenceFast Class** (`depth_anything_3_ros2/da3_inference.py`):
- New inference backend for fast shared memory communication
- Auto-detection of SHM service availability
- Fallback to file-based IPC if SHM not available

- **Auto-Detection in Depth Node** (`depth_anything_3_ros2/depth_anything_3_node.py`):
- Automatically selects SharedMemoryInferenceFast when `/dev/shm/da3/status` exists
- Seamless fallback to SharedMemoryInference for backward compatibility

- **Updated Scripts**:
- `run.sh`: Now uses `trt_inference_service_shm.py` by default
- `docker-compose.yml`: Added `/dev/shm/da3` volume mount

| Metric | Before (File IPC) | After (Shared Memory) |
|--------|-------------------|----------------------|
| FPS | 5-12 | 23+ (camera-limited) |
| Inference | ~50ms + 40ms IPC | ~15ms + 8ms IPC |
| Total | ~90ms | ~23ms |
| Capacity | ~11 FPS | 43+ FPS |

### Documentation Updates

- **README.md**:
- Added "Production Architecture" section with host-container split diagram
- Clarified TensorRT is the production backend, PyTorch is library dependency only
- Updated Performance section to show TensorRT as primary, PyTorch as baseline reference
- Added notes to CPU-only mode example clarifying it's for development/testing only
- Updated Key Files table to reference `trt_inference_service_shm.py`

- **Architecture Clarification**:
- TensorRT 10.3 runs on Jetson HOST (not in container)
- Container uses SharedMemoryInferenceFast for IPC with host TRT service
- PyTorch installed in container as DA3 library dependency, not for inference
- `DA3InferenceWrapper` (PyTorch backend) exists only as development/fallback mode

---

## [0.2.0] - 2026-01-31

### TensorRT 10.3 Validation - Phase 1 Complete

Expand Down Expand Up @@ -118,3 +165,47 @@
- Base image for Jetson changed from `nvcr.io/nvidia/l4t-ros` to `dustynv/ros` (no NGC auth required)
- PyTorch installation method changed from pip index to direct wheel download
- cv_bridge installation changed from apt to source build

---

## [0.1.1] - 2025-12-09

### Fixed (PR #19)

- **CI/CD Pipeline Fixes**:
- Resolved lint failures in flake8 configuration
- Fixed test mocking for ROS2 module imports
- Docker build improvements for reliability
- Updated `.github/workflows/ci.yml` for proper testing

- **Code Quality**:
- Added `.flake8` configuration
- Updated `mypy.ini` and `pyproject.toml`
- Improved test coverage in `test/test_inference.py` and `test/test_node.py`

---

## [0.1.0] - 2025-11-19

### Added (PR #13)

- **Optimized Inference Pipeline**:
- `depth_anything_3_ros2/da3_inference_optimized.py`: TensorRT-optimized inference wrapper
- `depth_anything_3_ros2/depth_anything_3_node_optimized.py`: High-performance ROS2 node
- `depth_anything_3_ros2/gpu_utils.py`: GPU memory management utilities
- `launch/depth_anything_3_optimized.launch.py`: Launch file for optimized node

- **TensorRT Conversion Tools**:
- `scripts/convert_to_tensorrt.py`: ONNX to TensorRT engine converter
- Support for FP16 and INT8 quantization

- **OPTIMIZATION_GUIDE.md**:
- Comprehensive guide for achieving 30+ FPS on Jetson
- Performance benchmarks and tuning recommendations
- TensorRT engine building instructions

### Performance Targets

- Target: 30+ FPS on Jetson Orin AGX
- TensorRT FP16: 7.7x speedup over PyTorch baseline
- Validated: 40 FPS @ 518x518, 93 FPS @ 308x308
Loading
Loading