def METHOD_NAME(self, data):
    batch = default_collate([data])
    if self.refine:
        assert 'unpad_to_size' in batch, 'Unpadded size is required for the refinement'
        assert 'cuda' in str(self.device), 'GPU is required for refinement'
        gpu_ids = str(self.device).split(':')[-1]
        cur_res = refine_predict(
            batch,
            self.infer_model,
            gpu_ids=gpu_ids,
            modulo=self.pad_out_to_modulo,
            n_iters=15,
            lr=0.002,
            min_side=512,
            max_scales=3,
            px_budget=900000)
        cur_res = cur_res[0].permute(1, 2, 0).detach().cpu().numpy()
    else:
        with torch.no_grad():
            batch = self.move_to_device(batch, self.device)
            batch['mask'] = (batch['mask'] > 0) * 1
            batch = self.infer_model(batch)
            cur_res = batch['inpainted'][0].permute(
                1, 2, 0).detach().cpu().numpy()
            unpad_to_size = batch.get('unpad_to_size', None)
            if unpad_to_size is not None:
                orig_height, orig_width = unpad_to_size
                cur_res = cur_res[:orig_height, :orig_width]
    cur_res = np.clip(cur_res * 255, 0, 255).astype('uint8')
    cur_res = cv2.cvtColor(cur_res, cv2.COLOR_RGB2BGR)
    return cur_res