I think when you are passing full directory as data for training and then you are testing for a part of same data. The accuracy will be greater as you are considering the same data for testing again. The model already trained itself for the data that you are using for testing. Please do not passing the test dataset for accurate results of your code.
Please refer to Yolo example once again for path that you need to include while training and testing.
Hope this helps!