dct-autoencoder 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/PKG-INFO +1 -1
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/dct_autoencoder/core.py +6 -2
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/pyproject.toml +1 -1
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/LICENSE +0 -0
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/README.md +0 -0
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/dct_autoencoder/__init__.py +0 -0
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/dct_autoencoder/basis.py +0 -0
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/dct_autoencoder/utils.py +0 -0
- {dct_autoencoder-0.2.0 → dct_autoencoder-0.2.1}/dct_autoencoder/visualization.py +0 -0
|
@@ -14,6 +14,10 @@ class DCTAutoencoder(nn.Module):
|
|
|
14
14
|
|
|
15
15
|
Args:
|
|
16
16
|
block_size (int, optional): The block size. Defaults to 8.
|
|
17
|
+
luminance_compression_ratio (float, optional): The luminance compression ratio.
|
|
18
|
+
Defaults to 1/2.
|
|
19
|
+
chrominance_compression_ratio (float, optional): The chrominance compression ratio.
|
|
20
|
+
Defaults to 1/4.
|
|
17
21
|
"""
|
|
18
22
|
|
|
19
23
|
def __init__(
|
|
@@ -198,7 +202,7 @@ class DCTAutoencoder(nn.Module):
|
|
|
198
202
|
+ 2 * self.compression_chrominance_passband.item()
|
|
199
203
|
)
|
|
200
204
|
|
|
201
|
-
def compress(self, encodings):
|
|
205
|
+
def compress(self, encodings: torch.Tensor) -> torch.Tensor:
|
|
202
206
|
if not self.do_compression:
|
|
203
207
|
return encodings
|
|
204
208
|
else:
|
|
@@ -211,7 +215,7 @@ class DCTAutoencoder(nn.Module):
|
|
|
211
215
|
compressed_encoding = torch.cat([l, c1, c2], dim=1)
|
|
212
216
|
return compressed_encoding
|
|
213
217
|
|
|
214
|
-
def decompress(self, compressed_encoding):
|
|
218
|
+
def decompress(self, compressed_encoding: torch.Tensor) -> torch.Tensor:
|
|
215
219
|
if not self.do_compression:
|
|
216
220
|
return compressed_encoding
|
|
217
221
|
else:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|