albumentations-team / albumentations_examples Goto Github PK
View Code? Open in Web Editor NEWAugmentations usage examples for albumentations library
License: MIT License
Augmentations usage examples for albumentations library
License: MIT License
Related to #23.
$ git rev-parse HEAD
9700da883c9b7fbb5735252d239cd12201b56a47
$ jupyter nbconvert --to html --execute notebooks/serialization.ipynb --output /tmp/first-run.html
[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.
[NbConvertApp] Converting notebook notebooks/serialization.ipynb to html
CONDA_PREFIX=/home/raniere/mambaforge/envs/first-carpal
Traceback (most recent call last):
File "/home/raniere/mambaforge/envs/jupyter/bin/jupyter-nbconvert", line 10, in <module>
sys.exit(main())
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/jupyter_core/application.py", line 264, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/traitlets/config/application.py", line 846, in launch_instance
app.start()
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 414, in start
self.convert_notebooks()
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 588, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 551, in convert_single_notebook
output, resources = self.export_single_notebook(
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 479, in export_single_notebook
output, resources = self.exporter.from_filename(
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/exporters/exporter.py", line 189, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/exporters/exporter.py", line 206, in from_file
return self.from_notebook_node(
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/exporters/html.py", line 215, in from_notebook_node
return super().from_notebook_node(nb, resources, **kw)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py", line 384, in from_notebook_node
nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/exporters/exporter.py", line 146, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/exporters/exporter.py", line 335, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__
return self.preprocess(nb, resources)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/preprocessors/execute.py", line 89, in preprocess
self.preprocess_cell(cell, resources, index)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbconvert/preprocessors/execute.py", line 110, in preprocess_cell
cell = self.execute_cell(cell, index, store_history=True)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbclient/util.py", line 84, in wrapped
return just_run(coro(*args, **kwargs))
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbclient/util.py", line 62, in just_run
return loop.run_until_complete(coro)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbclient/client.py", line 965, in async_execute_cell
await self._check_raise_for_error(cell, cell_index, exec_reply)
File "/home/raniere/mambaforge/envs/jupyter/lib/python3.10/site-packages/nbclient/client.py", line 862, in _check_raise_for_error
raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
assert np.array_equal(transformed['image'], transformed_from_loaded_transform['image'])
------------------
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 assert np.array_equal(transformed['image'], transformed_from_loaded_transform['image'])
AssertionError:
AssertionError:
There is a duplicates two code and two images in albumentations_examples/notebooks/example_weather_transforms.ipynb
def forward(ctx, classifications, regressions, anchors, annotations):
I found that it works at the moment with
!pip install opencv-python-headless==4.1.2.30
in example_bboxes.pynb, but it might be a more general problem.
Hi,
I wonder if the built-in transformation for segmentation can handle multiclasses, as I see there are only 2 classes in the examples
This is like the issue #136 that was closed 2 years ago.
I would like to request a Google Colab example of using Albumentations in TensorFlow for Test Time Augmentations (TTA). The example given in the previous issue thread of pytorch toolkit was not immediately useful to me.
This is really important to me so I'm willing to help $ if it can expedite. I'd like to do some experiments with TTA for my PhD research, and I'm not that great of a programmer.
Thank you
pytorch_semantic_segmentation.ipynb
confronts a bug:AttributeError: module 'albumentations.augmentations.functional' has no attribute 'resize'
In [28]: full_sized_mask = F.resize(
to
In [28]: full_sized_mask = A.resize(
I work on MNIST datasets, I need to enlarge their size by using data augmentation use Albumentations. there are ways to pass a subset of the dataset rather than "for loop", a way like fit, or something like that. All of the examples I've seen only pass one image at a time not datasets.
Hi, I occasionally get this error when I use A.RandomShadow(p=0.5). If I disable this augmenter in the conveyor, the error does not appear anymore. What can it be related to?
File "C:\Users****\anaconda3\envs\python_torch\lib\site-packages\albumentations\augmentations\functional.py", line 915, in add_shadow
cv2.fillPoly(mask, vertices, 255)
cv2.error: OpenCV(4.5.4) 👎 error: (-5:Bad argument) in function 'fillPoly'
Overload resolution failed:
- Layout of the output array img is incompatible with cv::Mat
- Expected Ptrcv::UMat for argument 'img'
it is mentioned how to convert torchvision transform:normalize to albumetaions transform:normalize when using the same pipe line.
but it is not metioned how to convert torchvision normalize to albumentaions normalize when using albumentaions with PIL.
If it is impossible, I'd appreciate it if you could mention it. If it is possible, please give use some example. Thank you
Hello
How are you?
Thanks for contributing to this project.
I am going to implement an operation for center-padding along with the shortest side while keeping the longest side.
There is the operation named "CenterPadToSquare" in "imgaug" library (https://github.com/aleju/imgaug).
But I can NOT find/implement such an operation/combination in this library.
Could u help me?
AttributeError Traceback (most recent call last)
in <cell line: 5>()
3 image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
4
----> 5 resized_image = F.resize(image, height=256, width=256)
6 padded_image = F.pad(image, min_height=512, min_width=512)
7 padded_constant_image = F.pad(image, min_height=512, min_width=512, border_mode=cv2.BORDER_CONSTANT)
AttributeError: module 'albumentations.augmentations.functional' has no attribute 'resize'
Hi,
thanks for providing this awesome package :)
Is the problem just me or has it been seen by others?
...\lib\site-packages\albumentations\augmentations\functional.py:1258: RuntimeWarning: divide by zero encountered in power
table = (np.arange(0, 256.0 / 255, 1.0 / 255) ** gamma) * 255
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.