Spaces:
Sleeping
Sleeping
fix tuple
Browse files
app.py
CHANGED
|
@@ -20,10 +20,8 @@ from optimization import optimize_pipeline_
|
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
from huggingface_hub import hf_hub_download
|
| 22 |
|
| 23 |
-
def pad_for_model(image: torch.Tensor, multiple: int)
|
| 24 |
"""Pad the tensor image so height/width are divisible by ``multiple``."""
|
| 25 |
-
if multiple <= 0:
|
| 26 |
-
raise ValueError("round_multiple must be > 0")
|
| 27 |
|
| 28 |
height, width = image.shape[-2:]
|
| 29 |
pad_h = (multiple - height % multiple) % multiple
|
|
|
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
from huggingface_hub import hf_hub_download
|
| 22 |
|
| 23 |
+
def pad_for_model(image: torch.Tensor, multiple: int):
|
| 24 |
"""Pad the tensor image so height/width are divisible by ``multiple``."""
|
|
|
|
|
|
|
| 25 |
|
| 26 |
height, width = image.shape[-2:]
|
| 27 |
pad_h = (multiple - height % multiple) % multiple
|