Skip to content

Latest commit

 

History

History
 
 

bring_your_own_model

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Bring Your Own Model

This example shows how to run inference with Holoscan and provides a mechanism, to replace the existing identity model with another model.

Visit the SDK User Guide for step-by-step documentation of this example.

Data

The following datasets are used by this example:

Run instructions

The following instructions shows how to run the byom example. If you run this example as is, it will look similar to the video_replayer example. To get the most from this example, the instructions in this section will walk you through how to modify the python example code to run the application with an ultrasound segmentation model.

  • using python wheel:
    # [Prerequisite] Download NGC dataset above to `DATA_DIR`
    export HOLOSCAN_INPUT_PATH=<DATA_DIR>
    # [Prerequisite] Download `model` and `python` folders below to `APP_DIR`
    # [Optional] Start the virtualenv where holoscan is installed
    python3 <APP_DIR>/python/byom.py
  • using deb package install:
    # [Prerequisite] Download NGC dataset above to `DATA_DIR`
    export HOLOSCAN_INPUT_PATH=<DATA_DIR>
    export PYTHONPATH=/opt/nvidia/holoscan/python/lib
    # Need to enable write permission in the model directory to write the engine file (use with caution)
    sudo chmod a+w /opt/nvidia/holoscan/examples/bring_your_own_model/model
    python3 /opt/nvidia/holoscan/examples/bring_your_own_model/python/byom.py
  • from NGC container:
    python3 /opt/nvidia/holoscan/examples/bring_your_own_model/python/byom.py
  • source (dev container):
    ./run launch # optional: append `install` for install tree
    python3 ./examples/bring_your_own_model/python/byom.py
  • source (local env):
    export PYTHONPATH=${BUILD_OR_INSTALL_DIR}/python/lib
    export HOLOSCAN_INPUT_PATH=${SRC_DIR}/data
    python3 ${BUILD_OR_INSTALL_DIR}/examples/bring_your_own_model/python/byom.py