This script performs K-means Clustering on the Berkeley Deep Drive dataset to find the appropriate anchor boxes for YOLOv3. You can download the dataset and json file that contains labels from here https://bdd-data.berkeley.edu/
Originally Yolov3 has 9 anchor boxes and default image size is 608x608.You can adapt it to your own dataset. For any issues please let me know.