(seed_value)
| 332 | return seg_images, seg_maps |
| 333 | |
| 334 | def seed_everything(seed_value): |
| 335 | random.seed(seed_value) |
| 336 | np.random.seed(seed_value) |
| 337 | torch.manual_seed(seed_value) |
| 338 | os.environ['PYTHONHASHSEED'] = str(seed_value) |
| 339 | |
| 340 | if torch.cuda.is_available(): |
| 341 | torch.cuda.manual_seed(seed_value) |
| 342 | torch.cuda.manual_seed_all(seed_value) |
| 343 | torch.backends.cudnn.deterministic = True |
| 344 | torch.backends.cudnn.benchmark = True |
| 345 | |
| 346 | |
| 347 | if __name__ == '__main__': |