File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
vllm/model_executor/models Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,13 @@ def _get_num_unpadded_features(
135
135
current_aspect_ratio = current_width / current_height
136
136
137
137
if aspect_ratio > current_aspect_ratio :
138
- new_height = (original_height * current_width ) // original_width
138
+ new_height = int (
139
+ round (original_height * (current_width / original_width ), 7 ))
139
140
padding = (current_height - new_height ) // 2
140
141
current_height = current_height - (2 * padding )
141
142
else :
142
- new_width = (original_width * current_height ) // original_height
143
+ new_width = int (
144
+ round (original_width * (current_height / original_height ), 7 ))
143
145
padding = (current_width - new_width ) // 2
144
146
current_width = current_width - (2 * padding )
145
147
Original file line number Diff line number Diff line change @@ -116,11 +116,13 @@ def _get_num_unpadded_features(
116
116
current_aspect_ratio = current_width / current_height
117
117
118
118
if aspect_ratio > current_aspect_ratio :
119
- new_height = (original_height * current_width ) // original_width
119
+ new_height = int (
120
+ round (original_height * (current_width / original_width ), 7 ))
120
121
padding = (current_height - new_height ) // 2
121
122
current_height = current_height - (2 * padding )
122
123
else :
123
- new_width = (original_width * current_height ) // original_height
124
+ new_width = int (
125
+ round (original_width * (current_height / original_height ), 7 ))
124
126
padding = (current_width - new_width ) // 2
125
127
current_width = current_width - (2 * padding )
126
128
You can’t perform that action at this time.
0 commit comments