nwojke / deep_sort

Simple Online Realtime Tracking with a Deep Association Metric
GNU General Public License v3.0
5.27k stars 1.47k forks source link

Reduce number of loops in tracker #206

Open ZhiyuanChen opened 4 years ago

ZhiyuanChen commented 4 years ago

Slightly increase spped by reducing two for loop to one

alexnguyen2201 commented 4 years ago

@zyc-ai a comprehension list is faster than a loop

ZhiyuanChen commented 4 years ago

a comprehension list is faster than a loop

It seems not in the case of Python https://stackoverflow.com/a/43677631/8791650.

kanasite commented 3 years ago

a comprehension list is faster than a loop

It seems not in the case of Python https://stackoverflow.com/a/43677631/8791650.

I beg to diff, consider doing this instead

def square_sum4(numbers): return(sum([i**2 for i in numbers]))