Spiking Neural Networks for Frame-based and Event-based Single Object Localization