Generate a Python script to detect the number of capitalized words in a sentence.
sentence = "This is a Sample Sentence"
def count_capitals(s):
    count = 0
    arr = s.split(' ')
    for word in arr:
        if word[0].isupper():
            count += 1
    return count