Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data/DUTS-TE-Mask #8

Closed
kayleeliyx opened this issue May 8, 2020 · 2 comments
Closed

Data/DUTS-TE-Mask #8

kayleeliyx opened this issue May 8, 2020 · 2 comments

Comments

@kayleeliyx
Copy link

kayleeliyx commented May 8, 2020

Hi Sairajk! Thank you so much for your amazing code! When I use this code I have some problems.

I run the inference.py. However, the inference images don't have mask-images.

I put my own image into DUTS-TE-Image and use the downloaded masks file. I found that I can get results but the number of DUTS-TE-Image should be the same as masks file.

May I ask do you have any solutions for those who don't have ground-truth masks image?
Thank you so much!!!

@sairajk
Copy link
Owner

sairajk commented May 29, 2020

Hi @karliell, you should only run the run_inference function of inference.py for this purpose. The run_inference function does not require you to have corresponding masks for the input images (check its dataloader for a better understanding). You should be good to go with this line commented.

@sairajk sairajk closed this as completed May 29, 2020
@kayleeliyx
Copy link
Author

kayleeliyx commented Jun 24, 2020

Hi! I did run inference.py. However, I got this error when I run this code:

E:\pro1\Scripts\python.exe E:/Research/PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection/inference.py
  0%|          | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "E:/Research/PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection/inference.py", line 104, in <module>
    calculate_mae(rt_args)
  File "E:/Research/PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection/inference.py", line 91, in calculate_mae
    for batch_idx, (inp_imgs, gt_masks) in enumerate(tqdm.tqdm(test_dataloader), start=1):
  File "E:\pro1\lib\site-packages\tqdm\std.py", line 1127, in __iter__
    for obj in iterable:
  File "E:\pro1\lib\site-packages\torch\utils\data\dataloader.py", line 345, in __next__
    data = self._next_data()
  File "E:\pro1\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data
    return self._process_data(data)
  File "E:\pro1\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data
    data.reraise()
  File "E:\pro1\lib\site-packages\torch\_utils.py", line 394, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "E:\pro1\lib\site-packages\torch\utils\data\_utils\worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "E:\pro1\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "E:\pro1\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "E:\Research\PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection\src\dataloader.py", line 163, in __getitem__
    mask_img = cv2.imread(self.out_files[idx], 0)
IndexError: list index out of range


Process finished with exit code 1

You provide initial 3 images in ./data/DUTS/DUTS-TE/DUTS-TE-Image. I just add two more my own images in this folder and then run inference.py. It seems the number in masks and images folder should be the same. I don't know why.

Would you please help me with this? Thank you so much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants