AP evaluation added, detect_max is added, demo_detection added and a few minor fixes