a-PyTorch-Tutorial-to-Image-Captioning icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Image-Captioning copied to clipboard

what is the pupose of these two lines in `create_input_files` function in "master/utils.py"?

Open naveenmarthala opened this issue 3 years ago • 1 comments

I was going through the code and couldn't comprehend what was going on in these two lines of code:

what does the if check and what does the lines inside if do? https://github.com/sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning/blob/cc9c7e2f4017938d414178d3781fed8dbe442852/utils.py#L116-L118

and what is being "assert"ed in this line? https://github.com/sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning/blob/cc9c7e2f4017938d414178d3781fed8dbe442852/utils.py#L139

Any help is appreciated. Thanks.

naveenmarthala avatar Jul 10 '22 07:07 naveenmarthala

It's checking to make sure the images are not single channel (i.e. grayscale) and if so, creates an RGB images using the gray channel repeated (3) times.

secretsather avatar Oct 15 '22 18:10 secretsather