ENH: First working template detector in detect.py