Finiteness of semialgebraic types of polynomial functions