(frame, target_short_side)
| 125 | return frames |
| 126 | |
| 127 | def resize_frame(frame, target_short_side): |
| 128 | h, w, _ = frame.shape |
| 129 | if h < w: |
| 130 | if target_short_side > h: |
| 131 | return frame |
| 132 | new_h = target_short_side |
| 133 | new_w = int(target_short_side * w / h) |
| 134 | else: |
| 135 | if target_short_side > w: |
| 136 | return frame |
| 137 | new_w = target_short_side |
| 138 | new_h = int(target_short_side * h / w) |
| 139 | |
| 140 | resized_frame = cv2.resize(frame, (new_w, new_h)) |
| 141 | return resized_frame |
| 142 | |
| 143 | def padding_image(images, new_width, new_height): |
| 144 | new_image = Image.new('RGB', (new_width, new_height), (255, 255, 255)) |
nothing calls this directly
no outgoing calls
no test coverage detected