{"id":18340902,"url":"https://github.com/tinyvision/ipcodec","last_synced_at":"2025-09-13T12:37:25.676Z","repository":{"id":150677167,"uuid":"511821296","full_name":"tinyvision/IPCodec","owner":"tinyvision","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-08T08:30:55.000Z","size":407,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T06:34:33.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tinyvision.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-08T08:30:23.000Z","updated_at":"2025-02-14T09:28:11.000Z","dependencies_parsed_at":"2023-08-29T04:33:51.419Z","dependency_job_id":null,"html_url":"https://github.com/tinyvision/IPCodec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tinyvision/IPCodec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FIPCodec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FIPCodec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FIPCodec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FIPCodec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinyvision","download_url":"https://codeload.github.com/tinyvision/IPCodec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FIPCodec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274961747,"owners_count":25381892,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-05T20:24:37.016Z","updated_at":"2025-09-13T12:37:25.652Z","avatar_url":"https://github.com/tinyvision.png","language":"Python","readme":"![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue)![Python \u003e=3.6](https://img.shields.io/badge/Python-\u003e=3.6-yellow.svg)\n![Tensorflow \u003e=1.12.0](https://img.shields.io/badge/Tensorflow-%3E1.12.0-orange)\n\n## Introduction\n\n\nIPCodec is an open source entropy-based compression toolbox with **tensorflow 1.12.0**, which contains Interpolation Variable Rate (IVR) I-frame and P-frame compression models.\n\n***\n## License\n\nThis project is developed by Alibaba and licensed under the [Apache 2.0 license](LICENSE).\n\n***\n## Installation\n\n### Prerequisites\n* Linux\n* Python 3.6+\n* tensorflow 1.12.0\n* CUDA 10.0+\n\n### Prepare environment\n1. Create a conda virtual environment and activate it.\n\n    ```shell\n    conda create -n tf12 python=3.6 -y\n    conda activate tf12\n    ```\n\n2. Install other packages with the following command.\n\n    ```shell\n    pip install -r requirements.txt\n    ```\n\n***\n## Easy to use\nUse the [checkpoint/download.sh](checkpoint/download.sh) to download all pretrained models.\n```shell\ncd checkpoint\nsh download.sh\n```\n### Train or test for image compression\n\n  - If not use Unet post network, set is_post to False.\n  - Download [Kodak](http://r0k.us/graphics/kodak/) test image to `dataset/kodak`\n\n  ```shell\n  python I_train.py/I_test.py --loss_metric PSNR --model_name CM \\\n  --is_post True  --with_context_model True  --is_multi True\n\n  python I_train.py/I_test.py --loss_metric SSIM --model_name CM \\\n  --is_post True  --with_context_model True  --is_multi True\n\n  python I_train.py/I_test.py --loss_metric PSNR --model_name NoCM \\\n  --is_post False  --with_context_model False  --is_multi True\n  ```\n\n### Train or test for video compression\n\n  - If not use Unet post network, set is_post to False.\n  - Convert video to PNG images to `test_set_dir` in `IP_config.py`.\n  - `IP_test_multi.py` is the Multi videos processing script, need to carefully use it since the model_path is changed.\n\n  ```shell\n  python IP_train.py/IP_test.py --loss_metric PSNR --model_name STPM \\\n  --is_post True  --with_context_model True  --is_multi True --ckpt_dir_pre ./checkpoint/I_model/CM_PSNR  --idx_test 0\n\n  python IP_train.py/IP_test.py --loss_metric SSIM --model_name STPM \\\n  --is_post True  --with_context_model True  --is_multi True --ckpt_dir_pre ./checkpoint/I_model/CM_SSIM  --idx_test 0\n\n  python IP_train.py/IP_test.py --loss_metric PSNR --model_name NoSPM \\\n  --is_post True  --with_context_model False  --is_multi True --ckpt_dir_pre ./checkpoint/I_model/CM_PSNR  --idx_test 0\n  \n  python IP_train.py/IP_test.py --loss_metric SSIM --model_name NoSPM \\\n  --is_post True  --with_context_model False  --is_multi True --ckpt_dir_pre ./checkpoint/I_model/CM_SSIM  --idx_test 0\n  ```\n\n***\n## Results\n### Results for I-frame compression (Image compression) on Kodak Dataset.\n![result](dataset/results/Kodak_MSSSIM.jpg)\n![result](dataset/results/Kodak_MSE.jpg)\n### Results for P-frame compression (Video compression) on MCL-JCV, UVG, HEVC-ClassB Dataset.\n![result](dataset/results/MCL_MSSSIM.jpg)\n![result](dataset/results/UVG_MSSSIM.jpg)\n![result](dataset/results/HB_MSSSIM.jpg)\n![result](dataset/results/MCL_MSE.jpg)\n![result](dataset/results/UVG_MSE.jpg)\n![result](dataset/results/HB_MSE.jpg)\n\n**Note**:\nIf you find this useful, please support us by citing the following paper.\n```\n@inproceedings{ivr,\n  title={Interpolation variable rate image compression},\n  author={Sun, Zhenhong and Tan, Zhiyu and Sun, Xiuyu and Zhang, Fangyi and Qian, Yichen and Li, Dongyang and Li, Hao},\n  booktitle={Proceedings of the 29th ACM International Conference on Multimedia},\n  pages={5574--5582},\n  year={2021}\n}\n```\n```\n@article{sun2021spatiotemporal,\n  title={Spatiotemporal Entropy Model is All You Need for Learned Video Compression},\n  author={Sun, Zhenhong and Tan, Zhiyu and Sun, Xiuyu and Zhang, Fangyi and Li, Dongyang and Qian, Yichen and Li, Hao},\n  journal={arXiv preprint arXiv:2104.06083},\n  year={2021}\n}\n```\n\n\n***\n## Main Contributors\n\n[Zhenhong Sun](https://sites.google.com/view/sunzhenhong),[Dongyang Li](https://scholar.google.com.hk/citations?user=ko3eGS0AAAAJ), [Xiuyu Sun](https://sites.google.com/view/sunxiuyu).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyvision%2Fipcodec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyvision%2Fipcodec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyvision%2Fipcodec/lists"}