Aspect ratio bug
#29
by
sachin
- opened
- vision_encoder.py +1 -1
vision_encoder.py
CHANGED
@@ -233,7 +233,7 @@ class VisionEncoder(nn.Module):
|
|
233 |
im_size = min(
|
234 |
self.supported_sizes,
|
235 |
key=lambda size: (
|
236 |
-
abs((size[
|
237 |
abs(size[0] - width) + abs(size[1] - height),
|
238 |
),
|
239 |
)
|
|
|
233 |
im_size = min(
|
234 |
self.supported_sizes,
|
235 |
key=lambda size: (
|
236 |
+
abs((size[0] / size[1]) - aspect_ratio),
|
237 |
abs(size[0] - width) + abs(size[1] - height),
|
238 |
),
|
239 |
)
|