tohinz/ConSinGAN

Suggest to loosen the dependency on albumentations

Opened this issue · 0 comments

Hi, your project ConSinGAN requires "albumentations==0.4.3" in its dependency. After analyzing the source code, we found that some other versions of albumentations can also be suitable without affecting your project, i.e., albumentations 0.4.4, 0.4.5. Therefore, we suggest to loosen the dependency on albumentations from "albumentations==0.4.3" to "albumentations>=0.4.3,<=0.4.5" to avoid any possible conflict for importing more packages or for downstream projects that may use ConSinGAN.

May I pull a request to loosen the dependency on albumentations?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



For your reference, here are details in our analysis.

Your project ConSinGAN(commit id: 8b4681f) directly uses 11 APIs from package albumentations.

albumentations.augmentations.transforms.Cutout.__init__, albumentations.augmentations.transforms.ChannelShuffle.__init__, albumentations.core.composition.Compose.__init__, albumentations.augmentations.transforms.ToSepia.__init__, albumentations.augmentations.transforms.MultiplicativeNoise.__init__, albumentations.imgaug.transforms.IAAAdditiveGaussianNoise.__init__, albumentations.augmentations.transforms.InvertImg.__init__, albumentations.augmentations.transforms.HueSaturationValue.__init__, albumentations.augmentations.transforms.ChannelDropout.__init__, albumentations.core.composition.OneOf.__init__, albumentations.augmentations.transforms.GaussNoise.__init__

From which, 14 functions are then indirectly called, including 12 albumentations's internal APIs and 2 outsider APIs, as follows (neglecting some repeated function occurrences).

[/tohinz/ConSinGAN]
+--albumentations.augmentations.transforms.Cutout.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
|      +--warnings.warn
+--albumentations.augmentations.transforms.ChannelShuffle.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.core.composition.Compose.__init__
|      +--albumentations.core.composition.BaseCompose.__init__
|      |      +--albumentations.core.composition.Transforms.__init__
|      |      |      +--albumentations.core.composition.Transforms._find_dual_start_end
|      |      |      |      +--albumentations.core.composition.Transforms._find_dual_start_end
|      +--albumentations.augmentations.bbox_utils.BboxProcessor.__init__
|      |      +--albumentations.core.utils.DataProcessor.__init__
|      +--albumentations.core.composition.BboxParams.__init__
|      |      +--albumentations.core.utils.Params.__init__
|      +--albumentations.augmentations.keypoints_utils.KeypointsProcessor.__init__
|      |      +--albumentations.core.utils.DataProcessor.__init__
|      +--albumentations.core.composition.KeypointParams.__init__
|      |      +--albumentations.core.utils.Params.__init__
|      +--albumentations.core.composition.BaseCompose.add_targets
+--albumentations.augmentations.transforms.ToSepia.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
|      +--numpy.matrix
+--albumentations.augmentations.transforms.MultiplicativeNoise.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
|      +--albumentations.core.transforms_interface.to_tuple
+--albumentations.imgaug.transforms.IAAAdditiveGaussianNoise.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
|      +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.InvertImg.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.HueSaturationValue.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
|      +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.ChannelDropout.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.core.composition.OneOf.__init__
|      +--albumentations.core.composition.BaseCompose.__init__
+--albumentations.augmentations.transforms.GaussNoise.__init__
|      +--albumentations.core.transforms_interface.BasicTransform.__init__

We scan albumentations's versions among [0.4.4, 0.4.5] and 0.4.3, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 0.4.3(original) 0.4.4
['albumentations.augmentations.transforms.GridDropout', 'albumentations.core.composition.PerChannel', 'albumentations.core.composition.OneOf', 'albumentations.augmentations.transforms.GridDropout.apply', 'albumentations.augmentations.transforms.RandomSizedBBoxSafeCrop', 'albumentations.augmentations.transforms.GridDropout.targets_as_params', 'albumentations.augmentations.transforms.FancyPCA', 'albumentations.augmentations.transforms.FancyPCA.get_params', 'albumentations.core.composition.OneOf.__call__', 'albumentations.augmentations.transforms.GridDropout.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.Lambda', 'albumentations.augmentations.transforms.Cutout', 'albumentations.augmentations.transforms.GlassBlur.targets_as_params', 'albumentations.augmentations.functional.gamma_transform', 'albumentations.augmentations.functional.glass_blur', 'albumentations.augmentations.transforms.RandomGamma.__init__', 'albumentations.augmentations.transforms.GridDropout.__init__', 'albumentations.augmentations.transforms.FancyPCA.__init__', 'albumentations.augmentations.transforms.Cutout.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.RandomSizedBBoxSafeCrop.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.RandomGamma.apply', 'albumentations.augmentations.functional.fancy_pca', 'albumentations.augmentations.transforms.GlassBlur.__init__', 'albumentations.core.composition.PerChannel.__call__', 'albumentations.augmentations.transforms.Lambda.__init__', 'albumentations.augmentations.functional.clahe', 'albumentations.augmentations.transforms.RandomGamma', 'albumentations.augmentations.transforms.FancyPCA.get_transform_init_args_names', 'albumentations.augmentations.bbox_utils.convert_bbox_to_albumentations', 'albumentations.augmentations.transforms.GridDropout.get_transform_init_args_names', 'albumentations.augmentations.transforms.GlassBlur.apply', 'albumentations.augmentations.transforms.FancyPCA.apply', 'albumentations.augmentations.transforms.GlassBlur.get_transform_init_args_names', 'albumentations.augmentations.bbox_utils.denormalize_bbox', 'albumentations.augmentations.transforms.GridDropout.apply_to_mask', 'albumentations.augmentations.transforms.GlassBlur.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.GlassBlur']

diff: 0.4.3(original) 0.4.5
['albumentations.augmentations.transforms.GridDropout', 'albumentations.core.composition.PerChannel', 'albumentations.core.composition.OneOf', 'albumentations.augmentations.transforms.GridDropout.apply', 'albumentations.augmentations.transforms.RandomSizedBBoxSafeCrop', 'albumentations.augmentations.transforms.GridDropout.targets_as_params', 'albumentations.augmentations.transforms.FancyPCA', 'albumentations.augmentations.transforms.FancyPCA.get_params', 'albumentations.core.composition.OneOf.__call__', 'albumentations.augmentations.transforms.GridDropout.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.Lambda', 'albumentations.augmentations.transforms.Cutout', 'albumentations.augmentations.transforms.GlassBlur.targets_as_params', 'albumentations.augmentations.functional.gamma_transform', 'albumentations.augmentations.functional.glass_blur', 'albumentations.augmentations.transforms.RandomGamma.__init__', 'albumentations.augmentations.transforms.GridDropout.__init__', 'albumentations.augmentations.transforms.FancyPCA.__init__', 'albumentations.augmentations.transforms.Cutout.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.RandomSizedBBoxSafeCrop.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.RandomGamma.apply', 'albumentations.augmentations.functional.fancy_pca', 'albumentations.augmentations.transforms.GlassBlur.__init__', 'albumentations.core.composition.PerChannel.__call__', 'albumentations.augmentations.transforms.Lambda.__init__', 'albumentations.augmentations.functional.clahe', 'albumentations.augmentations.transforms.RandomGamma', 'albumentations.augmentations.transforms.FancyPCA.get_transform_init_args_names', 'albumentations.augmentations.bbox_utils.convert_bbox_to_albumentations', 'albumentations.augmentations.transforms.GridDropout.get_transform_init_args_names', 'albumentations.augmentations.transforms.GlassBlur.apply', 'albumentations.augmentations.transforms.FancyPCA.apply', 'albumentations.augmentations.transforms.GlassBlur.get_transform_init_args_names', 'albumentations.augmentations.bbox_utils.denormalize_bbox', 'albumentations.augmentations.transforms.GridDropout.apply_to_mask', 'albumentations.augmentations.transforms.GlassBlur.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.GlassBlur']

As for other packages, the APIs of @outside_package_name are called by albumentations in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on albumentations from "albumentations==0.4.3" to "albumentations>=0.4.3,<=0.4.5". This will improve the applicability of ConSinGAN and reduce the possibility of any further dependency conflict with other projects/packages.