Skip to content

Commit f5510fb

Browse files
Add files via upload
1 parent 90e209a commit f5510fb

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

YOLOv3-custom-training/yolo3/utils.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,7 @@ def compose(*funcs):
1717
return reduce(lambda f, g: lambda *a, **kw: g(f(*a, **kw)), funcs)
1818
else:
1919
raise ValueError('Composition of empty sequence not supported.')
20-
'''
21-
def letterbox_image(image, size):
22-
# resize image with unchanged aspect ratio using padding
23-
iw, ih = image.size
24-
#ih, iw, _ = image.shape
25-
#print(iw, ih)
26-
w, h = size
27-
scale = min(w/iw, h/ih)
28-
nw = int(iw*scale)
29-
nh = int(ih*scale)
3020

31-
image = image.resize((nw,nh), Image.BICUBIC)
32-
#image = cv2.resize(image, (nh, nw), interpolation=cv2.INTER_CUBIC)
33-
new_image = Image.new('RGB', size, (128,128,128))
34-
new_image.paste(image, ((w-nw)//2, (h-nh)//2))
35-
return new_image
36-
'''
3721
def image_preporcess(image, target_size, gt_boxes=None):
3822

3923
ih, iw = target_size

0 commit comments

Comments
 (0)