Using os.path.join in Python
Some notes:

(photos, identification, testers, id) = ([], [], {}, 0)


may become

photos, identification, testers, id = [], [], {}, 0


as parentheses are superfluous (and even it's recommended not use them).



for (subdirectorys, directorys, files) in os.walk(dir):


may become

for __, directorys, __ in os.walk(dir):


as the names subdirectorys and files are never used (not two consecutive underline symbols - __ - for ignoring their values).



Instead of maintaining the value of id manually (initializing it to 0 and then increase it by id += 1) you may use Pythonic way with help of enumerate() function - the very first line of you code will totally omit id:

photos, identification, testers = [], [], {}


and your for loop

    for subdirectory in directorys:


becomes

    for id, subdirectory in enumerate(directorys):




Two notes about your if statement

        if(f_extension.lower() not in
                ['.png','.jpg','.jpeg','.gif','.pgm']):



Python is not C/C++/Java, so outermost parentheses are superfluous.
Your may prepare your list of extensions in advance  

    EXTENSIONS = '.png .jpg .jpeg .gif .pgm'.split()       # split() creates a list


(nice method for saving some typing, isn't it?), and then use it:

    if f_extension.lower() not in EXTENSIONS:



(note the use of uppercase letters for a constant list).