Add detailed profiling for stages. detect_objects takes 97% of the time