diff --git a/README.md b/README.md index 4eb8e1049..3a7d1944a 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,12 @@ $ cd .. $ python convert_weight.py $ python freeze_graph.py ``` -4. Then you will get some `.pb` files in the root path., and run the demo script +4. If you want to get darknet-yolov3 [weights](https://pjreddie.com/darknet/yolo/) work in this project,run the following scripts to convert it. +```bashrc +$ python from_darknet_weights_to_ckpt.py # If you just want pb files, skip to the next line. +$ python from_darknet_weights_to_pb.py +``` +5. Then you will get some `.pb` files in the root path., and run the demo script ```bashrc $ python image_demo.py $ python video_demo.py # if use camera, set video_path = 0 diff --git a/core/dataset.py b/core/dataset.py index 485e21e79..1df3fbd99 100644 --- a/core/dataset.py +++ b/core/dataset.py @@ -119,8 +119,8 @@ def random_crop(self, image, bboxes): crop_xmin = max(0, int(max_bbox[0] - random.uniform(0, max_l_trans))) crop_ymin = max(0, int(max_bbox[1] - random.uniform(0, max_u_trans))) - crop_xmax = max(w, int(max_bbox[2] + random.uniform(0, max_r_trans))) - crop_ymax = max(h, int(max_bbox[3] + random.uniform(0, max_d_trans))) + crop_xmax = min(w, int(max_bbox[2] + random.uniform(0, max_r_trans))) + crop_ymax = min(h, int(max_bbox[3] + random.uniform(0, max_d_trans))) image = image[crop_ymin : crop_ymax, crop_xmin : crop_xmax]