Skip to content

Commit

Permalink
Ensure mean subtraction happens on correct color ordering. Fixes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent Sommer committed Apr 24, 2018
1 parent 7c65137 commit e053637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def preprocess(images):
N = 0
mean = np.zeros((1, 3, 224, 224))
for X in tqdm(images_cropped):
X = np.transpose(X,(2,0,1))
mean[0][0] += X[:,:,0]
mean[0][1] += X[:,:,1]
mean[0][2] += X[:,:,2]
Expand Down Expand Up @@ -162,4 +163,4 @@ def main():
print 'Median error ', median_result[0], 'm and ', median_result[1], 'degrees.'

if __name__ == '__main__':
main()
main()
3 changes: 2 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def preprocess(images):
N = 0
mean = np.zeros((1, 3, 224, 224))
for X in tqdm(images_cropped):
X = np.transpose(X,(2,0,1))
mean[0][0] += X[:,:,0]
mean[0][1] += X[:,:,1]
mean[0][2] += X[:,:,2]
Expand Down Expand Up @@ -159,4 +160,4 @@ def main():


if __name__ == '__main__':
main()
main()

0 comments on commit e053637

Please sign in to comment.