I have a pretty lean inference script included with a DPN conversion I recently posted at https://github.com/rwightman/pytorch-dpn-pretrained 72
It utilizes a Dataset that’s fine with images in arbitrary folder hierarchies, from flat to many levels. The script dumps top-5 prediction (by class id) to a csv file.