Addons: Implement Image functions

Created on 18 Jan 2019  路  27Comments  路  Source: tensorflow/addons

Per the RFC, we will be moving several of the image modules from contrib to addons:

  • [x] dense_image_warp
  • [x] random_hsv_in_yiq
  • [x] adjust_hsv_in_yiq
  • [x] rotate
  • [x] translate
  • [x] angle_to_projective_transforms
  • [x] translations_to_projective_transforms
  • [x] transform
  • [x] compose_transforms
  • [x] flat_transforms_to_matricies
  • [x] connected_components
  • [x] sparse_image_warp

This will involve moving the code base and modifying test cases to run in TF2.

good first issue help wanted image

Most helpful comment

Can we also add sparse_image_warp to this list? It has been requested by one of the engineering teams internally, as well as several folks externally. :slightly_smiling_face:

All 27 comments

Cool i will began with this then :)

@tabshaikh Thanks, Tabish. Don't put all in one PR. You can solve those functions one by one, say, rotate at first.

Okay sure

@tabshaikh Hi, Tabish. Which op are you working on?

I have started with rotate

Hi @tabshaikh, I'm going to work on dense_image_warp and I hope that you have not started on this one.

Is anyone working on connected_components? If not I will start with it?

@hksonngan Great, go head! All contributions are welcome, thanks :-)

@seanpmorgan i was just checking random_hsv_in_yiq does not have any tests in contrib https://github.com/tensorflow/tensorflow/search?q=random_hsv_in_yiq&unscoped_q=random_hsv_in_yiq ?

@tabshaikh Yeah, Tabish, thanks for bring this to our attention
, that's a problem indeed. I think @WindQAQ are working on random_hsv_in_yiq in #67.

At the first glance, it seems that test_adjust_random_value_in_yi are used for both random_hsv_in_yiq and adjust_hsv_in_yiq implicitly:
https://github.com/tensorflow/addons/pull/67/files#diff-9e079d46248934679daeb7fd5f3a5835R71

I create an issue #83 to discuss about unit test. And I think we should increase the qualities of test cases, and also make them as simple & clear as possible.

I have a random question. It seems that tf.keras.preprocessing.image.random_rotation() is not deprecated but tf.contrib.image.rotate() is being deprecated? It seems strange that a specific case ("a random rotation of a Numpy image tensor") is maintained but a useful but slightly more general tensor function is being pushed into addons. I guess the only thing to do is implement rotate() here and then hope for its eventual inclusion back upstream?

edit: I should add that my goal is to figure out the cleanest way to do rotational data augmentation in tf 2.0.

Is anybody working on "translations_to_projective_transforms"? If not, can I get some pointers on how to start?

@shreyashub is looks like "translate" is connected to this as well. I think it is easy to do this in one go :)

I have a random question. It seems that tf.keras.preprocessing.image.random_rotation() is not deprecated but tf.contrib.image.rotate() is being deprecated? It seems strange that a specific case ("a random rotation of a Numpy image tensor") is maintained but a useful but slightly more general tensor function is being pushed into addons. I guess the only thing to do is implement rotate() here and then hope for its eventual inclusion back upstream?

_edit_: I should add that my goal is to figure out the cleanest way to do rotational data augmentation in tf 2.0.

@kyleabeauchamp This is a fair comment. We have not yet worked out the process of things moving from addons to core -- though this may be a good candidate when we do.

Can we also add sparse_image_warp to this list? It has been requested by one of the engineering teams internally, as well as several folks externally. :slightly_smiling_face:

Added. It was excluded for no OSS usage not for any compatibility issues so if there's a demand then it works well in the subpackage.

Added. It was excluded for no OSS usage not for any compatibility issues so if there's a demand then it works well in the subpackage.

Awesome! Thanks, Sean. :+1:

I would like working on the image translate ops if anyone is not working on it. If anyone is not working I would like to get started.

@shreyashub, hi Shreyas, are you working on translations_to_projective_transforms? If you haven't start with translate ops, could you let @sayoojbk take it over? Thank you!

I was under the impression @Smokrow was doing it. I'm sorry if it appeared if I would take on the job. Please @sayoojbk, feel free to start working on it.

is anyone working on sparse_image_warp implementation? If not would be interested in moving forward with it.

It's already being worked on and is mostly finished: https://github.com/tensorflow/addons/pull/252

Okk cool didn't see anyone take up this issue in this thread should have checked the PR's. My bad :P. Well if anyone is not working on the connected components sub-module would like to give a try on that !

Okk cool didn't see anyone take up this issue in this thread should have checked the PR's. My bad :P. Well if anyone is not working on the connected components sub-module would like to give a try on that !

That would be great... thanks @sayoojbk !

Hey @sayoojbk. Any update on connected components?

@Squadrick Done with most of the stuff . just need to finish writing the test script. Sorry was busy for a while will try my best to complete it as soon as possible.

I would like to contribute scale and shear operations, along with the *_to_projective_transforms functions. This way we will cover all common projective transforms used in augmentation pipelines.

It may be worthwhile to also include the all-in-one projective transform, like scale_shift_shear_rotate, that would be based on composition to be more computationally efficient.

Also, maybe we can include the random_* operations (random_rotate, random_shear etc.). I can work on them as well.

All those ops would be very useful in image augmentation pipeline.

Cheers!

Was this page helpful?
0 / 5 - 0 ratings