-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compressed binary file size #6
Comments
我已收到你的邮件。 by 钱一琛
|
你好,我也遇到同样的问题,原始图像593K, 压缩获得的 .bin 文件大小竟然为1.13M, 麻烦请教下,这个是什么原因呢? |
我也发生类似情况。但是我认为可能是使用的图片本身就已经被压缩过。您可以查看一下您的图片分辨率和位深大小,计算一下是否与您图片的存储大小对的上。一般存储大小都远小于理论计算得到的大小,说明已经是被压缩过的。而程序里读入图像的数据大小仍旧为分辨率乘以位深。 |
程序里计算bpp 应该是读取.bin文件的大小,然后除总像素数。 与图像压缩应该没关系吧。十分感谢您的来信,期待交流。<br/><br/><br/><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="ntes-mailmaster-quote" style="padding-top: 1px; padding-bottom: 1px" >
<div style=" margin-top: 20px; margin-bottom: 12px; font-size: 14px; line-height: 1.25; color: #89898c; " >---- 回复的原邮件 ----</div>
<div style=" margin-bottom: 12px; font-size: 13px; line-height: 1.25; color: #2c2c2e; padding: 2px; border-radius: 8px; background-color: #f0f0f0; " >
<table width="100%" cellpadding="0" cellspacing="10" border="0">
<tr>
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; white-space: nowrap; " >发件人</td>
<td valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " ><a class="mail-from" style="color: #1c83eb; text-decoration: none" ***@***.***" >***@***.***></a></td>
</tr>
<tr>
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; white-space: nowrap; " >日期</td>
<td class="mail-date" valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " >2023年11月23日 19:38</td>
</tr>
<tr style="">
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; " >收件人</td>
<td valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " ><a class="mail-to" style="color: #1c83eb; text-decoration: none" ***@***.***" >***@***.***></a></td>
</tr>
<tr style="">
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; " >抄送至</td>
<td valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " ><a class="mail-cc" style="color: #1c83eb; text-decoration: none" ***@***.***" >***@***.***></a>、<a class="mail-cc" style="color: #1c83eb; text-decoration: none" ***@***.***" >***@***.***></a></td>
</tr>
<tr>
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; " >主题</td>
<td class="mail-subject" valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " >Re: [damo-cv/entroformer] Compressed binary file size (Issue #6)</td>
</tr>
</table>
</div>
<div><p></p>
<blockquote>
<p dir="auto">你好,我也遇到同样的问题,原始图像593K, 压缩获得的 .bin 文件大小竟然为1.13M, 麻烦请教下,这个是什么原因呢?</p>
</blockquote>
<p dir="auto">我也发生类似情况。但是我认为可能是使用的图片本身就已经被压缩过。您可以查看一下您的图片分辨率和位深大小,计算一下是否与您图片的存储大小对的上。一般存储大小都远小于理论计算得到的大小,说明已经是被压缩过的。而程序里读入图像的数据大小仍旧为分辨率乘以位深。</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="#6 (comment)">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ANYKQCHULOW6JNXGSGLBR4LYF4YS3AVCNFSM54YIHBTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSGQZDONJVGU3A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ANYKQCDJT6GNVK4BAUUMM2LYF4YS3A5CNFSM54YIHBTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGONS6DYZA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><damo-cv/entroformer/issues/6/1824275556</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
***@***.***": "http://schema.org",
***@***.***": "EmailMessage",
"potentialAction": {
***@***.***": "ViewAction",
"target": "#6 (comment)",
"url": "#6 (comment)",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
***@***.***": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script></div>
</div>
</body>
</html>
|
不好意思, 这个问题因为错误信息不足, 当时没有及时回答, 后来因为工作太忙忘记了.
Sorry, I didn't answer this question in time and forgot it because I was too busy at work. Regarding the problem that the output of different compression models are all of the same size, I have not encountered such a situation before. One possible reason is the inconsistent environment (e.g. torch version, someone has mentioned this before), which causes the model to output the same size for different images. b) The entropy encoding module caused the overflow of values. I followed 'torchac' for the entropy encoding code. You may check this part. Sorry again. |
感谢作者的回复。我目前的环境是python3.9.16,torch1.10.1。在调试熵编码部分时,发现在计算pmf_y_logit时,distribution_mixture.py中的class DiscretizedMixDistribution下out_A输出tensor全为-inf。我将原代码out_A = torch.log(torch.clamp(cdf_delta, min=1e-12))修改为out_A = torch.log(torch.clamp(cdf_delta.float(), min=1e-12))后,输出码流文件大小似乎变正常了。具体是否正确还需要确认。 |
您好,钱老师,压缩图像是png格式。十分感谢您的耐心回复。我再检查下。
…----李俊辉
-----原始邮件-----
发件人:Q1 ***@***.***>
发送时间:2023-11-24 13:59:36 (星期五)
收件人: damo-cv/entroformer ***@***.***>
抄送: Mlkk ***@***.***>, Manual ***@***.***>
主题: Re: [damo-cv/entroformer] Compressed binary file size (Issue #6)
不好意思, 这个问题因为错误信息不足, 当时没有及时回答, 后来因为工作太忙忘记了.
关于压缩得到的.bin文件比原始图像文件大. 如MY3360所说, 可能是你的原始图像已经是压缩格式了 (比如.jpg), 并且压缩率很高; 我们的算法仍会将这个图像按原图进行压缩, 然后用相应的压缩率的模型来压缩; 所以确认一下你的原始图像文件是否为PNG这样的无损格式.
关于不同压缩模型的输出都是同一个size. 我在测试时没有遇到过这样的情况, 我猜测可能的原因 a) 代码环境不一致问题, 导致模型对不同图片都是同样的输出 (之前有其他人出现过torch版本不一致导致的问题). b) 熵编码问题导致了数值的溢出, 熵编码的代码我是沿用了别人的代码, 在我本地跑是没有问题的, 你可以check一下这个部分.
Sorry, I didn't answer this question in time and forgot it because I was too busy at work.
Regarding the problem that the output of different compression models are all of the same size, I have not encountered such a situation before. One possible reason is the inconsistent environment (e.g. torch version, someone has mentioned this before), which causes the model to output the same size for different images. b) The entropy encoding module caused the overflow of values. I followed 'torchac' for the entropy encoding code. You may check this part.
Sorry again.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Hi,
I tried to compress one image file by your pre-trained model.
But the binary file size is same (2.9M) on different lambda model (entroformer_lambda0.1.pth, entroformer_lambda0.01.pth)
I expected to get different binary file size.
It should be the binary file size which is from "entroformer_lambda0.01.pth" model smaller than "entroformer_lambda0.1.pth"
Am i miss something..?
thank you
The text was updated successfully, but these errors were encountered: