Skip to content

Commit

Permalink
crop -> offset to fit BVLC#3570
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Feb 28, 2016
1 parent 2ad9995 commit 81a6a6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/caffe/coord_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def coord_map_from_to(top_from, top_to):
def crop(top_from, top_to):
ax, a, b = coord_map_from_to(top_from, top_to)
assert (a == 1).all(), 'scale mismatch on crop (a = {})'.format(a)
assert (b <= 0).all(), 'cannot crop negative width (b = {})'.format(b)
assert (b <= 0).all(), 'cannot crop negative offset (b = {})'.format(b)
assert (np.round(b) == b).all(),
'cannot crop noninteger width (b = {})'.format(b)
'cannot crop noninteger offset (b = {})'.format(b)
return L.Crop(top_from, top_to,
crop_param=dict(axis=ax,
crop=list(-np.round(b).astype(int))))
offset=list(-np.round(b).astype(int))))

0 comments on commit 81a6a6a

Please sign in to comment.