a-PyTorch-Tutorial-to-Image-Captioning
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"?
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.
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.