Skip to content

Commit ddafec9

Browse files
committed
add readme
1 parent af6ba34 commit ddafec9

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Readme.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
# FlashGMM
2+
3+
<p align="center">
4+
<img src="assets/flashgmm.jpg" alt="FlashGMM Logo" width="400">
5+
</p>
6+
7+
FlashGMM is a fast implementation of Gaussian Mixture Model (GMM) based image compression in PyTorch. The codes are based on the [CompressAI](https://github.com/InterDigitalInc/CompressAI/) library.
8+
9+
# Installation
10+
We tested FlashGMM on Python 3.10, Pytorch 2.2.2, CUDA 12.1 and GCC 11.4.0.
11+
12+
First, clone the repository and install the required packages:
13+
14+
```bash
15+
git clone *the repository URL*
16+
cd FlashGMM
17+
pip install -r requirements.txt
18+
```
19+
20+
To compile the C++ extensions, run:
21+
22+
```bash
23+
python setup.py develop
24+
```
25+
26+
# Usage
27+
The core implementation of our FlashGMM is in `compressai/cpp_exts/rans/rans_interface.cpp` and `compressai/entropy_models/entropy_models.py`. The model code used in the experiment can be found in `compressai.models.ckbd_gmm.Cheng2020AnchorCheckerboardGMMv2`.
28+
29+
To train the model, you can use the provided training script. For example:
30+
31+
```bash
32+
python3 train_ckbd_gmm.py --cuda -d /path/to/dataset
33+
--N 192 --K 4 --lambda 0.0035 --epochs 150 --learning-rate 1e-4 --lr_epoch 120 140 145 --batch-size 16 \
34+
--save_path /path/to/log --patch-size 256 256 \
35+
--kodak_path /path/to/kodak
36+
```
37+
38+
The pre-trained weights will be available soon.
39+
40+
For evaluation, run
41+
42+
```bash
43+
python3 eval.py --data /path/to/kodak --cuda \
44+
--checkpoint /path/to/checkpoint --real\
45+
```
46+
47+
The following is the original Readme of CompressAI:
48+
49+
150
<!-- ![ID-CompressAI-logo](assets/ID-compressAI-logo-750x140.svg =750x140) -->
251
<a href="url"><img src="docs/source/_static/logo.svg" align="center"></a>
352

assets/flashgmm.jpg

231 KB
Loading

0 commit comments

Comments
 (0)