IMHO, the tutorial's goal is to provide you a sample that can work. It is not a solution for any real life application. However, to make it achieve as higher result as possible, you should:
- Use training images that have the same conditions (light, outdoor conditions, etc.) as the test images your application will manipulate.
- It is not cheating. To recognize any kind of object (in this case, gender), your application must base on some model which is derived from correct training data and this mechanism is similar to our brain. This is actual prediction.