this is a guide on how to create custom hef using the DFC or hailo model zoo
first of all lets make sure we have the hailo model zoo installed into the virtual env . if not please make sure to follow the Read Me guide in
Now lets make sure the DFC is also installed in the same virtual environment , for more info on how to install DFC you can find under data flow compiler in https://hailo.ai/developer-zone/documentation/
Now let’s start making the model :
Using DFC :
hailo parser onnx/tf <model_path> --start-node-names <start_node_name> --end-nodes-names <end_nodes_name> --hw-arch {hailo8,hailo8r,hailo8l,hailo15h,hailo15m}
Now we have a HAR file that we can use for the next step :
hailo optimize {har_path} [–hw-arch {hailo8,hailo8r,hailo8l,hailo15h,hailo15m}] (–calib-set-path CALIBRATION_SET_PATH ( tf record ) OR --use-random-calib-set) --model-script MODEL_SCRIPT ( .alls file that can be found in hailo model zoo)
Now we have a model_name_optimized.har :
hailo compiler {har_path_optimized} [–hw-arch {hailo8,hailo8r,hailo8l,hailo15h,hailo15m}] [–model-script MODEL_SCRIPT (.alls file)] --performance
the{ --performance} will give a better performance for the model but will signifcantly increase the compiling time for the model
Using Hailo Model Zoo :
hailomz parse [–yaml YAML_PATH] [–ckpt CKPT_PATH (path to onnx or ckpt to use for parsing)] [–hw-arch] --start-node-names --end-node-names
Now we have the Har File , we use to :
hailomz optimize {model_name } [–har HAR_PATH ( our external har file)] [–yaml YAML_PATH] [–ckpt CKPT_PATH] [–hw-arch] [–calib-path CALIB_PATH] [–model-script MODEL_SCRIPT_PATH] [–performance]
Now we have a quantized/optimized Har that we gonna use next :
hailomz compile [-h] [–yaml YAML_PATH] [–ckpt CKPT_PATH] [–hw-arch] [–start-node-names START_NODE_NAMES [START_NODE_NAMES …]] [–end-node-names END_NODE_NAMES [END_NODE_NAMES …]]
[–har HAR_PATH] [–calib-path CALIB_PATH] [–model-script MODEL_SCRIPT_PATH] [–performance] [–resize RESIZE [RESIZE …] (input resize) ]
[model_name]
For more info on any of the runs you can just run [-h] option and will have the full documentation on what each option represents.
Enjoy Creating Models and Share Your Experiences!
Please don’t hesitate to reach out and share your creations, questions, or concerns. We value your input and feedback, as it helps us continuously improve our offerings and support to better meet the needs of our users.
Looking forward to seeing the amazing models you develop and learning more about your experiences. Let us know how we can best assist you on your model creation journey!