Code Monkey home page Code Monkey logo

Comments (4)

igriffer avatar igriffer commented on August 25, 2024 1
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.

albu avatar albu commented on August 25, 2024 1

fixed!

from albumentations.

albu avatar albu commented on August 25, 2024

can you please send full snippet - from image reading to getting result from augmentations? thanks

from albumentations.

albu avatar albu commented on August 25, 2024

Yes, I can reproduce this error. Will solve it in nearest future, stay tuned and thank you for bugreport.

from albumentations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.