Color Space Transformation

Guys, Is There a way to convert color spaces in fastai ?

Especially I want to convert RGB space to YUV space for a image classification project ?

Is there a direct way or do i have to make a custom transformer ?

I am not aware of a fastai implementation but you will find differentiable pytorch version of those conversions in torchgeometry :slight_smile:


Oh it’s awesome :slight_smile: , But Does Not contain the YUV space

Thanks for the suggestion

Did some digging and found this (Contains several spaces including YUV)

But I think it will take some work to make a DataBunch :sweat_smile:

If you’re using v2 it shouldn’t be too bad at all actually. Look into PILImage (if you feel like jumping in)

I did something smilar before. I am not sure this is what you want to do.


It Looks Interesting :star_struck:

But I’m Still On Lesson 3 , But I will Definitely give it a look when time comes

Thank You

I’m Using v1,

But can You elaborate what you meant by that

Thank You :slight_smile:

v2 makes utilizing your own data very easy, and creating a custom image class you’re using is very very simplistic. (Also in July this will be merged into the fastai library so it’ll be the new go-to).

The PILImage is here:

I’d recommend watching Jeremy’s code walkthroughs to understand the nitty gritty like that, otherwise I have a study group currently running where we explore it (and is a good way to learn v2 until the v4 of the course goes live in July)

That’s Interesting

Thank You