Open Sicily-F opened 3 years ago
Hi @Sicily-F ,
You're rescaling your data twice. Firstly, with rescale=1./255 and second time with v_h=1
when calling random erasing. Use default v_h=255
.
The following code will work
datagen = ImageDataGenerator( rescale=1/255, preprocessing_function=get_random_eraser(v_l=0, v_h=255, pixel_level=True))
Best regards,
Hello! Ah ok, that makes so much sense, I didn't pick up on that. THANK YOU! Success ![Uploading image.png…]()
Hi there,
I'm r eally happy with this code and the function, in order to deal with occlusion in my dataset. Howvwer, I can get the random_eraser function to work to produce the black boxes, but not with the randomised pixel from the image itself.
Here is the code I used:
When I plot 5 images from the data set, they still have these black boxes, even though I have set pixel_level=True (see image attached)
Does anyone have any ideas? I would be very grateful!