Have you broken up with your partner and would like to keep the photo? Well, come on in and let's see how to boot them out of the shot.Alright, that's not strictly how it works. I mean, you can still remove them, but there'll be no easy and automated way to do it well. However, if you want to get rid of people ruining your landscape or city photography, Adobe Photoshop can take care of it all for you if you take the shots with it in mind (although you might have accidentally done it too!)
I first used this technique in Bruges, Belgium. I went to the Christmas market and I wanted to photograph a famous tree on the edge of the river. The issue was, the city was pretty busy (for Bruges) and there were lots of people wandering around, sitting on the bridge, taking selfies with the tree, and so on. Although I was taking short long exposures of around 5-10 seconds, the people weren't blurred enough to be invisible. As a result, my shot would have been marred with tourists and locals out enjoying the winter's eve. Instead, as my camera was already on a tripod, I shot a number of images, all the same settings and without moving the camera. Then, when I was back at my computer, I used Photoshop to load each of the images into a stack and then create a median version. Everything you want to be there will still be there, but anything moving around — like the people — would not make it into the median.
One word of warning: plants, trees, and anything else that moves will sometimes not fare well with this method!