(self, image, size)
| 57 | return self.mesh.shape['dp'] * self.mesh.shape['fsdp'] |
| 58 | |
| 59 | def _process_frame(self, image, size): |
| 60 | width, height = image.size |
| 61 | if width < height: |
| 62 | new_width = size |
| 63 | new_height = int(size * height / width) |
| 64 | else: |
| 65 | new_height = size |
| 66 | new_width = int(size * width / height) |
| 67 | image = image.resize((new_width, new_height)) |
| 68 | |
| 69 | left = (new_width - size) / 2 |
| 70 | top = (new_height - size) / 2 |
| 71 | right = (new_width + size) / 2 |
| 72 | bottom = (new_height + size) / 2 |
| 73 | image = image.crop((left, top, right, bottom)) |
| 74 | return np.array(image, dtype=np.float32) / 127.5 - 1 |
| 75 | |
| 76 | def _read_process_vision(self, path, max_n_frames): |
| 77 | f = open_file(path, 'rb') |
no outgoing calls
no test coverage detected