TreB1eN / InsightFace_Pytorch

Pytorch0.4.1 codes for InsightFace
MIT License
1.72k stars 418 forks source link

Suggestion about take_pic.py #66

Open qimingyudaowenti opened 5 years ago

qimingyudaowenti commented 5 years ago

Hi, TreB1eN! When I run take_pic.py to crop face, I find two little problems:

  1. The script isn't sensitive enough to my press (especially when I press q for quitting).
  2. The text in crop area will be saved.

I think the code could be better like:

while cap.isOpened():
    isSuccess, frame = cap.read()

    press_key = cv2.waitKey(1) & 0xFF
    if press_key == ord('t'):
        ...
    elif press_key == ord('q'):
        break

    if isSuccess:
        frame_text = cv2.putText(...)
        ...

cap.release()
TreB1eN commented 5 years ago

Hmm... please push a PR, I/m quite busy recently