Using os.path.join in Python I want to reduce/shorten this part quite a lot. If you see that a method can be reduced or even erased please do not hesitate to suggest that. Any answer that rescue the code would be great.

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

# Get the folders containing the training data
for (subdirectorys, directorys, files) in os.walk(dir):

    # Loop through each folder named after the subject in the photos
    for subdirectory in directorys:
        testers[id] = subdirectory
        subpath = os.path.join(dir, subdirectory)

        # Loop through each photo in the folder
        for file_name in os.listdir(subpath):

            # Skip non-image formates
            f_name, f_extension = os.path.splitext(file_name)
            if(f_extension.lower() not in
                    ['.png','.jpg','.jpeg','.gif','.pgm']):
                print("Skipping "+file_name+", wrong type given for the file")
                continue
            path = subpath + '/' + file_name
            lable = id

            # Add to training data
            photos.append(cv2.imread(path, 0))
            identification.append(int(lable))
        id += 1
(im_width, im_height) = (112, 92)

# Create a Numpy array from the two lists above
(photos, identification) = [numpy.array(lis) for lis in [photos, identification]]
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).