Upload Template Matching code