Hi everyone,
I have a question about how the ImageDataBunch.from_name_re create labels.
For example, in the lesson 1, below is a path name:
PosixPath(’/root/.fastai/data/oxford-iiit-pet/images/Bengal_159.jpg’)
and, below is the pattern:
pat = r’/([^/]+)_\d+.jpg$’
I understand that that regex is used to find names, like “Bengal_159.jpg” above.
What I don’t understand is, how did from_name_re know to label that photo with just “Bengal” without “_159”?
I went through the source code of from_name_re but still confused.
Thank you for your help!