ajaichemmanam / simple_bodypix_python

A simple and minimal bodypix inference in python
76 stars 19 forks source link

Replaced loop through mask tensor for partHeatMap with element-wise methods #2

Closed OmkarAthavale closed 4 years ago

OmkarAthavale commented 4 years ago

Hi @ajaichemmanam , this is a great script you have made, thank you!

I just noticed it was taking some time to set portions of heatmap where person is not present to -1 due to the loop through mask tensor elements. I repaced this loop with element-wise OR and NOT on the mask tensor to get a numpy array that could index and replace the appropriate values in heatmap with -1.

ajaichemmanam commented 4 years ago

Thank you for the contribution.