Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push everything to main #98

Merged
merged 8 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Documentation Status](https://readthedocs.org/projects/imagenie/badge/?version=latest)](https://imagenie.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/github/UBC-MDS/ImaGenie/graph/badge.svg?token=Dd6MnDTOH7)](https://codecov.io/github/UBC-MDS/ImaGenie)
# ImaGenie

Expand Down
321 changes: 209 additions & 112 deletions docs/example.ipynb

Large diffs are not rendered by default.

Binary file added docs/img/capybara5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
445 changes: 220 additions & 225 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/imagenie/blur.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def blur(image, stdev=1.0):

im_filtered[:,:,c]=image_conv[h:h_end,w:w_end]

return(im_filtered)
return(im_filtered.round().astype(np.int32))
4 changes: 2 additions & 2 deletions tests/test_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_augment():
# call individual tests
assert np.isclose(blur(input_image[0]),output_image,atol=.01).all, "Incorrect output, function not working as expected"
# Check if invalid functions raise a ValueError
invalid_operations = [(blur,1),(flip, 1), (scale, 0.5), (lambda x: x, 1)] # Invalid function (lambda)
invalid_operations = [(blur,1),(flip, 1), (scale, 1), (lambda x: x, 1)] # Invalid function (lambda)
with pytest.raises(ValueError):
augment(input_image, invalid_operations)

Expand All @@ -47,4 +47,4 @@ def test_augment():
augment(input_image, invalid_operations_2)
if __name__ == "__main__":
test_augment()
print("All tests passed.")
print("All tests passed.")
5 changes: 3 additions & 2 deletions tests/test_blur.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def test_blur():
blurred_path='tests/output.png'

img_array=np.asarray(plt.imread(file_path))
print(img_array)
expected = np.asarray(plt.imread(blurred_path))
input= img_array
with pytest.raises(TypeError):
Expand All @@ -23,4 +22,6 @@ def test_blur():


#Test blurring function
assert np.isclose(blur(input),expected[:,:,0:3],atol=.01).all, "Incorrect output, function not working as expected"
assert np.isclose(blur(input),expected[:,:,0:3],atol=.01).all, "Incorrect output, function not working as expected"
if __name__=="__main__":
test_blur()
Loading