{"id":13648186,"url":"https://github.com/trevor-m/tensorflow-bicubic-downsample","last_synced_at":"2025-04-22T07:30:44.314Z","repository":{"id":153779611,"uuid":"133758943","full_name":"trevor-m/tensorflow-bicubic-downsample","owner":"trevor-m","description":"tf.image.resize_images has aliasing when downsampling and does not have gradients for bicubic mode. This implementation fixes those problems.","archived":false,"fork":false,"pushed_at":"2019-05-03T19:51:45.000Z","size":13,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-09T22:38:10.151Z","etag":null,"topics":["aliasing","bicubic","deep-learning","downsample","gradients","image-processing","image-resizing","images","resize-images","super-resolution","tensorflow"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trevor-m.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-17T04:30:29.000Z","updated_at":"2024-05-24T03:20:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbf5bc3b-44a8-4cc9-a122-cb047dba8156","html_url":"https://github.com/trevor-m/tensorflow-bicubic-downsample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevor-m%2Ftensorflow-bicubic-downsample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevor-m%2Ftensorflow-bicubic-downsample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevor-m%2Ftensorflow-bicubic-downsample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevor-m%2Ftensorflow-bicubic-downsample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trevor-m","download_url":"https://codeload.github.com/trevor-m/tensorflow-bicubic-downsample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250195033,"owners_count":21390230,"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":["aliasing","bicubic","deep-learning","downsample","gradients","image-processing","image-resizing","images","resize-images","super-resolution","tensorflow"],"created_at":"2024-08-02T01:04:02.611Z","updated_at":"2025-04-22T07:30:44.069Z","avatar_url":"https://github.com/trevor-m.png","language":"Python","readme":"# tensorflow-bicubic-downsample\ntf.image.resize_images has aliasing when downsampling and does not define gradients for bicubic mode. This implementation fixes those problems.\n\n# Example\nThese images have been downsampled by a factor of 4 from the original. The results from this code matches the scipy.misc.imresize results exactly.\n\nMethod | Result | Comments\n--- | --- | ---\nOriginal | \u003cimg src=\"https://user-images.githubusercontent.com/12981474/40157591-b5260abe-5954-11e8-8218-25ee937425ec.png\" width=\"200\"\u003e | This is the original full res image.\ntf.images.resize_images | \u003cimg src=\"https://user-images.githubusercontent.com/12981474/40157450-f247ee22-5953-11e8-9166-9bf979fb4363.png\" width=\"200\"\u003e | TF's implementation has aliasing\nscipy.misc.imresize | \u003cimg src=\"https://user-images.githubusercontent.com/12981474/40157452-f57d816a-5953-11e8-8e5a-85a591932e3d.png\" width=\"200\"\u003e | Proper bicubic downsampling\nThis code | \u003cimg src=\"https://user-images.githubusercontent.com/12981474/40157448-eff91f06-5953-11e8-9a37-f6b5693fa03f.png\" width=\"200\"\u003e | Matches scipy exactly\n\n# Usage\n```python\nfrom bicubic_downsample import build_filter, apply_bicubic_downsample\n\n# First, create the bicubic kernel. This can be reused in multiple downsample operations\nk = build_filter(factor=4)\n\n# Downsample x which is a tensor with shape [N, H, W, 3]\ny = apply_bicubic_downsample(x, filter=k, factor=4)\n\n# y now contains x downsampled to [N, H/4, W/4, 3]\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevor-m%2Ftensorflow-bicubic-downsample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrevor-m%2Ftensorflow-bicubic-downsample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevor-m%2Ftensorflow-bicubic-downsample/lists"}