Ai Based Automatic Real-Time Wagon Counting