- Install the torch, torchvision and some other requirements:
pip install torch torchvision tqdm Pillow scipy
.{CURRET_PATH}
├── Dataset
│ ├── demo_images
│ └── cityscapes
├── encoding
│ ├── models
│ └── datasets
├── train_and_eval
│ ├── test.py
│ ├── demo.py
│ └── color_q4_results
-
[QFPN(ResNet18)] (encoding/models/fpnQ.py)
-
[quantize files] (encoding/models/quantize.py & encoding/models/sim_bn_foldto_conv.py)
- [float] (encoding/weight/float.pth.tar)
- [4bit] (encoding/weight/q4/q6240.pth.tar)
cd train_and_eval
sh run_demo_quantize.sh
cd train_and_eval
sh run_eval_quantize.sh
Input size | A/W bit | mIoU(val) | FLOPs |
---|---|---|---|
256 * 512 | float | 62.9% | 10G |
256 * 512 | 4/4 | 62.0% | 10G |