(processor, device, edit_image, edit_mask)
| 11 | |
| 12 | |
| 13 | def edit_preprocess(processor, device, edit_image, edit_mask): |
| 14 | if edit_image is None or processor is None: |
| 15 | return edit_image |
| 16 | processor = Config(cfg_dict=processor, load=False) |
| 17 | processor = ANNOTATORS.build(processor).to(device) |
| 18 | new_edit_image = processor(np.asarray(edit_image)) |
| 19 | processor = processor.to("cpu") |
| 20 | del processor |
| 21 | new_edit_image = Image.fromarray(new_edit_image) |
| 22 | return Image.composite(new_edit_image, edit_image, edit_mask) |
| 23 | |
| 24 | class ACEPlusImageProcessor(): |
| 25 | def __init__(self, max_aspect_ratio=4, d=16, max_seq_len=2048): |
no outgoing calls
no test coverage detected