CompressAI是什么:
调用编码器
python examples/codec.py encode D:\VCM\CompressAI-master\input\input.jpg -f 1 --model cheng2020-anchor
调用解码器
python examples/codec.py decode D:\VCM\CompressAI-master\input.bin -o D:\VCM\CompressAI-master\out\out.jpg
评估预训练编码器的性能
python -m compressai.utils.eval_model pretrained D:\VCM\CompressAI-master\input -a cheng2020-anchor -q 2
input -a cheng2020-anchor -q 2
{
"name": "cheng2020-anchor",
"description": "Inference (ans)",
"results": {
"psnr": [
29.59088579241053
],
"ms-ssim": [
0.9556650519371033
],
"bpp": [
0.19759615384615384
],
"encoding_time": [
5.068420171737671
],
"decoding_time": [
9.750147819519043
]
}
}
compressai\zoo\image 里面有预训练模型的下载地址和对应代码
model_architectures = {
"bmshj2018-factorized": FactorizedPrior,
"bmshj2018-hyperprior": ScaleHyperprior,
"mbt2018-mean": MeanScaleHyperprior,
"mbt2018": JointAutoregressiveHierarchicalPriors,
"cheng2020-anchor": Cheng2020Anchor,
"cheng2020-attn": Cheng2020Attention,
}
其对应代码在compressai.models里面,通过链接可以找到。前4个在google.py里,后两个在waseda.py里
版权声明:本文为ymy_ymy22原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。