Comments (11)
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.
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.
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.
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.
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.
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.
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.
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.
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.
@mdbloice yes that's what I did eventually , just had to do some workaround with naming . thank you again.
from augmentor.
@Marwen-Bhj ok sure, glad you got it to work out :-)
M.
from augmentor.
Related Issues (20)
- How to read and output uint16 images with Augmentor?
- moudle 'Augmentor' has no attribute 'Pipeline'
- int() argument must be a string, a bytes-like object or a number, not 'Image' HOT 4
- why random_erasing sometimes cause error, but sometimes not. HOT 1
- OSError: cannot write mode RGBA as JPEG HOT 2
- What augments should you use?
- label interpolate issue
- p.ground_truth not work for p.add_operation HOT 3
- Not cropping skewed image to original image size HOT 1
- Random Ereasing areas too big HOT 5
- Question - Does it updated the labels too? HOT 3
- Use for Semantic Segmentation HOT 4
- Output dataset format Labelme JSON
- ValueError: image has wrong mode HOT 1
- ZeroDivisionError: float division by zero while performing augmentor.sample(num_samples)
- DataPipeline使用sample的时候会报错
- Incompatible with numpy >= 1.20 due to use of type aliases. HOT 1
- Rotation degrees are opposite. HOT 3
- Project dependencies may have API risk issues
- fail to build augmentor 0.2.11 due to a minor typo 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 augmentor.