Please install and setup AIMET before proceeding further.
This model was tested with the torch_gpu
variant of AIMET 1.24.0.
- Add AIMET Model Zoo and the HRNet Lib to your pythonpath
export PYTHONPATH=$PYTHONPATH:<aimet_model_zoo_path>
- Makes sure additional dependencies pyyaml, yacs are installed:
pip install pyyaml pip install 'yacs>=0.1.5'
- This evaluation was designed for Cityscapes dataset, which can be downloaded through registration on https://www.cityscapes-dataset.com/.
- After registration, go to https://www.cityscapes-dataset.com/downloads/ to download gtFine_trainvaltest.zip and leftImg8bit_trainvaltest.zip
- The original HRNet-W48 checkpoint can be downloaded from links provided at HRNet pytorch-v1.1.
- Optimized HRNet checkpoint can be downloaded from the Releases page.
- The Quantization Simulation (Quantsim) Configuration file can be downloaded from here: default_config_per_channel.json (Please see this page for more information on this file).
- Downloading optimized checkpoints and quantization configuration file are also handled through evaluation script.
To run evaluation with QuantSim in AIMET, use the following
python hrnet_sem_seg_quanteval.py \
--model-config <model configuation to be tested> \
--dataset-path <path to cityscapes directory containing gtFine and leftImg8bit_trainvaltest subdirectories> \
--use-cuda <whether to compute on GPU or CPU>
Available model configurations are:
- hrnet_sem_seg_w4a8
- hrnet_sem_seg_w8a8
- Weight quantization: 8 or 4 bits, per channel symmetric quantization
- Bias parameters are not quantized
- Activation quantization: 8 bits asymmetric quantization
- Model inputs are quantized
- TF_enhanced was used for weight quantization scheme
- TF_enhanced was used for activation quantization scheme
- Cross layer equalization and Adaround have been applied on optimized checkpoint
- 2K Images from Cityscapes test dataset are used as calibration dataset