Commit 5203ac10 authored by TaranSinghania's avatar TaranSinghania
Browse files

Fixed typos

parent 7deebd49
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ class TestTransformers(unittest.TestCase):
    check_blur = scipy.ndimage.gaussian_filter(self.d, 1.5)
    assert np.allclose(check_blur, blurred)

  def check_center_crop(self):
  def test_center_crop(self):
    # Check center crop
    dt = DataTransforms(self.d)
    x_crop = 50
@@ -600,16 +600,17 @@ class TestTransformers(unittest.TestCase):
    check_crop = self.d[y_start:y_start + y_crop, x_start:x_start + x_crop]
    assert np.allclose(check_crop, crop)

  def check_crop(self):
  def test_crop(self):
    #Check crop
    from PIL import Image
    dt = DataTransforms(self.d)
    crop = dt.crop(0, 10, 0, 10)
    image = Image.fromarray(self.d)
    check_crop = np.array(image.crop((0, 10, 0, 10)))
    y = self.d.shape[0]
    x = self.d.shape[1]
    check_crop = self.d[10:y - 10, 0:x - 0]
    assert np.allclose(crop, check_crop)

  def chef_convert2gray(self):
  def test_convert2gray(self):
    # Check convert2gray
    dt = DataTransforms(self.d)
    gray = dt.convert2gray()
+3 −4
Original line number Diff line number Diff line
@@ -1364,10 +1364,9 @@ class DataTransforms(Transformer):
    ----------
    The cropped input array
    """
    from PIL import Image
    image = Image.fromarray(self.Imaage)
    image = image.crop((left, top, right, bottom))
    return np.array(image)
    y = self.Image.shape[0]
    x = self.Image.shape[1]
    return self.Image[top:y - bottom, left:x - right]

  def convert2gray(self):
    """ Converts the image to grayscale. The coefficients correspond to the Y' component of the Y'UV color system.