Hi, your project image_seg requires "albumentations==0.5.2" in its dependency. After analyzing the source code, we found that the following versions of albumentations can also be suitable without affecting your project, i.e., albumentations 0.5.1. Therefore, we suggest to loosen the dependency on albumentations from "albumentations==0.5.2" to "albumentations>=0.5.1,<=0.5.2" to avoid any possible conflict for importing more packages or for downstream projects that may use image_seg.
May I pull a request to further 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?
We also give our detailed analysis as follows for your reference:
Your project image_seg directly uses 22 APIs from package albumentations.
albumentations.augmentations.transforms.ElasticTransform.__init__, albumentations.augmentations.transforms.MotionBlur.__init__, albumentations.augmentations.transforms.Resize.__init__, albumentations.pytorch.transforms.ToTensorV2.__init__, albumentations.augmentations.transforms.CLAHE.__init__, albumentations.augmentations.transforms.PadIfNeeded.__init__, albumentations.augmentations.transforms.RandomRotate90.__init__, albumentations.augmentations.transforms.RandomCrop.__init__, albumentations.augmentations.transforms.Normalize.__init__, albumentations.augmentations.transforms.Cutout.__init__, albumentations.augmentations.transforms.RandomBrightnessContrast.__init__, albumentations.augmentations.transforms.GridDropout.__init__, albumentations.augmentations.transforms.RGBShift.__init__, albumentations.core.composition.Compose.__init__, albumentations.augmentations.transforms.RandomGamma.__init__, albumentations.augmentations.transforms.HueSaturationValue.__init__, albumentations.augmentations.transforms.ShiftScaleRotate.__init__, albumentations.core.transforms_interface.DualTransform.__init__, albumentations.augmentations.transforms.VerticalFlip.__init__, albumentations.augmentations.transforms.GaussNoise.__init__, albumentations.augmentations.transforms.HorizontalFlip.__init__, albumentations.augmentations.transforms.RandomScale.__init__
Beginning from the 22 APIs above, 14 functions are then indirectly called, including 13 albumentations's internal APIs and 1 outsider APIs. The specific call graph is listed as follows (neglecting some repeated function occurrences).
[/whut2962575697/image_seg]
+--albumentations.augmentations.transforms.ElasticTransform.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.MotionBlur.__init__
| +--albumentations.augmentations.transforms.Blur.__init__
| | +--albumentations.core.transforms_interface.BasicTransform.__init__
| | +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.Resize.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.pytorch.transforms.ToTensorV2.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.CLAHE.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.PadIfNeeded.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.RandomRotate90.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.RandomCrop.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.Normalize.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.Cutout.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--warnings.warn
+--albumentations.augmentations.transforms.RandomBrightnessContrast.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.GridDropout.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.RGBShift.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
+--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.RandomGamma.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.HueSaturationValue.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
+--albumentations.augmentations.transforms.ShiftScaleRotate.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
+--albumentations.core.transforms_interface.DualTransform.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.VerticalFlip.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.GaussNoise.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.HorizontalFlip.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
+--albumentations.augmentations.transforms.RandomScale.__init__
| +--albumentations.core.transforms_interface.BasicTransform.__init__
| +--albumentations.core.transforms_interface.to_tuple
We scan albumentations's versions and observe that during its evolution between any version from [0.5.1] and 0.5.2, 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.5.2(original) 0.5.1
['albumentations.augmentations.transforms.MedianBlur', 'albumentations.augmentations.transforms.CropNonEmptyMaskIfExists.targets_as_params', 'albumentations.augmentations.transforms.GaussianBlur', 'albumentations.augmentations.transforms.CropNonEmptyMaskIfExists.update_params', 'albumentations.pytorch.transforms.ToTensorV2', 'albumentations.pytorch.transforms.ToTensorV2.apply', 'albumentations.augmentations.transforms.CropNonEmptyMaskIfExists.get_params_dependent_on_targets', 'albumentations.augmentations.transforms.CropNonEmptyMaskIfExists', 'albumentations.augmentations.transforms.CropNonEmptyMaskIfExists._preprocess_mask']
As for other packages, the APIs of warnings 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.5.2" to "albumentations>=0.5.1,<=0.5.2". This will improve the applicability of image_seg and reduce the possibility of any further dependency conflict with other projects.