From 993d0a0d1b2829fdfbe57c8e4f38d30c54fb52f4 Mon Sep 17 00:00:00 2001 From: everittb Date: Sun, 17 Feb 2019 12:03:41 -0800 Subject: [PATCH 01/49] Update function documentation, minor change to README --- .../__pycache__/rotate.cpython-36.pyc | Bin 0 -> 1671 bytes AutoTransformPy/rotate.py | 7 +++++++ README.md | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 AutoTransformPy/__pycache__/rotate.cpython-36.pyc diff --git a/AutoTransformPy/__pycache__/rotate.cpython-36.pyc b/AutoTransformPy/__pycache__/rotate.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..747ae0fd56e767b53909a2ebd91a7ca0a5f41669 GIT binary patch literal 1671 zcma)6L2u+V6t>|Y8CQ%O!`Doov%KV)wB9PD%G?E0 zb$Ql14Oc>!#hP_O2*z3GVnSv{N>*3QX;$(#XSgHRDvlXEFHtz=_zF_H3&|=DnPDqb z#@t{CmPsWI2yFYTJB2y`k120YHuZB^Od8>=ZT*tk@DFA>Bd)jb)*itE=2frVU%_ zS~+PBx6Y(f;2Txd&YocA!|p*FA)a|TPMCEjR~foJ0AKJt_ZYlbo+3CpN}${=nFJ$l zkLiTv03qw888UTh`831fb(;E9@VT%RfF~x~J;D3a4U+Mq&{uo`D7V_2gA80@GkL^! z%O&g?O1EXXknT!K#g4EAj-P(o3)c7M9mNhYs!!NA@KxcL`CY#TE$iR5Z6Qt~e?}>Rw;X2qH|G!#CzH{IQg5EbtegUDI zC-;^d3jJ5K7kEFxpRtki{Wi{RuB_u~Dcca*s-2y#EBV|QZQ2lMwec%n)V(866zDZ|;QZ}7wlXd5nzIXTd z(wJ}Wia&{Y2xb5IC`q1tRXcqOU@UY~`Q7?;7nM|N<1gPa49j35AI5YV^dp>t{Q;eZ z2XsnD;C&R}?)jvR?Fum`xkhT~!@=Q(BDmGO4>{X0aDqyEU?ZZP>APxqnrzhiOtvj6}9 literal 0 HcmV?d00001 diff --git a/AutoTransformPy/rotate.py b/AutoTransformPy/rotate.py index c399d15..0618eb4 100644 --- a/AutoTransformPy/rotate.py +++ b/AutoTransformPy/rotate.py @@ -1,3 +1,10 @@ +# Copyright 2019 Brenden Everitt +# Licensed under the MIT License +# Use of this file must be in compliance with the License, LICENSE.md +# +# February 2019 +# This script is for AutoTransformPy function Rotate. + from skimage.io import imread from skimage.transform import rotate as rot import numpy as np diff --git a/README.md b/README.md index 788830a..15b9d93 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To install AuttoTransformPy: 1. Clone AutoTransformPy to your local machine: `git clone https://github.com/UBC-MDS/AutoTransformPy.git` 2. Navigate to the repository in your terminal. 3. Install input: `python setup.py install` -4. You can now use AutoTransformPy. Seee usage instructions below: +4. You can now use AutoTransformPy. See usage instructions below: ### Usage @@ -52,13 +52,13 @@ To install AuttoTransformPy: **Arguments:** -- `image_path`: file path of the imput image (string) +- `image_path`: file path of the input image (string) - `num_images`: number of randomly rotated images to be returned (integer) - `max_rotation`: maximum allowable degrees of rotation of the images (integer) between 1 and 360 **Output:** -- An np.array of pixel values of the rotated images. Array contains `num_images` + 1 images (original plus all rotated images) +- An np.array of pixel values of the rotated images. Array contains `num_images`. **Example:** From 655e6b735a5c478a452b45476f8b917d11036f52 Mon Sep 17 00:00:00 2001 From: Alycia Butterworth <42809905+alyciakb@users.noreply.github.com> Date: Sun, 17 Feb 2019 12:35:23 -0800 Subject: [PATCH 02/49] Update installation directions --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 15b9d93..9d10c4d 100644 --- a/README.md +++ b/README.md @@ -35,12 +35,10 @@ Scikit-image is a image processing package that contains functions for performin ### Installation -To install AuttoTransformPy: +To install AutoTransformPy: -1. Clone AutoTransformPy to your local machine: `git clone https://github.com/UBC-MDS/AutoTransformPy.git` -2. Navigate to the repository in your terminal. -3. Install input: `python setup.py install` -4. You can now use AutoTransformPy. See usage instructions below: +1. In your console, type: `pip install git+https://github.com/UBC-MDS/AutoTransformPy.git` +2. You can now use AutoTransformPy. See usage instructions below: ### Usage From 69128c3304b3a5022a2c9176376e8aed09a9c3a3 Mon Sep 17 00:00:00 2001 From: Alycia Butterworth <42809905+alyciakb@users.noreply.github.com> Date: Sun, 17 Feb 2019 12:36:19 -0800 Subject: [PATCH 03/49] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d10c4d..eed82cb 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ To install AutoTransformPy: **Arguments:** -- `image_path`: file path of the imput image (string) +- `image_path`: file path of the input image (string) - `direction`: direction of mirroring (string, optional) 'horizontal', 'vertical', or 'all'. If not specified, defaults to 'all' **Output:** From fad71569dbfda05407683421387c96a22290b80c Mon Sep 17 00:00:00 2001 From: everittb Date: Sun, 17 Feb 2019 14:52:11 -0800 Subject: [PATCH 04/49] Update rotate function to ensure consistency with other functions --- AutoTransformPy/rotate.py | 2 +- tests/test_rotate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AutoTransformPy/rotate.py b/AutoTransformPy/rotate.py index 0618eb4..736a63e 100644 --- a/AutoTransformPy/rotate.py +++ b/AutoTransformPy/rotate.py @@ -51,7 +51,7 @@ def rotate (image_path, num_images, max_rotation): # Perform image rotation rotations = np.random.randint(-max_rotation, max_rotation, num_images) org_image = imread(image_path) - rotated_images = [] + rotated_images = [org_image] for a_rotation in rotations: rotated_images.append(rot(org_image, a_rotation, resize=False)) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 49db035..a988305 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -17,5 +17,5 @@ def test_inputs(): def test_return_imgs(): # Tests that the number of images returned from rotate is correct test_img = imread("../tests/imgs/milad.jpg") returned_arr = rot.rotate("../tests/imgs/milad.jpg", 5, 180) - assert returned_arr.shape[0] == 5 + assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape From 65659bcf108e75d17cd3a416de655597c47d0bee Mon Sep 17 00:00:00 2001 From: Alycia Date: Sun, 17 Feb 2019 15:28:54 -0800 Subject: [PATCH 05/49] Add lower() to mirror, small edits to README --- AutoTransformPy/mirror.py | 6 +++--- README.md | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/AutoTransformPy/mirror.py b/AutoTransformPy/mirror.py index ae4bd2c..9477cdd 100644 --- a/AutoTransformPy/mirror.py +++ b/AutoTransformPy/mirror.py @@ -39,7 +39,7 @@ def mirror (image_path, direction = 'all'): if not isinstance(direction, str): raise TypeError("The direction must be a string: 'horizontal', 'vertical', or 'all'") - if not direction in ["horizontal","vertical", "all"]: + if not direction.lower() in ["horizontal","vertical", "all"]: raise ValueError("The direction must be 'horizontal', 'vertical' or 'all'") if not os.path.isfile(image_path): @@ -50,12 +50,12 @@ def mirror (image_path, direction = 'all'): mirrored_images = [img] # flip horizontally - if direction == 'horizontal' or direction == 'all': + if direction.lower() == 'horizontal' or direction.lower() == 'all': horiz_image = np.fliplr(img) mirrored_images.append(horiz_image) # flip vertically - if direction == 'vertical' or direction == 'all': + if direction.lower() == 'vertical' or direction.lower() == 'all': vert_image = img[::-1] mirrored_images.append(vert_image) diff --git a/README.md b/README.md index eed82cb..669b13b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AutoTransform -### Contributors +## Contributors | Name | GitHub | |---|---| @@ -9,11 +9,11 @@ | Rayce Rossum | [RayceRossum](https://github.com/RayceRossum) | -### Overview +## Overview A common application of supervised machine learning is identifying the object of an image. One issue that users encounter is a model misclassifying a new image because the object is rotated or translated in some way that was not captured in the training images. The purpose of this package is to create a more robust set of images for users to train their model with. The package will accept an image as an input, apply a series of transformations to it, and return an array of transformed pixel values. Transformations include: rotating, mirroring, and translating (shifting the object's location in the frame). -### Functions +## Functions #### Rotate @@ -28,21 +28,21 @@ Mirrors an image in the horizontal and/or vertical direction and returns the pix Translate will move an image within its frame, so that the topic of the image will be shifted to a new location in the frame. The distance and direction of translation will be chosen randomly, but the user specifies the maximum distance of the translation and the number of images they want generated. It returns the pixel values of the translated images. -### Python Environment +## Python Environment Scikit-image is a image processing package that contains functions for performing various operations to images, such as rotating or resizing, among many others. AutoTransformPy utilizes some of this packages functionality and builds it out, so the user can easily gain many variations of an image. The intended usage of this package is for the development of a larger set of training images for the training of an image classification algorithms. -### Installation +## Installation To install AutoTransformPy: 1. In your console, type: `pip install git+https://github.com/UBC-MDS/AutoTransformPy.git` 2. You can now use AutoTransformPy. See usage instructions below: -### Usage +## Usage -#### Rotate +### Rotate `from AutoTransformPy.rotate import rotate` @@ -56,14 +56,14 @@ To install AutoTransformPy: **Output:** -- An np.array of pixel values of the rotated images. Array contains `num_images`. +- An np.array of pixel values of the rotated images. Array contains `num_images` + 1 images (original plus all translated images) **Example:** - `rotate("../tests/imgs/milad.jpg", 10, 280)` -#### Mirror +### Mirror `from AutoTransformPy.mirror import mirror` @@ -83,7 +83,7 @@ To install AutoTransformPy: - `mirror("../tests/imgs/milad.jpg", "horizontal")` -#### Translate +### Translate `from AutoTransformPy.translate import translate` @@ -104,7 +104,7 @@ To install AutoTransformPy: - `translate("../tests/imgs/milad.jpg", 5, 80)` -### Package Dependencies +## Package Dependencies - `numpy` - `skimage` From de99583a8d47a350d565b9b7692c3f43d8c7b796 Mon Sep 17 00:00:00 2001 From: everittb Date: Sat, 2 Mar 2019 12:32:04 -0800 Subject: [PATCH 06/49] Adding validation for file path in function and test for this validation --- AutoTransformPy/rotate.py | 4 ++++ tests/test_rotate.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/AutoTransformPy/rotate.py b/AutoTransformPy/rotate.py index 736a63e..942bbde 100644 --- a/AutoTransformPy/rotate.py +++ b/AutoTransformPy/rotate.py @@ -8,6 +8,7 @@ from skimage.io import imread from skimage.transform import rotate as rot import numpy as np +import os def rotate (image_path, num_images, max_rotation): """Returns an array of images of length num_images randomly rotated a random degree up to max_rotation @@ -48,6 +49,9 @@ def rotate (image_path, num_images, max_rotation): if max_rotation < 1 or max_rotation > 360: raise ValueError("The maximum rotation must be between 1 and 360.") + if not os.path.isfile(image_path): + raise FileNotFoundError("No image found at path") + # Perform image rotation rotations = np.random.randint(-max_rotation, max_rotation, num_images) org_image = imread(image_path) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index a988305..052c6f4 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -14,6 +14,9 @@ def test_inputs(): rot.rotate("../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range rot.rotate("../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + with pytest.raises(FileNotFoundError): + rot.rotate("../tests/imgs/Path.jpg") # Incorrect directory/file not in location + def test_return_imgs(): # Tests that the number of images returned from rotate is correct test_img = imread("../tests/imgs/milad.jpg") returned_arr = rot.rotate("../tests/imgs/milad.jpg", 5, 180) From c091ac3f62b674676c91033d70abb531c775e33f Mon Sep 17 00:00:00 2001 From: Alycia Date: Sat, 2 Mar 2019 14:10:34 -0800 Subject: [PATCH 07/49] Add full usage example to readme --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 669b13b..63b9f89 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ To install AutoTransformPy: **Output:** -- An np.array of pixel values of the rotated images. Array contains `num_images` + 1 images (original plus all translated images) +- An np.array of pixel values of the rotated images. Array contains `num_images` + 1 images (original plus all rotated images) **Example:** @@ -109,3 +109,39 @@ To install AutoTransformPy: - `numpy` - `skimage` - `os` + + +## Full Usage Example & Output + +``` +# pip install git+https://github.com/UBC-MDS/AutoTransformPy.git + +from AutoTransformPy.mirror import mirror +from AutoTransformPy.rotate import rotate +from AutoTransformPy.translate import translate +from skimage.io import imshow + +# perform transformations +m = mirror("../tests/imgs/milad.jpg", "horizontal") +r = rotate("../tests/imgs/milad.jpg", 10, 280) +t = translate("../tests/imgs/milad.jpg", 5, 80) + +# view dimensions of returned arrays +m.shape # mirror function +r.shape # rotate function +t.shape # translate function + +# display original image +imshow(m[0]) +imshow(r[0]) +imshow(t[0]) + +# display one of the transformed images +imshow(m[1]) +imshow(r[1]) +imshow(t[1]) + +``` + +# Tests Output + From 30859a166f5383cc047421b7f0e3a997f5e6f278 Mon Sep 17 00:00:00 2001 From: everittb Date: Sat, 2 Mar 2019 15:00:05 -0800 Subject: [PATCH 08/49] Address issue with displaying the original image --- AutoTransformPy/rotate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoTransformPy/rotate.py b/AutoTransformPy/rotate.py index 942bbde..deb9d21 100644 --- a/AutoTransformPy/rotate.py +++ b/AutoTransformPy/rotate.py @@ -58,6 +58,6 @@ def rotate (image_path, num_images, max_rotation): rotated_images = [org_image] for a_rotation in rotations: - rotated_images.append(rot(org_image, a_rotation, resize=False)) + rotated_images.append(rot(org_image, a_rotation, resize=False).astype('uint8')) return np.asarray(rotated_images) From 29b96e8248d1c3bfdf2a48d2fb114d810da2888e Mon Sep 17 00:00:00 2001 From: everittb Date: Sat, 2 Mar 2019 16:06:44 -0800 Subject: [PATCH 09/49] Revert "Address issue with displaying the original image" This reverts commit 30859a166f5383cc047421b7f0e3a997f5e6f278. --- AutoTransformPy/rotate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoTransformPy/rotate.py b/AutoTransformPy/rotate.py index deb9d21..942bbde 100644 --- a/AutoTransformPy/rotate.py +++ b/AutoTransformPy/rotate.py @@ -58,6 +58,6 @@ def rotate (image_path, num_images, max_rotation): rotated_images = [org_image] for a_rotation in rotations: - rotated_images.append(rot(org_image, a_rotation, resize=False).astype('uint8')) + rotated_images.append(rot(org_image, a_rotation, resize=False)) return np.asarray(rotated_images) From 3206d6bf9465d8672812c189b59947a87156f527 Mon Sep 17 00:00:00 2001 From: Alycia Date: Sun, 3 Mar 2019 14:50:50 -0800 Subject: [PATCH 10/49] Add usage and test output --- README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 63b9f89..470a4b6 100644 --- a/README.md +++ b/README.md @@ -127,21 +127,37 @@ r = rotate("../tests/imgs/milad.jpg", 10, 280) t = translate("../tests/imgs/milad.jpg", 5, 80) # view dimensions of returned arrays +# it will be a 4D array, with the 1st dimension representing how many photos are in the array m.shape # mirror function r.shape # rotate function t.shape # translate function # display original image -imshow(m[0]) -imshow(r[0]) -imshow(t[0]) +imshow(m[0]) # using mirror function as example + # display one of the transformed images -imshow(m[1]) -imshow(r[1]) -imshow(t[1]) +imshow(m[1]) # mirror function +imshow(r[1]) # rotate function +imshow(t[1]) # translate function ``` # Tests Output +``` +================================================= test session starts ================================================= +platform win32 -- Python 3.6.8, pytest-4.1.1, py-1.7.0, pluggy-0.8.1 +rootdir: C:\Users\Alycia\Desktop\data_science\block_5\AutoTransformPy, inifile: +plugins: remotedata-0.3.1, openfiles-0.3.2, doctestplus-0.2.0, arraydiff-0.3 +collected 6 items + +test_mirror.py .. [ 33%] +test_rotate.py .. [ 66%] +test_translate.py .. [100%] + +============================================== 6 passed in 27.15 seconds ============================================== + +``` + +All our tests pass, however due to the layout of our test documents, we are unable to use a coverage testing function at this time. We tried to troublehsoot, but it will require a rewrite of our test packages. From b2a28cafaadfefd302dda0a50931f15e220ea4b1 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 15:06:52 -0800 Subject: [PATCH 11/49] First attempt at travis integration --- .travis.yml | 10 ++++++++++ requirements.txt | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 .travis.yml create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1d061e6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python +python: + - "3.6" + +# command to install dependencies +install: + - pip install -r requirements.txt + +# command to run tests +script: pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9b7156f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +python_version>='3.6' +numpy>=1.14 +scikit-image>=0.13 From 764a483a5292f01b93ec0bcfa51554e46eb05e2d Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 15:15:01 -0800 Subject: [PATCH 12/49] Second attempt at travis --- tests/test_rotate.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 052c6f4..79fdf47 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -3,22 +3,23 @@ from skimage.io import imread sys.path.append("../AutoTransformPy/") import rotate as rot +import AutoTransformPy as ATP def test_inputs(): with pytest.raises(TypeError): - rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + ATP.rotate(6, 5, 345) # Not a string for the file path + ATP.rotate("../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + ATP.rotate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + ATP.rotate("../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + ATP.rotate("../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): - rot.rotate("../tests/imgs/Path.jpg") # Incorrect directory/file not in location + ATP.rotate("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct test_img = imread("../tests/imgs/milad.jpg") - returned_arr = rot.rotate("../tests/imgs/milad.jpg", 5, 180) + returned_arr = ATP.rotate("../tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape From ea19372001f2c52bbea304da7a1373ccb47876c8 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 15:19:09 -0800 Subject: [PATCH 13/49] Third attempt at travis --- tests/test_rotate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 79fdf47..73c2c95 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -2,7 +2,7 @@ import pytest from skimage.io import imread sys.path.append("../AutoTransformPy/") -import rotate as rot +# import rotate as rot import AutoTransformPy as ATP def test_inputs(): From 4e4df8e923cdd772e323594535375ed272405f7e Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 15:24:58 -0800 Subject: [PATCH 14/49] Updating test scripts to correct error with travis --- tests/test_mirror.py | 19 ++++++++++--------- tests/test_translate.py | 13 +++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 5b32dd1..e5d4358 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -14,25 +14,26 @@ from skimage.io import imread import numpy as np sys.path.append("../AutoTransformPy/") -import mirror as mir +# import mirror as mir +import AutoTransformPy as ATP def test_inputs(): with pytest.raises(TypeError): - mir.mirror("../tests/imgs/milad.jpg", 7) # direction must be string - mir.mirror(True, "horizontal") # image path must be a string + ATP.mirror("../tests/imgs/milad.jpg", 7) # direction must be string + ATP.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("../tests/imgs/milad.jpg", "h") # Not a valid string option for direction + ATP.mirror("../tests/imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): - mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location + ATP.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct test_img = imread("../tests/imgs/milad.jpg") - returned_arr_1a = mir.mirror("../tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("../tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("../tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("../tests/imgs/milad.jpg") # all is default, should return 2 images + returned_arr_1a = ATP.mirror("../tests/imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = ATP.mirror("../tests/imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = ATP.mirror("../tests/imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = ATP.mirror("../tests/imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_translate.py b/tests/test_translate.py index d88aac6..580ddcb 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -2,20 +2,21 @@ import pytest from skimage.io import imread sys.path.append("../AutoTransformPy/") -import translate as trans +# import translate as trans +import AutoTransformPy as ATP def test_inputs(): with pytest.raises(TypeError): - trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("../tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + ATP.translate(6, 5, 2) # Not a string for the file path + ATP.translate("../tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images + ATP.translate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("../tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + ATP.translate("../tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct test_img = imread("../tests/imgs/milad.jpg") - returned_arr = trans.translate("../tests/imgs/milad.jpg", 5, 10) + returned_arr = ATP.translate("../tests/imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From 1a900cabc48eda2f45f24e06cd29480c508c7f80 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 15:38:12 -0800 Subject: [PATCH 15/49] Trying to get travis build working still --- AutoTransformPy/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AutoTransformPy/__init__.py b/AutoTransformPy/__init__.py index e69de29..4089b46 100644 --- a/AutoTransformPy/__init__.py +++ b/AutoTransformPy/__init__.py @@ -0,0 +1,3 @@ +name = "AutoTransformPy" + +from mirror.py import mirror From d0c1e1adb1f900168353257cc257f973fafed8ba Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 15:50:43 -0800 Subject: [PATCH 16/49] Trying to get travis build working still, again --- AutoTransformPy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoTransformPy/__init__.py b/AutoTransformPy/__init__.py index 4089b46..4fe1424 100644 --- a/AutoTransformPy/__init__.py +++ b/AutoTransformPy/__init__.py @@ -1,3 +1,3 @@ name = "AutoTransformPy" -from mirror.py import mirror +from AutoTransformPy.mirror import mirror From 38dd05d0edf88399d696b602248b584ba9427aa5 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 16:06:33 -0800 Subject: [PATCH 17/49] More travis issues --- AutoTransformPy/__init__.py | 2 -- tests/test_mirror.py | 19 +++++++++---------- tests/test_rotate.py | 17 ++++++++--------- tests/test_translate.py | 13 ++++++------- 4 files changed, 23 insertions(+), 28 deletions(-) diff --git a/AutoTransformPy/__init__.py b/AutoTransformPy/__init__.py index 4fe1424..ffa3eb0 100644 --- a/AutoTransformPy/__init__.py +++ b/AutoTransformPy/__init__.py @@ -1,3 +1 @@ name = "AutoTransformPy" - -from AutoTransformPy.mirror import mirror diff --git a/tests/test_mirror.py b/tests/test_mirror.py index e5d4358..fc9073c 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -14,26 +14,25 @@ from skimage.io import imread import numpy as np sys.path.append("../AutoTransformPy/") -# import mirror as mir -import AutoTransformPy as ATP +from AutoTransformPy import mirror as mir def test_inputs(): with pytest.raises(TypeError): - ATP.mirror("../tests/imgs/milad.jpg", 7) # direction must be string - ATP.mirror(True, "horizontal") # image path must be a string + mir.mirror("../tests/imgs/milad.jpg", 7) # direction must be string + mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - ATP.mirror("../tests/imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror("../tests/imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): - ATP.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location + mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct test_img = imread("../tests/imgs/milad.jpg") - returned_arr_1a = ATP.mirror("../tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = ATP.mirror("../tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = ATP.mirror("../tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = ATP.mirror("../tests/imgs/milad.jpg") # all is default, should return 2 images + returned_arr_1a = mir.mirror("../tests/imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = mir.mirror("../tests/imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = mir.mirror("../tests/imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = mir.mirror("../tests/imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 73c2c95..ed467e9 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -2,24 +2,23 @@ import pytest from skimage.io import imread sys.path.append("../AutoTransformPy/") -# import rotate as rot -import AutoTransformPy as ATP +from AutoTransformPy import rotate as rot def test_inputs(): with pytest.raises(TypeError): - ATP.rotate(6, 5, 345) # Not a string for the file path - ATP.rotate("../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - ATP.rotate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate(6, 5, 345) # Not a string for the file path + rot.rotate("../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - ATP.rotate("../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - ATP.rotate("../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): - ATP.rotate("../tests/imgs/Path.jpg") # Incorrect directory/file not in location + rot.rotate("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct test_img = imread("../tests/imgs/milad.jpg") - returned_arr = ATP.rotate("../tests/imgs/milad.jpg", 5, 180) + returned_arr = rot.rotate("../tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index 580ddcb..a7e6c6c 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -2,21 +2,20 @@ import pytest from skimage.io import imread sys.path.append("../AutoTransformPy/") -# import translate as trans -import AutoTransformPy as ATP +from AutoTransformPy import translate as trans def test_inputs(): with pytest.raises(TypeError): - ATP.translate(6, 5, 2) # Not a string for the file path - ATP.translate("../tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - ATP.translate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate(6, 5, 2) # Not a string for the file path + trans.translate("../tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images + trans.translate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - ATP.translate("../tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate("../tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct test_img = imread("../tests/imgs/milad.jpg") - returned_arr = ATP.translate("../tests/imgs/milad.jpg", 5, 10) + returned_arr = trans.translate("../tests/imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From f54481b671cd4cb209915167d673309ca5f0f67d Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 16:27:40 -0800 Subject: [PATCH 18/49] More travis issues again --- tests/test_mirror.py | 14 +++++++------- tests/test_rotate.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/test_mirror.py b/tests/test_mirror.py index fc9073c..0e0f038 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -18,21 +18,21 @@ def test_inputs(): with pytest.raises(TypeError): - mir.mirror("../tests/imgs/milad.jpg", 7) # direction must be string + mir.mirror("imgs/milad.jpg", 7) # direction must be string mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("../tests/imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror("imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("../tests/imgs/milad.jpg") - returned_arr_1a = mir.mirror("../tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("../tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("../tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("../tests/imgs/milad.jpg") # all is default, should return 2 images + test_img = imread("imgs/milad.jpg") + returned_arr_1a = mir.mirror("imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = mir.mirror("imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = mir.mirror("imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = mir.mirror("imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index ed467e9..2664645 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -7,18 +7,18 @@ def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): - rot.rotate("../tests/imgs/Path.jpg") # Incorrect directory/file not in location + rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("../tests/imgs/milad.jpg") - returned_arr = rot.rotate("../tests/imgs/milad.jpg", 5, 180) + test_img = imread("imgs/milad.jpg") + returned_arr = rot.rotate("imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape From 200e30f513369288a3acd3ec3f105b46c73e99e7 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 16:28:12 -0800 Subject: [PATCH 19/49] Forgot to correct translate file --- tests/test_translate.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_translate.py b/tests/test_translate.py index a7e6c6c..3d7dc82 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -7,15 +7,15 @@ def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("../tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("../tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate("imgs/milad.jpg", "seven", 2) # Not a valid number of images + trans.translate("imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("../tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate("imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("../tests/imgs/milad.jpg") - returned_arr = trans.translate("../tests/imgs/milad.jpg", 5, 10) + test_img = imread("imgs/milad.jpg") + returned_arr = trans.translate("imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From e44ab1a7b2c89136f7a74d5095bc9d7bf55f4113 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 16:49:40 -0800 Subject: [PATCH 20/49] Trying to fix travis path issues --- tests/test_mirror.py | 14 +++++++------- tests/test_rotate.py | 12 ++++++------ tests/test_translate.py | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 0e0f038..0c0d06d 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -18,21 +18,21 @@ def test_inputs(): with pytest.raises(TypeError): - mir.mirror("imgs/milad.jpg", 7) # direction must be string + mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", 7) # direction must be string mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("imgs/milad.jpg") - returned_arr_1a = mir.mirror("imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("imgs/milad.jpg") # all is default, should return 2 images + test_img = imread("AutoTransformPy/tests/imgs/milad.jpg") + returned_arr_1a = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 2664645..a97b22a 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -7,18 +7,18 @@ def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("imgs/milad.jpg") - returned_arr = rot.rotate("imgs/milad.jpg", 5, 180) + test_img = imread("AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index 3d7dc82..421f7d6 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -7,15 +7,15 @@ def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate("AutoTransformPy/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images + trans.translate("AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate("AutoTransformPy/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("imgs/milad.jpg") - returned_arr = trans.translate("imgs/milad.jpg", 5, 10) + test_img = imread("AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = trans.translate("AutoTransformPy/tests/imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From f9d94e5bd28aedcaea495d98ec6ef6033ebb1500 Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Tue, 5 Mar 2019 17:03:07 -0800 Subject: [PATCH 21/49] Add python coverage --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 470a4b6..64c8baf 100644 --- a/README.md +++ b/README.md @@ -160,4 +160,13 @@ test_translate.py .. ``` -All our tests pass, however due to the layout of our test documents, we are unable to use a coverage testing function at this time. We tried to troublehsoot, but it will require a rewrite of our test packages. +``` +Name Stmts Miss Cover Missing +---------------------------------------------------------------------------------------------------------------------------- +/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/__init__.py 0 0 100% +/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/mirror.py 22 0 100% +/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/rotate.py 20 0 100% +/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/translate.py 21 0 100% +---------------------------------------------------------------------------------------------------------------------------- +TOTAL 63 0 100% +``` From 1f28c5cda61ec24e64ebc5b6ed96d354b153f54d Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Tue, 5 Mar 2019 17:04:06 -0800 Subject: [PATCH 22/49] Add title to coverage --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 64c8baf..20bf948 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ test_translate.py .. ``` +#### Code Coverage: ``` Name Stmts Miss Cover Missing ---------------------------------------------------------------------------------------------------------------------------- From 9f25ae7cf9ae01d0cf8d276fa3c5587fc8425a4a Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Tue, 5 Mar 2019 17:05:00 -0800 Subject: [PATCH 23/49] Add better titles --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20bf948..f4c824d 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,9 @@ imshow(t[1]) # translate function ``` -# Tests Output +## Testing + +#### Output of Tests: ``` ================================================= test session starts ================================================= From 1be9b3cd32e2116505b584cfbc8981b0a06739e3 Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Tue, 5 Mar 2019 17:07:32 -0800 Subject: [PATCH 24/49] Remove local file paths --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f4c824d..31ede18 100644 --- a/README.md +++ b/README.md @@ -166,10 +166,10 @@ test_translate.py .. ``` Name Stmts Miss Cover Missing ---------------------------------------------------------------------------------------------------------------------------- -/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/__init__.py 0 0 100% -/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/mirror.py 22 0 100% -/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/rotate.py 20 0 100% -/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/translate.py 21 0 100% + AutoTransformPy/__init__.py 0 0 100% + AutoTransformPy/mirror.py 22 0 100% + AutoTransformPy/rotate.py 20 0 100% + AutoTransformPy/translate.py 21 0 100% ---------------------------------------------------------------------------------------------------------------------------- TOTAL 63 0 100% ``` From 99561c1ccb849df44af90a6e5d6d6896bf6e9de4 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 19:09:18 -0800 Subject: [PATCH 25/49] More travis file path issues --- tests/test_mirror.py | 14 +++++++------- tests/test_rotate.py | 12 ++++++------ tests/test_translate.py | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 0c0d06d..81bc6e7 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -18,21 +18,21 @@ def test_inputs(): with pytest.raises(TypeError): - mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", 7) # direction must be string + mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", 7) # direction must be string mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("AutoTransformPy/tests/imgs/milad.jpg") - returned_arr_1a = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("AutoTransformPy/tests/imgs/milad.jpg") # all is default, should return 2 images + test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") + returned_arr_1a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index a97b22a..1988230 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -7,18 +7,18 @@ def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = rot.rotate("AutoTransformPy/tests/imgs/milad.jpg", 5, 180) + test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index 421f7d6..ce441e3 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -7,15 +7,15 @@ def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("AutoTransformPy/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images + trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("AutoTransformPy/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = trans.translate("AutoTransformPy/tests/imgs/milad.jpg", 5, 10) + test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From df754e4268055140396bd90a08fca50271fa4dd0 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 19:14:52 -0800 Subject: [PATCH 26/49] Another attempt at travis path issues --- tests/test_mirror.py | 14 +++++++------- tests/test_rotate.py | 12 ++++++------ tests/test_translate.py | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 81bc6e7..b6c3258 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -18,21 +18,21 @@ def test_inputs(): with pytest.raises(TypeError): - mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", 7) # direction must be string + mir.mirror("/tests/imgs/milad.jpg", 7) # direction must be string mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror("/tests/imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") - returned_arr_1a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg") # all is default, should return 2 images + test_img = imread("/tests/imgs/milad.jpg") + returned_arr_1a = mir.mirror("/tests/imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = mir.mirror("/tests/imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = mir.mirror("/tests/imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = mir.mirror("/tests/imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 1988230..fce02ff 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -7,18 +7,18 @@ def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 180) + test_img = imread("/tests/imgs/milad.jpg") + returned_arr = rot.rotate("/tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index ce441e3..6ba8ad6 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -7,15 +7,15 @@ def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate("/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images + trans.translate("/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate("/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 10) + test_img = imread("/tests/imgs/milad.jpg") + returned_arr = trans.translate("/tests/imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From 6536cc74698107afdd7202810c017e45829d5e55 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 21:13:25 -0800 Subject: [PATCH 27/49] File path issues still --- tests/test_rotate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index fce02ff..273fecd 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -1,8 +1,8 @@ import sys import pytest from skimage.io import imread -sys.path.append("../AutoTransformPy/") from AutoTransformPy import rotate as rot +sys.path.append("/AutoTransformPy") def test_inputs(): with pytest.raises(TypeError): From 575d906b5bdf65615fd3b29567d52f7a91baa0e7 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 21:29:03 -0800 Subject: [PATCH 28/49] More travis testing --- .travis.yml | 1 + tests/test_mirror.py | 14 +++++++------- tests/test_rotate.py | 12 ++++++------ tests/test_translate.py | 10 +++++----- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d061e6..35b3c3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ python: # command to install dependencies install: - pip install -r requirements.txt + - pip install git+https://github.com/UBC-MDS/AutoTransformPy # command to run tests script: pytest diff --git a/tests/test_mirror.py b/tests/test_mirror.py index b6c3258..81bc6e7 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -18,21 +18,21 @@ def test_inputs(): with pytest.raises(TypeError): - mir.mirror("/tests/imgs/milad.jpg", 7) # direction must be string + mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", 7) # direction must be string mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("/tests/imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("/tests/imgs/milad.jpg") - returned_arr_1a = mir.mirror("/tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("/tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("/tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("/tests/imgs/milad.jpg") # all is default, should return 2 images + test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") + returned_arr_1a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "horizontal") # should return 1 image + returned_arr_1b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "vertical") # should return 1 image + returned_arr_2a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "all") # should return 2 images + returned_arr_2b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg") # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 273fecd..a99bee5 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -7,18 +7,18 @@ def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("/tests/imgs/milad.jpg") - returned_arr = rot.rotate("/tests/imgs/milad.jpg", 5, 180) + test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index 6ba8ad6..ce441e3 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -7,15 +7,15 @@ def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images + trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("/tests/imgs/milad.jpg") - returned_arr = trans.translate("/tests/imgs/milad.jpg", 5, 10) + test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From 8e603eb9ec8dc7b87158fae3dfe6a6f3dae50e91 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 21:41:00 -0800 Subject: [PATCH 29/49] Path issues continued --- .travis.yml | 1 - tests/test_translate.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 35b3c3d..1d061e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ python: # command to install dependencies install: - pip install -r requirements.txt - - pip install git+https://github.com/UBC-MDS/AutoTransformPy # command to run tests script: pytest diff --git a/tests/test_translate.py b/tests/test_translate.py index ce441e3..606a482 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -4,6 +4,7 @@ sys.path.append("../AutoTransformPy/") from AutoTransformPy import translate as trans +print(sys.path) def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path From bcd36306a6fb9c3cbc6219ed1c900b85f87b38c0 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 22:04:46 -0800 Subject: [PATCH 30/49] File path issues still --- tests/test_rotate.py | 15 ++++++++------- tests/test_translate.py | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index a99bee5..4560c73 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -1,24 +1,25 @@ import sys +import os import pytest from skimage.io import imread from AutoTransformPy import rotate as rot -sys.path.append("/AutoTransformPy") +sys.path.insert(0, os.path.abspath("../../AutoTransformPy")) def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = rot.rotate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 180) + test_img = imread("/tests/imgs/milad.jpg") + returned_arr = rot.rotate("/tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index 606a482..ce441e3 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -4,7 +4,6 @@ sys.path.append("../AutoTransformPy/") from AutoTransformPy import translate as trans -print(sys.path) def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path From 2ba6eb8af2c0b0f58b25b6e7e450314c9fa8d9c0 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 22:10:46 -0800 Subject: [PATCH 31/49] File paths never going to work --- tests/test_rotate.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 4560c73..b08befc 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -3,23 +3,22 @@ import pytest from skimage.io import imread from AutoTransformPy import rotate as rot -sys.path.insert(0, os.path.abspath("../../AutoTransformPy")) def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("../../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("../../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("../../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("../../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("/tests/imgs/milad.jpg") - returned_arr = rot.rotate("/tests/imgs/milad.jpg", 5, 180) + test_img = imread("../../tests/imgs/milad.jpg") + returned_arr = rot.rotate("../../tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape From 67fcc872a0d4666d267fa899f9292bcd53369051 Mon Sep 17 00:00:00 2001 From: everittb Date: Tue, 5 Mar 2019 22:16:30 -0800 Subject: [PATCH 32/49] One final try of file path issue --- tests/test_rotate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index b08befc..5f65ece 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -7,18 +7,18 @@ def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("../../tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("../../tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images + rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("../../tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("../../tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range + rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("../../tests/imgs/milad.jpg") - returned_arr = rot.rotate("../../tests/imgs/milad.jpg", 5, 180) + test_img = imread("../../AutoTransformPy/tests/imgs/milad.jpg") + returned_arr = rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape From fe402f306de5716a52bbbc2a831ad4e2bea0ea2e Mon Sep 17 00:00:00 2001 From: everittb Date: Wed, 6 Mar 2019 06:55:13 -0800 Subject: [PATCH 33/49] Trying Alycia recommend fix --- tests/test_mirror.py | 18 ++++++++++-------- tests/test_rotate.py | 14 ++++++++------ tests/test_translate.py | 14 ++++++++------ 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 81bc6e7..6201a49 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -10,29 +10,31 @@ # Output : An np.array of the mirrored image(s) import sys +import os import pytest from skimage.io import imread import numpy as np -sys.path.append("../AutoTransformPy/") from AutoTransformPy import mirror as mir +fname = os.path.join(os.path.dirname(__file__), '../tests/imgs/milad.jpg') + def test_inputs(): with pytest.raises(TypeError): - mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", 7) # direction must be string + mir.mirror(fname, 7) # direction must be string mir.mirror(True, "horizontal") # image path must be a string with pytest.raises(ValueError): - mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "h") # Not a valid string option for direction + mir.mirror(fname, "h") # Not a valid string option for direction with pytest.raises(FileNotFoundError): mir.mirror("../tests/imgs/Path.jpg") # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") - returned_arr_1a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "horizontal") # should return 1 image - returned_arr_1b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "vertical") # should return 1 image - returned_arr_2a = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg", "all") # should return 2 images - returned_arr_2b = mir.mirror("/AutoTransformPy/tests/imgs/milad.jpg") # all is default, should return 2 images + test_img = imread(fname) + returned_arr_1a = mir.mirror(fname, "horizontal") # should return 1 image + returned_arr_1b = mir.mirror(fname, "vertical") # should return 1 image + returned_arr_2a = mir.mirror(fname, "all") # should return 2 images + returned_arr_2b = mir.mirror(fname) # all is default, should return 2 images assert returned_arr_1a.shape[0] == 2 # check two image in array (original and mirrored) assert returned_arr_1b.shape[0] == 2 # check two image in array (original and mirrored) diff --git a/tests/test_rotate.py b/tests/test_rotate.py index 5f65ece..599e3f6 100644 --- a/tests/test_rotate.py +++ b/tests/test_rotate.py @@ -4,21 +4,23 @@ from skimage.io import imread from AutoTransformPy import rotate as rot +fname = os.path.join(os.path.dirname(__file__), '../tests/imgs/milad.jpg') + def test_inputs(): with pytest.raises(TypeError): rot.rotate(6, 5, 345) # Not a string for the file path - rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", "seven", 345) # Not a valid number of images - rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid rotation amount + rot.rotate(fname, "seven", 345) # Not a valid number of images + rot.rotate(fname, 6, "eight") # Not a valid rotation amount with pytest.raises(ValueError): - rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", 7, 500) # Outside of the rotation range - rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", -1, 500) # Nonsense number of images to return + rot.rotate(fname, 7, 500) # Outside of the rotation range + rot.rotate(fname, -1, 500) # Nonsense number of images to return with pytest.raises(FileNotFoundError): rot.rotate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location def test_return_imgs(): # Tests that the number of images returned from rotate is correct - test_img = imread("../../AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = rot.rotate("../../AutoTransformPy/tests/imgs/milad.jpg", 5, 180) + test_img = imread(fname) + returned_arr = rot.rotate(fname, 5, 180) assert returned_arr.shape[0] == 6 assert returned_arr.shape[1:] == test_img.shape diff --git a/tests/test_translate.py b/tests/test_translate.py index ce441e3..a8cb3ba 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -1,21 +1,23 @@ import sys +import os import pytest from skimage.io import imread -sys.path.append("../AutoTransformPy/") from AutoTransformPy import translate as trans +fname = os.path.join(os.path.dirname(__file__), '../tests/imgs/milad.jpg') + def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", "seven", 2) # Not a valid number of images - trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 6, "eight") # Not a valid translation amount + trans.translate(fname, "seven", 2) # Not a valid number of images + trans.translate(fname, 6, "eight") # Not a valid translation amount with pytest.raises(ValueError): - trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 7, 1000) # Outside of the translation range, possible to get empty images + trans.translate(fname, 7, 1000) # Outside of the translation range, possible to get empty images def test_return_imgs(): # Tests that the number of images returned from translate is correct - test_img = imread("/AutoTransformPy/tests/imgs/milad.jpg") - returned_arr = trans.translate("/AutoTransformPy/tests/imgs/milad.jpg", 5, 10) + test_img = imread(fname) + returned_arr = trans.translate(fname, 5, 10) assert returned_arr[0].shape == test_img.shape assert returned_arr.shape[0] == 6 From 2cb8ffb78e5574d9c144974bba42047aae7f0850 Mon Sep 17 00:00:00 2001 From: everittb Date: Wed, 6 Mar 2019 07:41:41 -0800 Subject: [PATCH 34/49] Removing pycache files --- .../__pycache__/__init__.cpython-36.pyc | Bin 191 -> 0 bytes .../__pycache__/rotate.cpython-36.pyc | Bin 1671 -> 0 bytes tests/__pycache__/__init__.cpython-36.pyc | Bin 157 -> 0 bytes .../test_mirror.cpython-36-PYTEST.pyc | Bin 3481 -> 0 bytes .../test_rotate.cpython-36-PYTEST.pyc | Bin 1666 -> 0 bytes .../test_translate.cpython-36-PYTEST.pyc | Bin 2039 -> 0 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AutoTransformPy/__pycache__/__init__.cpython-36.pyc delete mode 100644 AutoTransformPy/__pycache__/rotate.cpython-36.pyc delete mode 100644 tests/__pycache__/__init__.cpython-36.pyc delete mode 100644 tests/__pycache__/test_mirror.cpython-36-PYTEST.pyc delete mode 100644 tests/__pycache__/test_rotate.cpython-36-PYTEST.pyc delete mode 100644 tests/__pycache__/test_translate.cpython-36-PYTEST.pyc diff --git a/AutoTransformPy/__pycache__/__init__.cpython-36.pyc b/AutoTransformPy/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 3cbcae7023a4e707f0940657f2784ac717b32927..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 191 zcmXr!<>kuzkru-M1dl-k3@`#24nSPY0whuxf*CX!{Z=v*frJsnuN-Hqn9$>|Y8CQ%O!`Doov%KV)wB9PD%G?E0 zb$Ql14Oc>!#hP_O2*z3GVnSv{N>*3QX;$(#XSgHRDvlXEFHtz=_zF_H3&|=DnPDqb z#@t{CmPsWI2yFYTJB2y`k120YHuZB^Od8>=ZT*tk@DFA>Bd)jb)*itE=2frVU%_ zS~+PBx6Y(f;2Txd&YocA!|p*FA)a|TPMCEjR~foJ0AKJt_ZYlbo+3CpN}${=nFJ$l zkLiTv03qw888UTh`831fb(;E9@VT%RfF~x~J;D3a4U+Mq&{uo`D7V_2gA80@GkL^! z%O&g?O1EXXknT!K#g4EAj-P(o3)c7M9mNhYs!!NA@KxcL`CY#TE$iR5Z6Qt~e?}>Rw;X2qH|G!#CzH{IQg5EbtegUDI zC-;^d3jJ5K7kEFxpRtki{Wi{RuB_u~Dcca*s-2y#EBV|QZQ2lMwec%n)V(866zDZ|;QZ}7wlXd5nzIXTd z(wJ}Wia&{Y2xb5IC`q1tRXcqOU@UY~`Q7?;7nM|N<1gPa49j35AI5YV^dp>t{Q;eZ z2XsnD;C&R}?)jvR?Fum`xkhT~!@=Q(BDmGO4>{X0aDqyEU?ZZP>APxqnrzhiOtvj6}9 diff --git a/tests/__pycache__/__init__.cpython-36.pyc b/tests/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 93f42cefeeacf2e995082487bfe1a92863c26ffe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmXr!<>d&=ek&P@K*9*(mzRDgslH3Fv!{Zok%_)zX-R%aQDRa diff --git a/tests/__pycache__/test_mirror.cpython-36-PYTEST.pyc b/tests/__pycache__/test_mirror.cpython-36-PYTEST.pyc deleted file mode 100644 index 6cad279a0bd548568467130a5461c72ab6ecc622..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3481 zcmb_f&2Jk;6rcU{di|NCO_~;3w@})J)J~kFr4m7N7V9wK!u-hgy2Fi$d#>lK2I0M+ z>r-L-6JZ62E2jMqYFk0usWH2^?$qAl+}-rsjt@w0d%^m4Wx00u(VhF1<@(Z7$D9zt zxtWBmc6xD6tX;p;4fzxvdl4og<>7Z)P6jK1W}Kr*Sm-cBj{edxM^qX}eG*D7Imu67 z8p_H*?#n|Na@AK78LZVvYAIBkC4G(ReLd15eOvBlq745&R9hOIjWQb&J&XDcd7y$0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he?_bT$0%|BsNEZ;w9TUN5pCb+ zJnjxsIsh6UCBvhWwNCrv#}7VT>uhenRK}96l;I^zD;tZtGR1>zlyga!dms?@a1*{O znupm9*k3+E6E?CI>Jk3L@(~E0;t9%eU%PmKLv4a5S^>Q>(F+99DD=WO(I#eL^51i# zZ<3|LJjP^M+K;uVL9E>B*QV&i;)me33wTy`44Nagfd+o5Lr;;~W#o@45<%pt@`47D zHKiL6X}>U*(8MAuq+VDt2ECTM;H?+6DRBM{I@&-J9eyS-#C@H3t7u{q$uP?)zB<{jy&VqVn%*!={NaKaRyV)lz-Q>{ZCm@U50ftg2MBd-*mV%C^3 zYrMp)t{VRC!T)wRGvM{lToC8l{{H#HH{Z_2n?85HohfVkYf@YHd5ia=jJlJx{nE5^ z5e3RDYWpfmI78MA<2340VV6Cbc6~$Wa8>|fQ)=5%>IL#C{Y2z*Q9@gElGbh6Ns>7c^#Gc-hVPX7kojP@!h)O>+9?`q{@@Gr085bdDrIw z752Mv>jW_1w4ROJ-zy>gC(5fk&_QIsSh zqZvCIrdhF{fIpWDQ-`<#S-=+aM6O@q%W-RI_0m zWXMBJ Date: Wed, 6 Mar 2019 07:58:03 -0800 Subject: [PATCH 35/49] Setup Travis and integrate Travis badge on README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31ede18..78c9d51 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# AutoTransform +# AutoTransform + +[![Build Status](https://travis-ci.org/UBC-MDS/AutoTransformPy.svg?branch=master)](https://travis-ci.org/UBC-MDS/AutoTransformPy) ## Contributors From 1e8bba9ecc5f2453c339744aaa865d05dd9f5d07 Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:13:42 -0800 Subject: [PATCH 36/49] Add code coverage --- .travis.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d061e6..d44ea8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,15 @@ python: install: - pip install -r requirements.txt -# command to run tests -script: pytest +# command to run tests & document coverage +addons: + apt: + packages: + - python-coverage +script: + - pytest + - py.test --cov-report= --cov=AutoTransformR tests/ + +# code coverage badge +after_success: + - codecov From 97bda1e46ce08ea81d79e73775678c5e57850d7f Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:14:29 -0800 Subject: [PATCH 37/49] Fix typo in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d44ea8f..3ac7724 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ addons: - python-coverage script: - pytest - - py.test --cov-report= --cov=AutoTransformR tests/ + - py.test --cov-report= --cov=AutoTransformPy tests/ # code coverage badge after_success: From ce3dc9409466e09b62c47b76dfc72b66259b2b05 Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:18:12 -0800 Subject: [PATCH 38/49] Fix error in codecov section of travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3ac7724..ea21406 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ addons: - python-coverage script: - pytest - - py.test --cov-report= --cov=AutoTransformPy tests/ + - pytest --cov=AutoTransformPy tests/ # code coverage badge after_success: From f7e415c21a10b9213c085ab043eb08617d070fc2 Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:24:09 -0800 Subject: [PATCH 39/49] More codecov error fixing --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index ea21406..b4d6a97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ python: # command to install dependencies install: - pip install -r requirements.txt + - pip install codecov + - pip install pytest-cov # command to run tests & document coverage addons: From 9ad5ede4a35445473859d8da70cf7f9ab7e490c1 Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:45:12 -0800 Subject: [PATCH 40/49] Add logo and codecov badge --- README.md | 67 ++++++++++++++++++------------------------------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 78c9d51..39a727f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# AutoTransform +# AutoTransformPy [![Build Status](https://travis-ci.org/UBC-MDS/AutoTransformPy.svg?branch=master)](https://travis-ci.org/UBC-MDS/AutoTransformPy) +[![codecov](https://codecov.io/gh/UBC-MDS/AutoTransformPy/branch/master/graph/badge.svg)](https://codecov.io/gh/UBC-MDS/AutoTransformPy) + ## Contributors @@ -10,11 +12,18 @@ | Brenden Everitt | [everittB](https://github.com/everittB) | | Rayce Rossum | [RayceRossum](https://github.com/RayceRossum) | +To contribute to this project, you must adhere to the terms outlined in our [Code of Conduct.](https://github.com/UBC-MDS/AutoTransformPy/blob/master/CONDUCT.md) ## Overview A common application of supervised machine learning is identifying the object of an image. One issue that users encounter is a model misclassifying a new image because the object is rotated or translated in some way that was not captured in the training images. The purpose of this package is to create a more robust set of images for users to train their model with. The package will accept an image as an input, apply a series of transformations to it, and return an array of transformed pixel values. Transformations include: rotating, mirroring, and translating (shifting the object's location in the frame). +## Installation + +To install AutoTransformPy. In your console, type: + +`pip install git+https://github.com/UBC-MDS/AutoTransformPy.git` + ## Functions #### Rotate @@ -35,20 +44,15 @@ Translate will move an image within its frame, so that the topic of the image wi Scikit-image is a image processing package that contains functions for performing various operations to images, such as rotating or resizing, among many others. AutoTransformPy utilizes some of this packages functionality and builds it out, so the user can easily gain many variations of an image. The intended usage of this package is for the development of a larger set of training images for the training of an image classification algorithms. -## Installation - -To install AutoTransformPy: - -1. In your console, type: `pip install git+https://github.com/UBC-MDS/AutoTransformPy.git` -2. You can now use AutoTransformPy. See usage instructions below: - ## Usage ### Rotate -`from AutoTransformPy.rotate import rotate` +``` +from AutoTransformPy.rotate import rotate -`rotate(image_path, num_images, max_rotation)` +rotate(image_path, num_images, max_rotation) +``` **Arguments:** @@ -67,9 +71,11 @@ To install AutoTransformPy: ### Mirror -`from AutoTransformPy.mirror import mirror` +``` +from AutoTransformPy.mirror import mirror -`mirror(image_path, direction)` +mirror(image_path, direction) +``` **Arguments:** @@ -87,9 +93,11 @@ To install AutoTransformPy: ### Translate -`from AutoTransformPy.translate import translate` +``` +from AutoTransformPy.translate import translate -`translate(image_path, num_images, max_translation)` +translate(image_path, num_images, max_translation) +``` **Arguments:** @@ -144,34 +152,3 @@ imshow(r[1]) # rotate function imshow(t[1]) # translate function ``` - -## Testing - -#### Output of Tests: - -``` -================================================= test session starts ================================================= -platform win32 -- Python 3.6.8, pytest-4.1.1, py-1.7.0, pluggy-0.8.1 -rootdir: C:\Users\Alycia\Desktop\data_science\block_5\AutoTransformPy, inifile: -plugins: remotedata-0.3.1, openfiles-0.3.2, doctestplus-0.2.0, arraydiff-0.3 -collected 6 items - -test_mirror.py .. [ 33%] -test_rotate.py .. [ 66%] -test_translate.py .. [100%] - -============================================== 6 passed in 27.15 seconds ============================================== - -``` - -#### Code Coverage: -``` -Name Stmts Miss Cover Missing ----------------------------------------------------------------------------------------------------------------------------- - AutoTransformPy/__init__.py 0 0 100% - AutoTransformPy/mirror.py 22 0 100% - AutoTransformPy/rotate.py 20 0 100% - AutoTransformPy/translate.py 21 0 100% ----------------------------------------------------------------------------------------------------------------------------- -TOTAL 63 0 100% -``` From 247e78df8bf711f02e4c89ebb738fe9366a3479a Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:47:12 -0800 Subject: [PATCH 41/49] grammar fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39a727f..e8b46b8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# AutoTransformPy +# AutoTransformPy [![Build Status](https://travis-ci.org/UBC-MDS/AutoTransformPy.svg?branch=master)](https://travis-ci.org/UBC-MDS/AutoTransformPy) [![codecov](https://codecov.io/gh/UBC-MDS/AutoTransformPy/branch/master/graph/badge.svg)](https://codecov.io/gh/UBC-MDS/AutoTransformPy) @@ -20,7 +20,7 @@ A common application of supervised machine learning is identifying the object of ## Installation -To install AutoTransformPy. In your console, type: +In your console, type: `pip install git+https://github.com/UBC-MDS/AutoTransformPy.git` From 64c8c0e38c14735c13efcb15885c35299244d786 Mon Sep 17 00:00:00 2001 From: Alycia Date: Wed, 6 Mar 2019 10:47:47 -0800 Subject: [PATCH 42/49] Add logo image file --- docs/logopy.png | Bin 0 -> 26207 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/logopy.png diff --git a/docs/logopy.png b/docs/logopy.png new file mode 100644 index 0000000000000000000000000000000000000000..7c9ba487bccdd90199dda165ac84c576bdb3f5c0 GIT binary patch literal 26207 zcmXt9by!r*+g?H%X;>PTMx-PpB$t$y25F=_q$L(uQkL$P4(SF#Iu{U-7U@PxLE<~U zzw7&hYtOYi%$a%S>HD524K)RP94Z_T2!yYs2-O0CP%(f%eJoVqo7BZNSKtG~Q%mg) z=pOU{x-Zn01%3u$yDA!ZfI!?#|Nc;XK1q6mKnx%ysI<0E_R*?uww29Wo`+M9>!o(T z^%8&n3@c((7?+ejUY2xfFkxrtFc}eyUJPQ=YOINjfyC$$5fWa8>S+@$l1N<>@)D9O zVJVr_k6Zb@^E<6M{$`N3`+KOoro5)wL8R%!TJ4?Y+qXJ_Gak1AlMR9NJ05w!g5bp_ z^uWg@E)-ZdDFZPGln+7xUp#@MgFx&Wet{rRm*<+%W8LLg(uccH6IyI3NwahqPEk1* zo-!lY%!-lNZ0j3#m=+cWSQ`8~czVW+PT)#8xFAFqH8whx=a((_mpv)wFK4*hLG-<# zB4F~bT$hvd=xBJtu`FMZ2mNLs46s>iK?+E=441-LfWnL&n6k|ChMTSzB#S|-z$g2#;m4IJ{qc2My!p{RJxYK?e=c)az5*t}(;tEw=wU?Nx@ zI#}^7Sm+A~Eta8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Ij!lnN<_KY^wavk_q|wG%N> zda&>>>N_TZEE&R!4_5uEw0RUL)(Ceag@18!-fJTz`AcPGX|5o@3fQ^&1+x)btR-VS z`7g=i7Lrh6SD<=?VxXTRHJOcqa0@>vQQAFPjn8Bx$*eFwhcFf4r@c3l={o$(X~-C# z3%5v<5<$6W9|l-He@8>2`TQk$Up5^HXQ=cC(n8{$uV&Y3h?3_vVgO1^(2!6na2v6- zg1D$jqB_j{t3+BsbFnuyl@cuJ;>k(btU#Qt2Bai*K*E0|?!UJ(gsJJ#uUlAREw$pw zwF8zx|0(!q&`=zP2>WU&_+x>V67yYvgeKY2x4n`;?=CHCpi67d1IlcY*hO*T0H9ui zcC^Ze2mY-<@_FL$U`9$sUWysu4ikaC|EP{2paRf9D6tA{t0hw)fxH6uq5yHgCmNDJ zH(bds{-dK{RAhfHq(^q>=h6!3U^86B7fc+GLPH`<80-6dGtf%@G}rfIDDi2OORMw) zO3MeF1oku(v5L%hDME>fLo7+<+CWynIrWG`f(osa*zcwn&}P%D`45v41#-mt#!yoz z-KC)B1FlOv7v2mKe*R7*3B)GcnoWKTqESu&$><0IYG?tVuo-Qs9WCtp11OvgbIu=BvBY5%hBY;O*OL6~J7Aue_7cKRDVj?Th3DA&@%CNMY1{u8IzB`+4AgImS zA|Fbu5KQOqC+xdMO%}@CKmzm(|Mv9;XHQ~=a5s?=lRlwFEBhKye4vPn){=AL7D*fE z9H Date: Wed, 6 Mar 2019 10:48:47 -0800 Subject: [PATCH 43/49] Fix logo link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8b46b8..9078f78 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# AutoTransformPy +# AutoTransformPy [![Build Status](https://travis-ci.org/UBC-MDS/AutoTransformPy.svg?branch=master)](https://travis-ci.org/UBC-MDS/AutoTransformPy) [![codecov](https://codecov.io/gh/UBC-MDS/AutoTransformPy/branch/master/graph/badge.svg)](https://codecov.io/gh/UBC-MDS/AutoTransformPy) From 8b84837a2afd6da533ac958360eb08373524fd97 Mon Sep 17 00:00:00 2001 From: Alycia Butterworth <42809905+alyciakb@users.noreply.github.com> Date: Wed, 6 Mar 2019 10:57:03 -0800 Subject: [PATCH 44/49] Small edits to full usage example --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9078f78..4e916da 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,6 @@ translate(image_path, num_images, max_translation) from AutoTransformPy.mirror import mirror from AutoTransformPy.rotate import rotate from AutoTransformPy.translate import translate -from skimage.io import imshow # perform transformations m = mirror("../tests/imgs/milad.jpg", "horizontal") @@ -142,13 +141,14 @@ m.shape # mirror function r.shape # rotate function t.shape # translate function +# You can use skimage.io to view the transformed images: +from skimage.io import imshow + # display original image imshow(m[0]) # using mirror function as example - # display one of the transformed images imshow(m[1]) # mirror function imshow(r[1]) # rotate function imshow(t[1]) # translate function - ``` From f205daa99371207ea078d1ac44689e10d9cb7ec6 Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Wed, 6 Mar 2019 15:40:10 -0800 Subject: [PATCH 45/49] Delete .coverage --- .coverage | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .coverage diff --git a/.coverage b/.coverage deleted file mode 100644 index 0ae75a3..0000000 --- a/.coverage +++ /dev/null @@ -1 +0,0 @@ -!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/tests/test_mirror.py":[12,13,14,15,17]}} \ No newline at end of file From 2c11c2428b7f0e8df91c8d23035d892a35922133 Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Thu, 7 Mar 2019 12:08:12 -0800 Subject: [PATCH 46/49] Add basic exception handling to python project --- AutoTransformPy/mirror.py | 27 ++++++++++++++++---------- AutoTransformPy/rotate.py | 37 +++++++++++++++++++++--------------- AutoTransformPy/translate.py | 34 +++++++++++++++++++++------------ 3 files changed, 61 insertions(+), 37 deletions(-) diff --git a/AutoTransformPy/mirror.py b/AutoTransformPy/mirror.py index 1c735c9..8d1f195 100644 --- a/AutoTransformPy/mirror.py +++ b/AutoTransformPy/mirror.py @@ -30,22 +30,29 @@ def mirror (image_path, direction = 'all'): mirrored_images: np.array """ - # check for valid input parameters + try: + # check for valid input parameters + if not isinstance(image_path, str): + raise TypeError("The file path must be a string.") - if not isinstance(image_path, str): - raise TypeError("The file path must be a string.") + if not isinstance(direction, str): + raise TypeError("The direction must be a string: 'horizontal', 'vertical', or 'all'") - if not isinstance(direction, str): - raise TypeError("The direction must be a string: 'horizontal', 'vertical', or 'all'") + if not direction.lower() in ["horizontal","vertical", "all"]: + raise ValueError("The direction must be 'horizontal', 'vertical' or 'all'") - if not direction.lower() in ["horizontal","vertical", "all"]: - raise ValueError("The direction must be 'horizontal', 'vertical' or 'all'") + img = imread(image_path) - if not os.path.isfile(image_path): - raise FileNotFoundError("No image found at path") + except TypeError as e: + print("Invalid parameter types. Correct parameter types: image_path: str, num_images: int, direction: string") + raise e + except ValueError as e: + print("Invalid direction value. The direction must be a string: 'horizontal', 'vertical', or 'all'") + raise e + except FileNotFoundError as e: + raise e # import image as array - img = imread(image_path) mirrored_images = [img] # flip horizontally diff --git a/AutoTransformPy/rotate.py b/AutoTransformPy/rotate.py index 942bbde..e8d6912 100644 --- a/AutoTransformPy/rotate.py +++ b/AutoTransformPy/rotate.py @@ -32,29 +32,36 @@ def rotate (image_path, num_images, max_rotation): rotated_images: np.array """ - # Check for valid input paramters types - if not isinstance(image_path, str): - raise TypeError("The file path must be a string.") + try: + # Check for valid input paramters types + if not isinstance(image_path, str): + raise TypeError("The file path must be a string.") - if not isinstance(num_images, int): - raise TypeError("The number of images returned must be an integer.") + if not isinstance(num_images, int): + raise TypeError("The number of images returned must be an integer.") - if not isinstance(max_rotation, int): - raise TypeError("The maximum rotation of images must be an integer.") + if not isinstance(max_rotation, int): + raise TypeError("The maximum rotation of images must be an integer.") - # Check for valid input paramter values - if num_images < 1: - raise ValueError("The number of images returned must be 1 or greater.") + # Check for valid input paramter values + if num_images < 1: + raise ValueError("The number of images returned must be 1 or greater.") - if max_rotation < 1 or max_rotation > 360: - raise ValueError("The maximum rotation must be between 1 and 360.") + if max_rotation < 1 or max_rotation > 360: + raise ValueError("The maximum rotation must be between 1 and 360.") - if not os.path.isfile(image_path): - raise FileNotFoundError("No image found at path") + org_image = imread(image_path) + except TypeError as e: + print("Invalid parameter types. Correct parameter types: image_path: str, num_images: int, max_rotation: int") + raise e + except ValueError as e: + print("Invalid max_rotation value. max_rotation must be greater than 1 and less than 360.") + raise e + except FileNotFoundError as e: + raise e # Perform image rotation rotations = np.random.randint(-max_rotation, max_rotation, num_images) - org_image = imread(image_path) rotated_images = [org_image] for a_rotation in rotations: diff --git a/AutoTransformPy/translate.py b/AutoTransformPy/translate.py index 7e568a7..2460a06 100644 --- a/AutoTransformPy/translate.py +++ b/AutoTransformPy/translate.py @@ -24,23 +24,33 @@ def translate (image_path, num_images, max_translation): """ # Check for valid input paramters types - if not isinstance(image_path, str): - raise TypeError("The file path must be a string.") + try: + if not isinstance(image_path, str): + raise TypeError("The file path must be a string.") - if not isinstance(num_images, int): - raise TypeError("The number of images returned must be an integer.") + if not isinstance(num_images, int): + raise TypeError("The number of images returned must be an integer.") - if not isinstance(max_translation, int): - raise TypeError("The maximum translation of images must be an integer.") + if not isinstance(max_translation, int): + raise TypeError("The maximum translation of images must be an integer.") - # Check for valid input paramter values - if num_images < 1: - raise ValueError("The number of images returned must be 1 or greater.") + # Check for valid input paramter values + if num_images < 1: + raise ValueError("The number of images returned must be 1 or greater.") - org_image = imread(image_path) + org_image = imread(image_path) - if max_translation >= org_image.shape[0] or max_translation >= org_image.shape[1]: - raise ValueError("The maximum translation must be less than the width and height of the image.") + if max_translation >= org_image.shape[0] or max_translation >= org_image.shape[1]: + raise ValueError("The maximum translation must be less than the width and height of the image.") + + except TypeError as e: + print("Invalid parameter types. Correct parameter types: image_path: str, num_images: int, max_translation: int") + raise e + except ValueError as e: + print("Invalid max_translation value. max_translation must be greater than 1 and less than the width and height of the image.") + raise e + except FileNotFoundError as e: + raise e # Perform image translation translations = (np.random.randint(-max_translation, max_translation, num_images), np.random.randint(-max_translation, max_translation, num_images)) From ec788673bf78556fc6669afd13ed539637cee34e Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Thu, 7 Mar 2019 12:10:25 -0800 Subject: [PATCH 47/49] merge upstream --- tests/.coverage | 2 +- tests/test_translate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/.coverage b/tests/.coverage index 06ac930..ef5862a 100644 --- a/tests/.coverage +++ b/tests/.coverage @@ -1 +1 @@ -!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/mirror.py":[8,9,10,12,35,38,39,36,41,42,44,45,48,49,52,53,54,57,62,64,58,59],"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/__init__.py":[1],"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/rotate.py":[1,2,3,5,28,29,31,32,34,35,38,41,42,39,45,46,47,49,50,52],"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy-Master/AutoTransformPy/translate.py":[1,2,3,5,27,28,30,31,33,34,37,40,42,43,38,46,47,49,50,51,53]}} \ No newline at end of file +!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy/AutoTransformPy/mirror.py":[8,9,10,12,33,35,38,39,46,47,48,36,41,42,49,50,51,44,52,53,56,59,60,61,64,69,71,65,66],"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy/AutoTransformPy/__init__.py":[1],"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy/AutoTransformPy/rotate.py":[8,9,10,11,13,35,37,38,54,55,56,40,41,43,44,47,50,51,57,58,59,48,53,60,61,64,65,67,68,70],"/home/rayce/Assignments/Block 5/DSCI 524/AutoTransformPy/AutoTransformPy/translate.py":[1,2,3,5,27,28,29,46,47,48,31,32,34,35,38,41,43,44,49,50,51,39,56,57,59,60,61,63]}} \ No newline at end of file diff --git a/tests/test_translate.py b/tests/test_translate.py index 710789d..a3e7c09 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -9,7 +9,6 @@ def test_inputs(): with pytest.raises(TypeError): trans.translate(6, 5, 2) # Not a string for the file path - with pytest.raises(TypeError): trans.translate(fname, "seven", 2) # Not a valid number of images with pytest.raises(TypeError): @@ -19,6 +18,7 @@ def test_inputs(): trans.translate(fname, 7, 1000) # Outside of the translation range, possible to get empty images with pytest.raises(ValueError): trans.translate(fname, -1, 500) # Nonsense number of images to return + def test_return_imgs(): # Tests that the number of images returned from translate is correct test_img = imread(fname) returned_arr = trans.translate(fname, 5, 10) From 0048cabb75cf428121e388cd5f1c098b55ec7f70 Mon Sep 17 00:00:00 2001 From: Rayce Rossum Date: Thu, 7 Mar 2019 12:16:39 -0800 Subject: [PATCH 48/49] Add filenotfound test to translate --- tests/test_translate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_translate.py b/tests/test_translate.py index a3e7c09..374c88b 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -19,6 +19,10 @@ def test_inputs(): with pytest.raises(ValueError): trans.translate(fname, -1, 500) # Nonsense number of images to return + with pytest.raises(FileNotFoundError): + trans.translate("../tests/imgs/Path.jpg", 7, 100) # Incorrect directory/file not in location + + def test_return_imgs(): # Tests that the number of images returned from translate is correct test_img = imread(fname) returned_arr = trans.translate(fname, 5, 10) From 24f5fdaafb02474c404f4256acffbaad04e0b6f0 Mon Sep 17 00:00:00 2001 From: Alycia Butterworth <42809905+alyciakb@users.noreply.github.com> Date: Sat, 9 Mar 2019 12:38:40 -0800 Subject: [PATCH 49/49] Fix a section title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e916da..2349a61 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ translate(image_path, num_images, max_translation) - `os` -## Full Usage Example & Output +## Full Usage Example ``` # pip install git+https://github.com/UBC-MDS/AutoTransformPy.git