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

How to perform an inference task with a model provided with trained parameters? #6

Open
YMX-zknu opened this issue Mar 23, 2024 · 6 comments

Comments

@YMX-zknu
Copy link

Hi author, I have downloaded the Cityscapes Trained Models and the file is as follows:
2

I would like to know how to set up the file to perform inference on the Cityspaces dataset with the model you provided.

thanks.

@twke18
Copy link
Owner

twke18 commented Mar 23, 2024

Hi,

You can use these python scripts for evaluation. We perform nearest neighbor retrieval to evaluate the trained models.

@YMX-zknu
Copy link
Author

Thanks, but I'm having another problem, as shown below.
1711542072519(1)

I tried to run the file "generate_pmi_owt_ucm.m" but I did not find the files corresponding to variables 'matDir', 'segDir', 'imgNames' in the program files you provided.

@twke18
Copy link
Owner

twke18 commented Mar 27, 2024

Sorry that I could not give you exact examples, as I lost the access to my code repo. I will instead explain what these variables are:

  1. matDir is a cache directory which saves the edge maps computed by PMI. The code will create the directory.
  2. segDir is the directory which saves all the segmentation masks by thresholding the edge maps. The code will also create the directory.
  3. imgNames is a list of image file names which can be found under rootDir (code). Originally, imgNames are read from these lines. You can modify it in your way to read the image names accordingly.

@YMX-zknu
Copy link
Author

Thank you, there are some errors when executing the inferance.py file, I hope you can answer them, as described below:

I have constructed the Cityscapes dataset as per your requirement as shown below:
image

However, while executing the inferance.py file, the following error occurs:
image

The displayed "gtFineInstId" seems to require instance segmentation images, but this file is not present in the built Cityscapes dataset. What is the reason for this? Thank you very much!

@twke18
Copy link
Owner

twke18 commented Apr 2, 2024

Hi, the files are the ground-truth instance masks of Cityscapes. They are not used for inference at all. You can either replace them with some dummy files, or download from here.

@YMX-zknu
Copy link
Author

Thank you very much, I downloaded the gtFineInstId.zip file you provided and am currently able to run the entire program.

I would like to train a new model based on my dataset to replace the pre-trained model you provided. Currently encountering two problems:

  1. As shown below, the variable imgNames in the generate_pmi_owt_ucm.m file reads from the cityscapes_train.txt file. Is the cityscapes_train.txt file the path to the images within all the sub-files of the leftImg8bit/train file in the established Cityscapes dataset?
    image
    Also, what is the purpose of these '*.txt' files (shown below) under the datasets/cityscapes path in your project?
    image

  2. I want to modify my dataset to the layout of the Cityscapes dataset you provided, but I don't know how the contents of the folder gtFineId are generated? Is it generated based on the gtFine_trainvaltest.zip file (shown below) on the Cityscapes website? Is it convenient for you to provide the corresponding processing code?
    image

Thank you very much for your time and help and I look forward to hearing from you.

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