Mercurial > repos > bgruening > bioimage_inference
comparison main.py @ 5:37b9ead209da draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/bioimaging commit 399a62ba78a6a3d7885c7df03cc7de37e1a7ec6f
| author | bgruening |
|---|---|
| date | Tue, 15 Apr 2025 15:39:20 +0000 |
| parents | 2b61d8fcfa52 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:2b61d8fcfa52 | 5:37b9ead209da |
|---|---|
| 106 | 106 |
| 107 exp_test_data = torch.tensor(test_data) | 107 exp_test_data = torch.tensor(test_data) |
| 108 # check if image dimensions are reversed | 108 # check if image dimensions are reversed |
| 109 reversed_order = list(reversed(range(exp_test_data.dim()))) | 109 reversed_order = list(reversed(range(exp_test_data.dim()))) |
| 110 exp_test_data_T = exp_test_data.permute(*reversed_order) | 110 exp_test_data_T = exp_test_data.permute(*reversed_order) |
| 111 if exp_test_data_T.shape == target_image_dim: | 111 if exp_test_data_T.shape == target_image_dim and exp_test_data.shape != target_image_dim: |
| 112 exp_test_data = exp_test_data_T | 112 exp_test_data = exp_test_data_T |
| 113 # check if image dimensions are not equal to target image dimensions | |
| 113 if exp_test_data.shape != target_image_dim: | 114 if exp_test_data.shape != target_image_dim: |
| 114 for i in range(len(target_image_dim) - exp_test_data.dim()): | 115 for i in range(len(target_image_dim) - exp_test_data.dim()): |
| 115 exp_test_data = exp_test_data.unsqueeze(i) | 116 exp_test_data = exp_test_data.unsqueeze(i) |
| 116 try: | 117 try: |
| 117 exp_test_data = dynamic_resize(exp_test_data, target_image_dim) | 118 exp_test_data = dynamic_resize(exp_test_data, target_image_dim) |
