Command Line Usage¶
Once the eIQ Vela package is installed, you can use it like any other command line tool. The following section demonstrates the basic workflow for converting TF Lite models for use on i.MX 93.
First, let’s prepare the model we want to convert.
[ ]:
from pathlib import Path
import requests
# Change this if you have your own model.
model_path = Path("my_path_to_tflite_model.tflite")
[ ]:
# Alternatively download example model.
example_model_url = "https://eiq.nxp.com/training-materials/_misc/models/mobilenet_v3-small_224_1.0_uint8.tflite"
with open(model_path, "wb") as f:
response = requests.get(
url=example_model_url
)
f.write(response.content)
if response.status_code != 200:
print(f"Failed to download model: {response.content}")
else:
print(f"Model downloaded and saved to {model_path} file.")
The simplest way to run a Vela conversion is to provide the model you want to convert along with an output directory. After the conversion completes, you’ll find the generated model in the specified directory.
[ ]:
# Change this to your path
output_dir = Path("vela_output_dir")
!vela --output-dir $output_dir $model_path
print(f"Converted model can be found in {output_dir} folder.")
There are many additional options available for conversion and model performance analysis. To see the full list, check the command’s help flag:
[ ]:
!vela -h