yijingru / Vertebra-Landmark-Detection

[ISBI 2020] Vertebra-Focused Landmark Detection for Scoliosis Assessment
MIT License
92 stars 26 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '*.mat' #1

Open StefankinaOlya opened 4 years ago

StefankinaOlya commented 4 years ago

Hello, tell me what should be contained in .mat files or show an example that was used in your code?

yijingru commented 4 years ago

Hi, the mat file contains the annotations of the landmarks. You can change the code to adapt it to your own data. Or you can download the dataset listed in https://aasce19.grand-challenge.org/Home/.

StefankinaOlya commented 4 years ago

Oh, thank you. I try to can change the code to adapt to my data, but there was a problem with mat files. I have only the source images and their masks.

StefankinaOlya commented 4 years ago

I can not download the dataset. image

yijingru commented 4 years ago

I think you have to sign in first. The mat file should provide the coordinates of the landmarks, as in dataset.py, 'pts' is loaded from the .mat file, 'pts' is a 2D array or matrix with the size of N x 2 (N=68). def load_gt_pts(self, annopath): pts = loadmat(annopath)['p2'] # num x 2 (x,y) pts = rearrange_pts(pts) return pts

StefankinaOlya commented 4 years ago

Even after I went in, I did not have access to files. It turns out that I have to create these mat files myself. I would like to clarify, do these files contain the coordinates of all the vertebrae?

yijingru commented 4 years ago

Yes, these mat files contain the coordinates of the corners of the vertebrae. You can adapt the code to your own annotations by replacing the load_gt_pts function in dataset.py

About the dataset, you can send your requirements here http://spineweb.digitalimaginggroup.ca/dataset.php.

StefankinaOlya commented 4 years ago

Thanks a lot. I'll try!

leilaShen commented 4 years ago

Hi since the data downloading link is not available for me, would you upload the trained model file? Thanks a lot! @yijingru

yijingru commented 4 years ago

Hi since the data downloading link is not available for me, would you upload the trained model file? Thanks a lot! @yijingru

The pretrained weights are shared now.

UgurOzcanFited commented 3 years ago

Hello, I am getting this error. Is there a problem on my .mat file? I downloaded the train and test images and labels. I am converting from .csv to .mat files. Succeed this. But I am not train the images and labels. Can you help me?


Setting up data...
Starting training...
----------
Epoch: 1/50 
[[21.593  11.619   2.3353]]
[[38.967 11.978 34.892]]
[[35.528 29.172 15.598]]
Traceback (most recent call last):
  File "main.py", line 33, in <module>
    is_object.train_network(args)
  File "/home/ugur/Downloads/Fited-calismalar/Vertebra-Landmark-Detection-master/train.py", line 123, in train_network
    epoch_loss = self.run_epoch(phase='train',
  File "/home/ugur/Downloads/Fited-calismalar/Vertebra-Landmark-Detection-master/train.py", line 150, in run_epoch
    for data_dict in data_loader:
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 363, in __next__
    data = self._next_data()
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 989, in _next_data
    return self._process_data(data)
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1014, in _process_data
    data.reraise()
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/_utils.py", line 395, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/ugur/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/ugur/Downloads/Fited-calismalar/Vertebra-Landmark-Detection-master/dataset.py", line 73, in __getitem__
    pts = self.load_annotation(index)   # num_obj x h x w
  File "/home/ugur/Downloads/Fited-calismalar/Vertebra-Landmark-Detection-master/dataset.py", line 60, in load_annotation
    pts = self.load_gt_pts(annoFolder)
  File "/home/ugur/Downloads/Fited-calismalar/Vertebra-Landmark-Detection-master/dataset.py", line 50, in load_gt_pts
    pts = rearrange_pts(pts)
  File "/home/ugur/Downloads/Fited-calismalar/Vertebra-Landmark-Detection-master/dataset.py", line 20, in rearrange_pts
    bl = pt_l[y_inds_l[1], :]
IndexError: index 1 is out of bounds for axis 0 with size 1
Aboorvabs commented 1 year ago

Please help me download the dataset