Browse Source

check_img_size() update

5.0
Glenn Jocher 4 years ago
parent
commit
a557b7d924
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      utils/utils.py

+ 4
- 3
utils/utils.py View File



def check_img_size(img_size, s=32): def check_img_size(img_size, s=32):
# Verify img_size is a multiple of stride s # Verify img_size is a multiple of stride s
if img_size % s != 0:
print('WARNING: --img-size %g must be multiple of max stride %g' % (img_size, s))
return make_divisible(img_size, s) # nearest gs-multiple
new_size = make_divisible(img_size, s) # ceil gs-multiple
if new_size != img_size:
print('WARNING: --img-size %g must be multiple of max stride %g, updating to %g' % (img_size, s, new_size))
return new_size




def check_anchors(dataset, model, thr=4.0, imgsz=640): def check_anchors(dataset, model, thr=4.0, imgsz=640):

Loading…
Cancel
Save