microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.5k stars 4.29k forks source link

Face Detection and Recognition/Identification #3046

Open yurinativo opened 6 years ago

yurinativo commented 6 years ago

Face Detection and Recognition/Identification

Hello,

I don't know if this is the appropriate channel for this subject, but I need some help.

It is possible to Detect, Train and Recgonize/Identify faces using CNTK?

I have developed some code in python (2.7, 3.5 and 3.6) using OpenCV, DLib and TensorFlow for:

  1. Read webcam frames (OpenCV and DLib)
    • Video Capture
      • (cv2.VideoCapture(0)).read()
  2. Detect any faces
    • OpenCV HAAR Cascade Classifier
      • cv2.CascadeClassifier('models/haarcascade_frontalface_default.xml').faceDetect(img, 1)
    • DLib Get Frontal Face
      • dlib.get_frontal_face_detector().faceDetect.run(img, 1, -0.2)
    • DLib CNN Frontal Face
      • dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat').detectMultiScale(img, 1.3, 5)
  3. Train a model with registered faces
    • OpenCV Face LBPH
      • cv2.face.LBPHFaceRecognizer_create()).train()
      • cv2.face.LBPHFaceRecognizer_create()).write()
  4. Face Recogniziton or Identification based on trained model:
    • OpenCV Face LBPH
      • cv2.face.LBPHFaceRecognizer_create().detectMultiScale(img, 1.3, 5)

I have search for any function or samples written using CNTK, but I had no success.

The Microsoft Azure Cognitive Service has samples to detect and identify faces, but I need a offline solution for a real-time video analysis inside a protected network.

My question again is:

spandantiwari commented 6 years ago

Yes, it should be possible to do that. You mention that you have already trained a model in another framework. You can similarly create a training script for training a model in CNTK as well. I don't expect that you would find any missing ops, but if you do please let us know. Just to make sure - you are not looking for pre-trained face models, are you? In case that's the intent, I don't think we have any pre-trained face models in model zoo. Aso, Microsoft Azure Cognitive Service has Face API available publicly, but not the backend model.

yurinativo commented 6 years ago

Hi Spandan, thank you for your answer.

This last days, we found a way to use CNTK to recognize faces using our trained model using Keras. Keras allow us to chose any framework, like TensorFlow and CNTK.

But I still need to find a way to:

ke1337 commented 6 years ago

Can you try MMdnn to convert models to CNTK?