Spaces:
Runtime error
Runtime error
Commit
·
26bcb5b
1
Parent(s):
cedc10c
Auto deploy
Browse files- stCompressService.py +4 -4
stCompressService.py
CHANGED
@@ -36,7 +36,7 @@ def loadModel(qp: int, local: pathlib.Path, device, mse: bool):
|
|
36 |
|
37 |
|
38 |
|
39 |
-
@st.
|
40 |
def compressImage(image: torch.Tensor, model: BaseCompressor, crop: bool) -> File:
|
41 |
image = convert_image_dtype(image)
|
42 |
|
@@ -52,7 +52,7 @@ def compressImage(image: torch.Tensor, model: BaseCompressor, crop: bool) -> Fil
|
|
52 |
return File(headers[0], binaries[0])
|
53 |
|
54 |
|
55 |
-
@st.
|
56 |
def decompressImage(sourceFile: File, model: BaseCompressor) -> torch.ByteTensor:
|
57 |
binaries = sourceFile.Content
|
58 |
|
@@ -103,8 +103,8 @@ def main(debug: bool, quiet: bool, qp: int, disable_gpu: bool):
|
|
103 |
|
104 |
<p align="center">
|
105 |
<a href="https://github.com/xiaosu-zhu/McQuic">
|
106 |
-
<img src="https://raw.githubusercontent.com/xiaosu-zhu/McQuic/main/assets/GitHub_Logo.png" height="
|
107 |
-
<img src="https://img.shields.io/github/stars/xiaosu-zhu/McQuic?style=social" height="
|
108 |
</a>
|
109 |
</p>
|
110 |
""", unsafe_allow_html=True)
|
|
|
36 |
|
37 |
|
38 |
|
39 |
+
@st.experimental_memo
|
40 |
def compressImage(image: torch.Tensor, model: BaseCompressor, crop: bool) -> File:
|
41 |
image = convert_image_dtype(image)
|
42 |
|
|
|
52 |
return File(headers[0], binaries[0])
|
53 |
|
54 |
|
55 |
+
@st.experimental_memo
|
56 |
def decompressImage(sourceFile: File, model: BaseCompressor) -> torch.ByteTensor:
|
57 |
binaries = sourceFile.Content
|
58 |
|
|
|
103 |
|
104 |
<p align="center">
|
105 |
<a href="https://github.com/xiaosu-zhu/McQuic">
|
106 |
+
<img src="https://raw.githubusercontent.com/xiaosu-zhu/McQuic/main/assets/GitHub_Logo.png" height="24px" alt="Github"/>
|
107 |
+
<img src="https://img.shields.io/github/stars/xiaosu-zhu/McQuic?style=social" height="24px" alt="Github"/>
|
108 |
</a>
|
109 |
</p>
|
110 |
""", unsafe_allow_html=True)
|