{"id":15890329,"url":"https://github.com/zjcv/ztransforms","last_synced_at":"2026-05-09T10:32:47.641Z","repository":{"id":57478602,"uuid":"328629881","full_name":"ZJCV/ZTransforms","owner":"ZJCV","description":"Implementation of torchvision-like based on albumentations","archived":false,"fork":false,"pushed_at":"2021-02-18T08:49:50.000Z","size":566,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-02T17:15:35.561Z","etag":null,"topics":["albumentations","data-augmentation","imgaug","opencv","pytorch","torchvision","transforms","vision"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZJCV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-11T10:39:18.000Z","updated_at":"2021-02-18T08:49:53.000Z","dependencies_parsed_at":"2022-09-17T04:42:31.206Z","dependency_job_id":null,"html_url":"https://github.com/ZJCV/ZTransforms","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZJCV%2FZTransforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZJCV%2FZTransforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZJCV%2FZTransforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZJCV%2FZTransforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZJCV","download_url":"https://codeload.github.com/ZJCV/ZTransforms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246856688,"owners_count":20844974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["albumentations","data-augmentation","imgaug","opencv","pytorch","torchvision","transforms","vision"],"created_at":"2024-10-06T07:05:13.081Z","updated_at":"2026-05-09T10:32:47.595Z","avatar_url":"https://github.com/ZJCV.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"right\"\u003e\n  Language:\n    🇺🇸\n  \u003ca title=\"Chinese\" href=\"README.zh-CN.md\"\u003e🇨🇳\u003c/a\u003e\n\u003c/div\u003e\n\n \u003cdiv align=\"center\"\u003e\u003ca title=\"\" href=\"https://github.com/ZJCV/ZTransforms.git\"\u003e\u003cimg align=\"center\" src=\"./imgs/ZTransforms.png\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  «ZTransforms» is an image data enhancement code base\n\u003cbr\u003e\n\u003cbr\u003e\n  \u003ca href=\"https://github.com/RichardLitt/standard-readme\"\u003e\u003cimg src=\"https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://conventionalcommits.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://commitizen.github.io/cz-cli/\"\u003e\u003cimg src=\"https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nbased on [pytorch/vision](https://github.com/pytorch/vision/) architecture，add [albumentations](https://github.com/albumentations-team/albumentations/tree/f2462be3a4d01c872474d0e7fc0f32f387b06340) as the backend\n\n* input image format：`numpy ndarray`\n* data type：`uint8`\n* channel arrangement order：`rgb`\n\ncritical dependencies's version:\n\n* `pytorch/vision:  c1f85d34761d86db21b6b9323102390834267c9b`\n* `albumentations-team/albumentations: v0.5.2`\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [Maintainers](#maintainers)\n- [Thanks](#thanks)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Background\n\n[PyTorch](https://github.com/pytorch/pytorch) provides an official data enhancement implementation：[transforms](https://github.com/pytorch/vision/tree/master/torchvision/transforms)。The module performs data enhancement operation based on PIL, and its advantages and disadvantages are as follows:\n\n* Advantages:\n  1.  Simple and clear data architecture\n  2.  Simple and understandable data processing flow\n  3. Perfect documentation introduction\n* Disadvantages:\n  1.  Based on the PIL backend, the provided image enhancement function is limited\n  2.  Compared with other implementations, the execution speed is not fast\n \n`torchvision` is also aware of this and has made improvements since \"0.8.0\"\n\n```\nPrior to v0.8.0, transforms in torchvision have traditionally been PIL-centric and presented multiple limitations due to that. Now, since v0.8.0, transforms implementations are Tensor and PIL compatible and we can achieve the following new features:\n\ntransform multi-band torch tensor images (with more than 3-4 channels)\ntorchscript transforms together with your model for deployment\nsupport for GPU acceleration\nbatched transformation such as for videos\nread and decode data directly as torch tensor with torchscript support (for PNG and JPEG image formats)\n```\n\n* On the one hand, the new backend [Pill-SIMD](https://github.com/uploadcare/Pill-SIMD) is used to improve the execution speed of PIL;\n* On the other hand, PyTorch backend is added to realize GPU acceleration\n\nTwo data enhancement libraries are found on the Internet, which provide detection/segmentation data enhancement in addition to classification data enhancement:\n\n* [imgaug](https://github.com/aleju/imgaug)：Which realizes more data enhancement operations；\n* [albumentations](https://github.com/albumentations-team/albumentations/tree/f2462be3a4d01c872474d0e7fc0f32f387b06340)：It finds out the fastest enhancement function in different backend (`pytorch/imgaug/opencv`) (refer to [benchmarking results](https://github.com/Albumentations-team/Albumentations#benchmarking-results))\n\nThe above two data enhancement libraries have realized the data flow operation mode similar to `transforms`。However, relatively speaking, I still like the official implementation and usage. Therefore, this code base is newly built, based on [transforms](https://github.com/pytorch/vision/tree/master/torchvision/transforms), the `albumentation` backend implementation is added to the original functions, and new data enhancement operations are also added (if `albumentation` is not implemented, use `imgaug/opencv/...` to implement it).\n\n## Install\n\n```\n$ pip install ztransforms\n```\n\n## Usage\n\n```\n# import torchvision.transforms as transforms\nimport ztransforms.cls as transforms\n...\n...\n```\n\n## Maintainers\n\n* zhujian - *Initial work* - [zjykzj](https://github.com/zjykzj)\n\n## Thanks\n\n* [pytorch/vision](https://github.com/pytorch/vision)\n* [albumentations-team/albumentations](https://github.com/albumentations-team/albumentations/tree/f2462be3a4d01c872474d0e7fc0f32f387b06340)\n* [aleju/imgaug](https://github.com/aleju/imgaug)\n* [opencv/opencv](https://github.com/opencv/opencv)\n\n```\n@Article{info11020125,\n    AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},\n    TITLE = {Albumentations: Fast and Flexible Image Augmentations},\n    JOURNAL = {Information},\n    VOLUME = {11},\n    YEAR = {2020},\n    NUMBER = {2},\n    ARTICLE-NUMBER = {125},\n    URL = {https://www.mdpi.com/2078-2489/11/2/125},\n    ISSN = {2078-2489},\n    DOI = {10.3390/info11020125}\n}\n\n@misc{imgaug,\n  author = {Jung, Alexander B.\n            and Wada, Kentaro\n            and Crall, Jon\n            and Tanaka, Satoshi\n            and Graving, Jake\n            and Reinders, Christoph\n            and Yadav, Sarthak\n            and Banerjee, Joy\n            and Vecsei, Gábor\n            and Kraft, Adam\n            and Rui, Zheng\n            and Borovec, Jirka\n            and Vallentin, Christian\n            and Zhydenko, Semen\n            and Pfeiffer, Kilian\n            and Cook, Ben\n            and Fernández, Ismael\n            and De Rainville, François-Michel\n            and Weng, Chi-Hung\n            and Ayala-Acevedo, Abner\n            and Meudec, Raphael\n            and Laporte, Matias\n            and others},\n  title = {{imgaug}},\n  howpublished = {\\url{https://github.com/aleju/imgaug}},\n  year = {2020},\n  note = {Online; accessed 01-Feb-2020}\n}\n```\n\n## Contributing\n\nAnyone's participation is welcome! Open an [issue](https://github.com/ZJCV/ZTransforms/issues) or submit PRs.\n\nSmall note:\n\n* Git submission specifications should be complied with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)\n* If versioned, please conform to the [Semantic Versioning 2.0.0](https://semver.org) specification\n* If editing the README, please conform to the[standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\n[Apache License 2.0](LICENSE) © 2021 zjykzj","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjcv%2Fztransforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzjcv%2Fztransforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjcv%2Fztransforms/lists"}