Skip to content
Snippets Groups Projects
Commit 5cabb61e authored by Kerstin Kaspar's avatar Kerstin Kaspar
Browse files

debug

parent d2f0aada
No related branches found
No related tags found
No related merge requests found
...@@ -15,19 +15,22 @@ def get_lodopab_ground_truth(data_loc: Union[Path, str], ...@@ -15,19 +15,22 @@ def get_lodopab_ground_truth(data_loc: Union[Path, str],
indicator: 'train', 'test', or 'validation', or a list of several indicators to define which data is loaded indicator: 'train', 'test', or 'validation', or a list of several indicators to define which data is loaded
""" """
data_loc = Path(data_loc) data_loc = Path(data_loc)
indicator = list(indicator) if type(indicator) is not list else indicator indicator = [indicator] if type(indicator) is not list else indicator
data = {} data = {}
for ind in indicator: for ind in indicator:
# file_count = len(list(data_loc.glob(f'*{ind}*.hdf5'))) # file_count = len(list(data_loc.glob(f'*{ind}*.hdf5')))
for i, file in enumerate(data_loc.glob(f'*{ind}*.hdf5')): for i, file in enumerate(data_loc.glob(f'*ground_truth*{ind}*.hdf5')):
# load the data and create numpy array # load the data and create numpy array
with h5py.File(file, 'r') as f: with h5py.File(file, 'r') as f:
i_data = f['data'][:] i_data = f['data'][:]
if i == 0: if i == 0:
data[ind] = i_data data[ind] = i_data
else: else:
data[ind].append(i_data, axis=0) np.append(data[ind], i_data, axis=0)
return data if len(indicator) > 1:
return data
else:
return data[indicator[0]]
class LodopabDataset(Dataset): class LodopabDataset(Dataset):
......
...@@ -13,6 +13,18 @@ cache_files = { ...@@ -13,6 +13,18 @@ cache_files = {
ground_truth_data_loc = '//hpc.isc.pad.ptb.de/hipcl/daten841/kaspar01/lodopab-ct/' ground_truth_data_loc = '//hpc.isc.pad.ptb.de/hipcl/daten841/kaspar01/lodopab-ct/'
# # cluster
# cache_files = {
# 'train':
# '/oneFS/daten841/kaspar01/lodopab-ct/fbp/cache_lodopab_train_fbp.npy',
# 'validation':
# '/oneFS/daten841/kaspar01/lodopab-ct/fbp/cache_lodopab_validation_fbp.npy',
# 'test':
# '/oneFS/daten841/kaspar01/lodopab-ct/fbp/cache_lodopab_test_fbp.npy'}
#
# ground_truth_data_loc = '/gpfs001/scratch/kaspar01/lodopab-ct/data/'
# auto define the correct device # auto define the correct device
device = "cuda" if torch.cuda.is_available() else "cpu" device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using {device} device.") print(f"Using {device} device.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment