Skip to content

Latest commit

 

History

History
62 lines (36 loc) · 2.18 KB

File metadata and controls

62 lines (36 loc) · 2.18 KB

Model generation

This directory contains scripts that generate NN Archives compatible with Luxonis devices for the custom models in this folder. The scripts utilize ModelConverter for the NN Archive generation and model conversion.

Models

Concatenate frames

concatenate example

Uses torch.cat operation to concatenate multiple frames.

Blur frames

blur example

Uses kornia.filters.GaussianBlur2d filter to create blurring model.

Edge detection

edge detection example

Uses kornia.filters.Laplacian filter to create edge detection model.

Frame difference

frame difference example

Uses torch.sub operation to compute the difference between two frames. Can be used to detect motion in consecutive frames.

Installation

The model generation scripts require Docker to be installed. You can install Docker by following the instructions here. You must also install the required packages specified in requirements.txt file:

pip install -r requirements.txt

Usage

You can generate each model by running the corresponding script. The scripts accept the following arguments:

positional arguments:
  {rvc2,rvc3,rvc4}  Platform to generate NN archive for.

The generated NN Archives will be available in the out/shared_with_container/models directory.

Examples

python3 kornia_blur.py rvc2

This will generate the NN Archive, that can be used on the RVC2 platform.

python3 pytorch_concat.py rvc4

This will generate the NN Archive, that can be used on the RVC4 platform.