How to detect the empty parking spots? I have some images of the empty parking as shown below. 



I 'd like to use deep learning to extract the parking spots. But in the beginning,am confused whether there are several ways to do the following; 


Treat each parking spot as an object and use object detection to find
the parking space.
Treat the parking spot as a few key points, instead of finding the
spot, try to find the coordinates of key points on the parking line.


Any ideas on how would I work on these two methods
Object detection is a regression of the bounding box (rectangle) around the object. In this way, the two ways you suggest are equivalent.

What I suggest you to look at is lane detection for self-driving cars - a well studied problem. It seems that this is a very relevant task (if not the same), so its solution should work for you as well.