In order to improve the driving safety and reduce traffic congestion during holidays and work hours, a real-time vehicle detection and counting system is a very urgently needed system. In this paper, a lane-based vehicle counting system using deep-learning networks is proposed. Our method includes YOLO vehicle detection and lane-based vehicle counting. From the vehicle detection experimental results, YOLOv3-spp has the highest Precision, Recall, and F1 score, which achieve all 100% among three YOLOv3 methods and two YOLOv2 methods. From the vehicle counting experimental results, YOLOv3-608 has the highest Accuracy, Precision and F1 scores, which achieve 91.4%, 99.3%, and 95.3% among three YOLOv3 methods, two YOLOv2 methods, and one SSD method.