HW-SW Optimization of DNNs for Privacy-preserving People Counting on Low-resolution Infrared Arrays