Deep-Learning
Deep-Learning copied to clipboard
What does the match function means?
match = re.match(r'([A-Za-z_]+)(_[0-9]+.jpg)', file_name, re.I) What does this sentence mean?
This filters out two regex match groups from the filename: the file name and number, e.g. if you have files like dog_1.jpg, do_2.jpg, dog_3.jpg, etc., it filters out the _[number] from it and takes the file name (which is treated like the class name, so name the files like you named your classes in your label_map.pbtxt)
this isn't working, the match is showing NoneType.
patterns are grouped into parenthesis, match function searches and returns the match-object according to the aforementioned pattern string. Here first group says it consists of string pattern group in which each character can be either A to Z, or a-z or _ any number of times. Second group says it has to be started with _, then a string of characters each 0 to 9 any number of times, followed by '.jpg'