remove unnecessary output messages from smart_resize (#61)
Browse files- remove unnecessary output messages from smart_resize (5f51e82ea7ea0e77833deb3c99b53f46fb984844)
Co-authored-by: Yue Zhang <xiaohei66@users.noreply.huggingface.co>
- image_processing.py +0 -6
image_processing.py
CHANGED
|
@@ -141,18 +141,12 @@ def smart_resize(
|
|
| 141 |
3. The aspect ratio of the image is maintained as closely as possible.
|
| 142 |
|
| 143 |
"""
|
| 144 |
-
# if height < factor or width < factor:
|
| 145 |
-
# raise ValueError(f"height:{height} or width:{width} must be larger than factor:{factor}")
|
| 146 |
-
# if int(height < factor//4) + int(width < factor//4):
|
| 147 |
-
# raise ValueError(f"height:{height} or width:{width} must be larger than factor:{factor//4}")
|
| 148 |
|
| 149 |
if height < factor:
|
| 150 |
-
print(f"smart_resize: height={height} < factor={factor}, reset height=factor")
|
| 151 |
width = round((width * factor) / height)
|
| 152 |
height = factor
|
| 153 |
|
| 154 |
if width < factor:
|
| 155 |
-
print(f"smart_resize: width={width} < factor={factor}, reset width=factor")
|
| 156 |
height = round((height * factor) / width)
|
| 157 |
width = factor
|
| 158 |
|
|
|
|
| 141 |
3. The aspect ratio of the image is maintained as closely as possible.
|
| 142 |
|
| 143 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
if height < factor:
|
|
|
|
| 146 |
width = round((width * factor) / height)
|
| 147 |
height = factor
|
| 148 |
|
| 149 |
if width < factor:
|
|
|
|
| 150 |
height = round((height * factor) / width)
|
| 151 |
width = factor
|
| 152 |
|