Exploiting similarity hierarchies for multi-script scene text understanding