Applying transformations to images in a folder and save them as a new folder

Hi all,
I kindly expect your help on this. This may be a silly question, since I am new here.

1. I already have an image data set comprised of six classes(separate folders) uploaded to my notebook.
I want to apply all kind of transformations such as

do_flip, flip_vert, max_rotate, max_zoom, max_lighting, max_warp, zoom_crop, rand_resize_crop, brightness , contrast, crop_pad, dihedral, pad etc.

and save in separate folders.

2. When I apply transform during data_bunch creation, I could not include the transforms such as zoom_crop together with the other transforms such as flip_vert . It returns error. I could not understand it. Please help me. Here is my code.
tfms = get_transforms( do_flip = True,
flip_vert = True, max_rotate = 60.0, max_zoom = 1.1,
max_lighting = 0.2, max_warp = 0.2, p_affine = 0.75, p_lighting = 0.75)

Thanks for helping me.

1 Like

Hey @Anuraaj, I am on the way to work so cannot answer your questions fully but I have been working on transformations and saving images to different folders (with respect to results from a confusion matrix).

You can view on this thread Visual GUI or my github page

Hope that helps!

Hi @amritv thanks for helping. I will take a look at the suggested links and get back here. :blush:

Hi @amritv I have cloned your Vision_UI found in github and ran the notebook 01_UI_Fastai. But when I click choose folder the following error was returned. Anything should I include further?

@Anuraaj do you have ipywidgets installed as per install instructions?

@amritv I don’t have those. Can you please guide me towards it.

Try one of these:

  • ipywidgets

pip install ipywidgets jupyter nbextension enable --py widgetsnbextension


conda install -c conda-forge ipywidgets

@amritv I am trying that and once done, will get back to you. Thanks.

1 Like

@amritv I did install ipywidgets usin pip install (conda install was returning an error and could not install that way) but still the same issue is there.

Not sure about your environment setup:

Try adding this

import matplotlib

Or have a look here

Sorry for the late response. Was out of access.
Thanks, I will try this.

1 Like

Hey @Anuraaj - checking to see if you are still getting the error? BTW were you using Colab as I got the same error when I was working on getting vision UI to work on Colab. The issue was with the incompatibility of tkinter and colab.

I have however worked on a colab friendly one here Let me know if this works for you.

1 Like

Hi @amritv sorry for the late reply.
I am working on GCP not Colab. Thanks for letting me know that.

1 Like