{ "info": { "author": "Yu Zhiyang", "author_email": "yuzhiyang@hit.edu.cn", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# opencv_torchvision_transform\n1) This is an opencv based rewriting of the \"transforms\" in torchvision [package](https://github.com/pytorch/vision/tree/master/torchvision/transforms). \n\n2) All functions depend on only cv2 and pytorch (PIL-free). As the [article](https://www.kaggle.com/vfdev5/pil-vs-opencv) says, cv2 is three times faster than PIL.\n\n3) Most functions in transforms are reimplemented, except that:\n\n 1) ToPILImage(opencv we used :)), Scale and RandomSizedCrop which are deprecated in the original version are ignored.\n\n 2) The affine transform in the original one only has 5 degrees of freedom, I implement an Affine transform with 6 degress of freedom called RandomAffine6(can be found in master/cvtorchvision/cvtransforms/cvtransforms.py). The original method(RandomAffine) is still retained and reimplemented with opencv.\n 3) My rotate function is clockwise, however the original one is anticlockwise.\n 4) Adding some new methods which can be found in **Support**(the bolded ones).\n 4) **All the outputs of the opencv version are almost the same as the original one's(test in master/cvtorchvision/cvtransforms/cvfunctional.py: if __name__ == '__main__':...)**.\n## Support:\n* Compose, ToTensor, ToCVImage, Normalize\n\n* Resize, CenterCrop, Pad\n\n* Lambda(doesn't work well in multiprocess in wihdows)\n\n* RandomApply, RandomOrder, RandomChoice, RandomCrop,\n\n* RandomHorizontalFlip, RandomVerticalFlip, RandomResizedCrop,\n\n* FiveCrop, TenCrop, LinearTransformation, ColorJitter,\n\n* RandomRotation, RandomAffine, **RandomAffine6**, **RandomPerspective**\n\n* **RandomGaussianNoise\"**, **\"RandomPoissonNoise\"**, **\"RandomSPNoise**\n\n* Grayscale, RandomGrayscale\n# How to use:\n1) git clone https://github.com/YU-Zhiyang/opencv_torchvision_transforms.git .\n\n2) Add cvtorchvision to your python path.\n\n3) Add \"from cvtorchvision import cvtransforms\" in your pythion file.\n\n4) You can use all functions as the original version, for example:\n\n transform = cvtransforms.Compose([\n\n cvtransforms.RandomAffine(degrees=10, translate=(0.1, 0.1), scale=(0.9, 1.1), shear=(-10, 0),\n\n cvtransforms.Resize(size=(350, 350), interpolation='BILINEAR'),\n\n cvtransforms.ToTensor(),\n\n cvtransforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),\n ])\n\nmore details can be found in the examples of official [tutorials](https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html).\n\n# Attention: \nThe multiprocessing used in dataloader of pytorch is not friendly with lambda function in Windows as lambda function can't be pickled (https://docs.python.org/3/library/pickle.html#what-can-be-pickled-and-unpickled).\n\nSo the Lambda in cvtransform.py may not work properly in Windows.\n\n# Requirements\npython >=3.5.2\n\nnumpy >=1.10 ('@' operator may not be overloaded before this version)\n\npytorch>=0.4.1\n\ntorchvision>=0.2.1\n\nopencv-contrib-python-3.4.2 (test with this version, but any version of opencv3 is ok, I think)\n\n# Postscript\nWelcome to point out and help to fix bugs !\n\nWatches, Stars and Forks won\u9225\u6a9b be rejected :smile:\n\nThanks [HongChu](https://github.com/hongchu098) who helps a lot.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/YU-Zhiyang/opencv_transforms_torchvision", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "opencv-torchvision-transforms-yuzhiyang", "package_url": "https://pypi.org/project/opencv-torchvision-transforms-yuzhiyang/", "platform": "", "project_url": "https://pypi.org/project/opencv-torchvision-transforms-yuzhiyang/", "project_urls": { "Homepage": "https://github.com/YU-Zhiyang/opencv_transforms_torchvision" }, "release_url": "https://pypi.org/project/opencv-torchvision-transforms-yuzhiyang/0.0.1/", "requires_dist": [ "numpy (>=1.10)", "torchvision (>=0.2.1)", "opencv-contrib-python (>=3.4.2)" ], "requires_python": "", "summary": "an opencv based rewriting of the \"transforms\" in torchvision package", "version": "0.0.1" }, "last_serial": 5405851, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4730125e2049eebafd310ce93d8be18d", "sha256": "67f793d6d9d368b9a4c6fbfff517ad86c59606174caeafb3f2695b0406ba4e20" }, "downloads": -1, "filename": "opencv_torchvision_transforms_yuzhiyang-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4730125e2049eebafd310ce93d8be18d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21529, "upload_time": "2019-06-16T07:37:27", "url": "https://files.pythonhosted.org/packages/c2/cc/49c7801943377c2c20c2bcb538ce53fd684cfcc270e749b24b89cd931cfc/opencv_torchvision_transforms_yuzhiyang-0.0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4730125e2049eebafd310ce93d8be18d", "sha256": "67f793d6d9d368b9a4c6fbfff517ad86c59606174caeafb3f2695b0406ba4e20" }, "downloads": -1, "filename": "opencv_torchvision_transforms_yuzhiyang-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4730125e2049eebafd310ce93d8be18d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21529, "upload_time": "2019-06-16T07:37:27", "url": "https://files.pythonhosted.org/packages/c2/cc/49c7801943377c2c20c2bcb538ce53fd684cfcc270e749b24b89cd931cfc/opencv_torchvision_transforms_yuzhiyang-0.0.1-py3-none-any.whl" } ] }