To create an emotion detector in Python using a device's camera. The first step would be to use a library such as OpenCV to capture frames from the camera. Then, you would need to use a machine learning model trained on a dataset of facial expressions to classify the emotions of the subjects in the captured frames. This can be done using a library such as TensorFlow or PyTorch.
Of course, this is just a high-level example, and there would be many details to consider in implementing a fully functional emotion detector. For example, you would need to handle the case where there are multiple subjects in the frame, and you would need to design the preprocessing and display functions mentioned in the code. You may also need to fine-tune the model to improve its performance on the specific task of emotion detection.