Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def get_validation_augmentation():
  2. """Add paddings to make image shape divisible by 32"""
  3. test_transform = [
  4. albu.Resize(320, 640)
  5. ]
  6. return albu.Compose(test_transform)
  7.  
  8. image_path = '002f507.jpg'
  9. img = cv2.imread(image_path)
  10. img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
  11. augmented = get_validation_augmentation()(image=img,mask=None)
  12.  
  13.  
  14. img = transforms.ToTensor()(augmented['image'])[None]
  15.  
  16. mask = model(img)
  17.  
  18. if mask.max() > 0.2:
  19. print('YES')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement