From Har fir to Quantized

Hi @dudibs,

If you’re using the CLI and want to include the quantization_param line, unfortunately, the CLI doesn’t provide an option to directly inject that command during optimization. To address this, you’ll need to switch to using a Python script to run the optimization process, as that will give you the flexibility to include the quantization_param function.

Here’s how you can do it:

Modify the Process in Python: You can create a simple Python script to load your HAR model, apply the quantization_param adjustment, and then proceed with optimization. Here’s an example:

from hailo_sdk_client import Client

# Load the model from the HAR file
har_path = '<HAR_PATH>'
client = Client()
net = client.load_model(har_path)

# Apply the quantization parameters
net.quantization_param(['matmul4'], force_range_in=[[0.0036, 0.064], [-3.692, 5.09]])

# Proceed with optimization
optimized_net = net.optimize(use_random_calib_set=True)

# Save the optimized model
optimized_net.save('<OUTPUT_PATH>')

This method allows you to insert the quantization_param modification, which isn’t possible directly in the CLI.

Let me know if you need further clarification on this approach!

Best Regards,
Omri