Comments (4)
import cv2
from albumentations import OpticalDistortion, Compose
from urllib.request import urlopen
import numpy as np
def aug_optical_distortion(p=1):
return Compose([
OpticalDistortion(p=1)
], p=p)
def download_image(url):
data = urlopen(url).read()
data = np.frombuffer(data, np.uint8)
image = cv2.imdecode(data, cv2.IMREAD_COLOR)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
return image
if __name__ == '__main__':
source_img = download_image('https://d177hi9zlsijyy.cloudfront.net/wp-content/uploads/sites/2/2018/05/11202041/'
'180511105900-atlas-boston-dynamics-robot-running-super-tease.jpg')
aug = aug_optical_distortion()
augmented_image = aug(image=source_img)['image']
cv2.imshow('Source image', source_img)
cv2.imshow('Augmented image', augmented_image)
cv2.waitKey()
In [1]: import albumentations
In [2]: albumentations.__version__
Out[2]: '0.0.12'
In [3]: import cv2
In [4]: cv2.__version__
Out[4]: '3.4.3'
from albumentations.
fixed!
from albumentations.
can you please send full snippet - from image reading to getting result from augmentations? thanks
from albumentations.
Yes, I can reproduce this error. Will solve it in nearest future, stay tuned and thank you for bugreport.
from albumentations.
Related Issues (20)
- [it may be a bug but I am not sure] rotating and cropping adding in pixels HOT 4
- keypoint position shifting during image rotation HOT 3
- Data loading does not start when num_workers > 0 in 1.4.10 HOT 4
- [Benchmark] Add transforms from Kornia HOT 1
- [Tech Debt, Speedup] Move to_float to albucore
- ISONoise not working in 1.4.10 HOT 1
- [Bug] Issue in RandomCrop HOT 1
- Coarse Dropout ignores remove_invisible parameter
- [Feature request] Add LetterBox
- Affine rotate shear after the picture frame does not overlap the object HOT 4
- Yolo bbox conversion produces negative values HOT 3
- Too noisy upgrade warning HOT 12
- AttributeError: 'Compose' object has no attribute 'strict' HOT 5
- How is the pad_cval defined of CropAndPad? HOT 1
- Image and mask augmentations cause error when converting NumPy to PyTorch - [ValueError: At least one stride in the given numpy array is negative, and tensors with negative strides are not currently supported.] HOT 5
- [Benchmark] unable to test the given dataset ILSVRC2012_img_val or owndataset to test the image_benchmark.py with. HOT 2
- Grid-based Elastic Transformation HOT 1
- Root logger conflict with my custom logging structure HOT 2
- HistogramMatching returns wrong image HOT 3
- Mistyping in validation of `ColorJitter` transform HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from albumentations.