cfchen-duke / ProtoPNet

This code package implements the prototypical part network (ProtoPNet) from the paper "This Looks Like That: Deep Learning for Interpretable Image Recognition" (to appear at NeurIPS 2019), by Chaofan Chen* (Duke University), Oscar Li* (Duke University), Chaofan Tao (Duke University), Alina Jade Barnett (Duke University), Jonathan Su (MIT Lincoln Laboratory), and Cynthia Rudin (Duke University) (* denotes equal contribution).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Augmentor error on rotate

smdabdoub opened this issue · comments

The rotate step of the pipeline throws an error on the image "Ring_Billed_Gull_0100_52779.jpg"

  File "lib/python3.9/site-packages/Augmentor/Operations.py", line 843, in do
     image = image.crop((int(round(E)), int(round(A)), int(round(X - E)), int(round(Y - A))))
  File "lib/python3.9/site-packages/PIL/Image.py", line 1206, in crop
     raise ValueError("Coordinate 'lower' is less than 'upper'")
ValueError: Coordinate 'lower' is less than 'upper'

Replacing the call to rotate on line 23 with rotate_without_crop fixes the problem:

p.rotate_without_crop(probability=1, max_left_rotation=15, max_right_rotation=15)

How did you fix this error?
@smdabdoub

In image_aug.py, line 23, change:

p.rotate(probability=1, max_left_rotation=15, max_right_rotation=15)

to

p.rotate_without_crop(probability=1, max_left_rotation=15, max_right_rotation=15)