Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

VIP9000 NPU Kernel Driver

v6.4.15.9

Acuity NN Toolkit

6.21.1

ViviantelIDE

5.8.2

...

Before the conversion, it is necessary to first set up the environment for model conversion. Please refer to the following document to prepare the environment:NN model conversionModel Conversion

1.1. Project Preparation

  1. Create Model folder

...

Execute the command in the console or terminal, and wait for it to complete. It will import and translate an NN model to ACUITY NN formats.

Code Block
languagebash
./pegasus_import.sh yolov5s

...

Then we will see the following four files added under the folder ~/c3v/Models/yolov5s.

...

Inference

Inference the ACUITY NN model with the quantization data type.

...

  • Example of SDK Includes Path:

Code Block
INCLUDES+=-I$(VIVANTENN_SDK_DIR)/include/ \
-I$(VIVANTENN_SDK_DIR)/include/CL \
-I$(VIVANTENN_SDK_DIR)/include/VX \
-I$(VIVANTENN_SDK_DIR)/include/ovxlib \
-I$(VIVANTENN_SDK_DIR)/include/jpeg
  • Example of SDK Link Libraries:

...

This is an example Makefile that just needs to be placed in ~/c3v/Models/yolov5s/wksp/yolov5s_uint8_nbg_unify Folder. And set the relevant VIVIANTE_ SDK_ DIR and TOOLCHAIN can complete the compilation of the app:

Code Block
BIN=sampleApp

VIVANTENN_SDK_DIR=Path to VIVANTENN SDK directory
TOOLCHAIN=Path to toolchain directory

VIVANTENN_SDK_INC=$(VIVANTENN_SDK_DIR)/include
VIVANTENN_SDK_LIB=$(VIVANTENN_SDK_DIR)/lib

CROSS_COMPILE=$(TOOLCHAIN)/aarch64-none-linux-gnu-

CC=$(CROSS_COMPILE)gcc
CXX=$(CROSS_COMPILE)g++

CFLAGS=-Wall -O3

INCLUDE += -I$(VIVANTENN_SDK_INC) -I$(VIVANTENN_SDK_INC)/HAL -I$(VIVANTENN_SDK_INC)/ovxlib
LIBS += -L$(VIVANTENN_SDK_LIB) -L./ -L$(STD_LOG_INC)
LIBS += -lOpenVX -lOpenVXU -lOpenVX -lCLC -lVSC -lGAL -ljpeg -lovxlib -lm
LIBS += -lNNArchPerf -lArchModelSw
LIBS += -lstdc++ -ldl -lpthread -lgcc_s

CFLAGS += $(INCLUDE) -fPIC

SRCS=${wildcard *.c}
SRCS+=${wildcard *.cpp}

OBJS=$(addsuffix .o, $(basename $(SRCS)))

.SUFFIXES: .hpp .cpp .c 

.cpp.o:
	$(CXX) $(CFLAGS) -std=c++11 -c $<

.c.o:
	$(CC) $(CFLAGS) -c $<

all: $(BIN)

$(BIN): $(OBJS)
	$(CC) $(CFLAGS) $(LFLAGS) $(OBJS) -o $@ $(LIBS) 
	rm -rf *.o

clean:
	rm -rf *.o
	rm -rf $(BIN) $(LIB)
	rm -rf *~

...