-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
- Loading branch information
1 parent
872d865
commit 55c2f96
Showing
6 changed files
with
560 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.7.0-dgpu | ||
|
||
WORKDIR /colon_workspace | ||
|
||
# Install dependencies | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# TODO: after having the final model weights, upload to some place instead | ||
COPY rtdetrv2_timm_r50_nvimagenet_pretrained.onnx . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Polyp Detection | ||
|
||
## Build Docker | ||
|
||
```Bash | ||
docker build -t nvcr.io/nvidia/clara-holoscan/holoscan:v2.7.0-dgpu-polyp-det -f Dockerfile . | ||
``` | ||
|
||
## Run Application | ||
|
||
### Run Docker | ||
|
||
Please mount the directory that contains `holohub/` into `/colon`. For example, my folder is under `/raid/colon_reproduce`. | ||
|
||
```Bash | ||
docker run --rm -it --gpus=all --ipc=host -p 8888:8888 -v /raid/colon_reproduce:/colon nvcr.io/nvidia/clara-holoscan/holoscan:v2.7.0-dgpu-polyp-det | ||
``` | ||
|
||
### Generate TensorRT model | ||
|
||
```Bash | ||
trtexec --onnx=rtdetrv2_timm_r50_nvimagenet_pretrained.onnx --saveEngine=rt_detrv2_timm_r50_nvimagenet_pretrained_demo.trt \ | ||
--minShapes=images:1x3x640x640,orig_target_sizes:1x2 \ | ||
--optShapes=images:128x3x640x640,orig_target_sizes:128x2 \ | ||
--maxShapes=images:128x3x640x640,orig_target_sizes:128x2 \ | ||
--allowGPUFallback | ||
``` | ||
|
||
### Grab example video | ||
|
||
(todo) need to upload after license permisison | ||
|
||
### Convert Video into GXF Entities | ||
|
||
```Bash | ||
apt-get update && apt-get install -y ffmpeg | ||
git clone https://github.com/nvidia-holoscan/holoscan-sdk.git | ||
ffmpeg -i <prepared video>.mp4 -pix_fmt rgb24 -f rawvideo pipe:1 | python holoscan-sdk/scripts/convert_video_to_gxf_entities.py --width 1164 --height 1034 --channels 3 --framerate 30 --directory /colon/holohub/data/polyp_detection/ | ||
``` | ||
|
||
### Run application | ||
|
||
```Bash | ||
cd /colon/holohub/applications/polyp_detection | ||
python polyp_detection.py --data /colon/holohub/data/polyp_detection/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"application": { | ||
"name": "Polyp detection", | ||
"authors": [ | ||
{ | ||
"name": "Holoscan Team", | ||
"affiliation": "NVIDIA" | ||
} | ||
], | ||
"language": "Python", | ||
"version": "1.0", | ||
"changelog": { | ||
"1.0": "Initial Release" | ||
}, | ||
"holoscan_sdk": { | ||
"minimum_required_version": "0.5.0", | ||
"tested_versions": [ | ||
"0.5.0" | ||
] | ||
}, | ||
"platforms": [ | ||
"amd64", | ||
"arm64" | ||
], | ||
"tags": [ | ||
"Colonoscopy", | ||
"Detection" | ||
], | ||
"ranking": 1, | ||
"dependencies": { | ||
"libraries": [] | ||
}, | ||
"run": { | ||
"command": "python3 polyp_detection.py --data <holohub_data_dir>/polyp_detection", | ||
"workdir": "holohub_app_source" | ||
} | ||
} | ||
} |
Oops, something went wrong.