Skip to content
Browse files

Add files via upload

  • Loading branch information
pythonlessons committed Aug 25, 2019
1 parent 90e209a commit f5510fb66ca64033bf18e535707709dd615789d7
Showing with 0 additions and 16 deletions.
  1. +0 −16 YOLOv3-custom-training/yolo3/
@@ -17,23 +17,7 @@ def compose(*funcs):
return reduce(lambda f, g: lambda *a, **kw: g(f(*a, **kw)), funcs)
raise ValueError('Composition of empty sequence not supported.')
def letterbox_image(image, size):
# resize image with unchanged aspect ratio using padding
iw, ih = image.size
#ih, iw, _ = image.shape
#print(iw, ih)
w, h = size
scale = min(w/iw, h/ih)
nw = int(iw*scale)
nh = int(ih*scale)

image = image.resize((nw,nh), Image.BICUBIC)
#image = cv2.resize(image, (nh, nw), interpolation=cv2.INTER_CUBIC)
new_image ='RGB', size, (128,128,128))
new_image.paste(image, ((w-nw)//2, (h-nh)//2))
return new_image
def image_preporcess(image, target_size, gt_boxes=None):

ih, iw = target_size

0 comments on commit f5510fb

Please sign in to comment.
You can’t perform that action at this time.