Lane Detection example questions

Hello,
I came across an interesting example of a lane detection model in this repository:

I’ve searched extensively for more information or details but haven’t found anything useful. The example uses a .hef model compiled for the HAILO-8 device. Where can I find a model suitable for the HAILO-8L device?

I noticed that the example is based on this model:

The repository provides trained models in ONNX format. If an .hef file for the HAILO-8L is not available, how can I train and compile a .hef file myself?

Thanks in advance for your help!

Welcome to the Hailo Community!

If you have a model in ONNX format you can use the Hailo Dataflow Compiler to convert it into a HEF file for the Hailo-8L. I would recommend to install the Hailo AI Software Suite docker and walk through the tutorial first. Inside the docker call:

hailo tutorial

I have asked my colleagues to check whether they can give you some pointer with this specific model or provide a HEF file for the Hailo-8L.

Thank you! In the next few days, I will watch the tutorials and try to convert the model.

Hi @brunella.federico,

You can use something like the code below:

from hailo_sdk_client import ClientRunner
import numpy as np

######### Parsing #########

model_name = 'ufld_v2_tusimple'
onnx_path = './{}.onnx'.format(model_name) 

# The slices and reshapes at the end of the model are currently not supported, so they will
# be performed on the host.
end_node = 'Gemm_51' 

runner = ClientRunner(hw_arch='hailo8l')
hn, npz = runner.translate_onnx_model(onnx_path, model_name, end_node_names=[end_node])

hailo_model_har_name = '{}_hailo_model.har'.format(model_name)
runner.save_har(hailo_model_har_name)

######### Optimizing #########

alls_content = [
    'norm_layer1 = normalization([123.675,116.28,103.53],[58.395,57.12,57.365])',
]
alls_path = './{}.alls'.format(model_name) 
open(alls_path,'w').writelines(alls_content)

calib_dataset = np.load('calibset_64_320_800.npy')

runner.load_model_script(alls_path)
runner.optimize(calib_dataset)

quantized_har_path = './{}_quantized.har'.format(model_name)
runner.save_har(quantized_har_path)

######### Compiling #########

hef = runner.compile()

file_name = model_name + '.hef'
with open(file_name, 'wb') as f:
    f.write(hef)