bostondiditeam / MV3D

Multi-View 3D Object Detection Network for Autonomous Driving
480 stars 181 forks source link

Slight optimizations to pedestrian filter.py #13

Closed patrickmpoon closed 6 years ago

patrickmpoon commented 7 years ago

@preritj, per your request in tonight's Hangout, you requested that someone take a look to see if filter.py could be optimized. I took a stab at it, and made some small changes, like converting a for loop to a list comprehension, and removing the .keys() in a conditional, as I believe there is a performance penalty with if key in *.keys() (O(n) vs O(1)).

Please keep in mind that I didn't use a profiler to verify any performance improvement. If you do consider merging this PR, please pull down the branch first and verify there are no adverse changes to the expected output.

Also, my feelings will not be hurt if you decide to either decline or ignore this PR (ok, maybe a little but I'm a big boy and life will go on). ;)