pkmital / CADL

ARCHIVED: Contains historical course materials/Homework materials for the FREE MOOC course on "Creative Applications of Deep Learning w/ Tensorflow" #CADL
https://www.kadenze.com/courses/creative-applications-of-deep-learning-with-tensorflow/info
Apache License 2.0
1.48k stars 732 forks source link

The function `imcrop_tosquare` in session-0 has a minor problem #102

Open vibertthio opened 6 years ago

vibertthio commented 6 years ago
...
            crop = img[max(0, extra // 2 + 1):min(-1, -(extra // 2)), :]
...

The result will not be a square when extra is 1. For example, the crop is img[1:-1, :] when extra is 1.

It should be:

...
            crop = img[extra // 2:-(extra // 2) - 1, :]
...