-2

What is an efficient way of getting a counter in this for loop statement

for (x, y, window) in sliding_window(img, stepSize=32, windowSize=(64, 64)):
                print window
Priya Narayanan
  • 943
  • 1
  • 9
  • 16

1 Answers1

0

Use enumerate():

for i, (x, y, window) in enumerate(sliding_window(img, stepSize=32, windowSize=(64, 64))):
    print i, window
Robᵩ
  • 154,489
  • 17
  • 222
  • 296