GithubHelp home page GithubHelp logo

Comments (11)

Evizero avatar Evizero commented on May 18, 2024

Thanks for reporting the issue. However, this is not a lot of information to go on. can you provide some more details? for example the version you are using and some code with some comments at the places where you observed which inconsistency.

from augmentor.

gnaygnak avatar gnaygnak commented on May 18, 2024

Ok, sure. and Thank you for your timely reply. Here I'll give your some version informal, the code I'm running and the result I got.
NAME VERSION
Augmentor 0.2.0
numpy 1.14.1
p = Augmentor.Pipeline("train")
#Point to a directory containing ground truth data.
#Images with the same file names will be added as ground truth data
# and augmented in parallel to the original data.
p.ground_truth("mask")
# Add operations to the pipeline as normal:
p.rotate(probability=1, max_left_rotation=5, max_right_rotation=5)
p.flip_left_right(probability=1)
p.zoom_random(probability=1, percentage_area=0.8)
p.flip_top_bottom(probability=1)
p.sample(6)

Finally, I got 10 pictures, they were 4 transformed masks and 4 corresponding transformed image and 2 image without corresponding transformed masks.
Normally, I should have gotten 5 transformed masks and image correspondingly, but not! I don't know why. I hope I have express clearly.
Thank you.

from augmentor.

mdbloice avatar mdbloice commented on May 18, 2024

Hi @gnaygnak, how many images are in train and mask directories? Are there any sub folders in either directory?
I am having some issues with the new ground truth functionality, and trying to get to the bottom of it. In my tests things seem to work fine, but users are having some strange problems...

from augmentor.

gnaygnak avatar gnaygnak commented on May 18, 2024

Hi @mdbloice , I have known the reason. When you are applying the ground_truth() function, you must make sure that there is just single data in train and mask directories, right?
Thank you for replying.

from augmentor.

mdbloice avatar mdbloice commented on May 18, 2024

Hi @gnaygnak, no it should work with any number of images. As long as the file names match between the two directories you can use any number of images.
M.

from augmentor.

Marwen-Bhj avatar Marwen-Bhj commented on May 18, 2024

Hi @mdbloice is there a way to have ground_truth() working even if the file names do not match ? in my case the ground truth file names are followed by "_mask"

from augmentor.

mdbloice avatar mdbloice commented on May 18, 2024

Hi @Marwen-Bhj, no not at the moment, however you can use DataPipeline for such situations:

p = Augmentor.DataPipeline(images, y)

Where images contains any number of images/masks in array format (rather than reading from the disk). See this notebook for details on how to prepare the images data structure here:

Multiple-Mask-Augmentation.ipynb

Hope this helps!

from augmentor.

Marwen-Bhj avatar Marwen-Bhj commented on May 18, 2024

Hi @mdbloice thank you , it did help doing the task needed , yet as I saw in documentation ,this doesn't save the files anywhere , I tried using :
sample_with_array(augmented_images[i][j], save_to_disk=True) in a for loop

where augmented_images.shape outputs (3, 2, 384, 768, 3) (3x2 samples , 348x768 and 3 channels ) if we transform it to an array using numpy .

I need those generated samples and augmented images saved in a certain directory how can I do this ?

from augmentor.

mdbloice avatar mdbloice commented on May 18, 2024

Hi @Marwen-Bhj, you could try using PIL/Pillow to create images from array data, so something like

from PIL import Image

im = Image.fromarray(augmented_images[...])
im.save('/path/image.png') 

and do that in a loop, where augmented_images[...] will have to be sliced accordingly to get the images you want out....

from augmentor.

Marwen-Bhj avatar Marwen-Bhj commented on May 18, 2024

@mdbloice yes that's what I did eventually , just had to do some workaround with naming . thank you again.

from augmentor.

mdbloice avatar mdbloice commented on May 18, 2024

@Marwen-Bhj ok sure, glad you got it to work out :-)

M.

from augmentor.

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.