firebase / quickstart-ios

Firebase Quickstart Samples for iOS
https://firebase.google.com
Apache License 2.0
2.8k stars 1.47k forks source link

In Video mode smile,both eye open probablity getting 0. #495

Closed pandeyshivang closed 6 years ago

pandeyshivang commented 6 years ago

the code is properly working on IMage but getting an issue like Smile, eye not getting zero always in MLVision. Please reply as soon as possible because I am working on this project. ` for face in features { print("face ",face)

        print("face  smile ", smile)

    let normalizedRect = CGRect(
      x: face.frame.origin.x / width,
      y: face.frame.origin.y / height,
      width: face.frame.size.width / width,
      height: face.frame.size.height / height

    )
    let standardizedRect =
      self.previewLayer.layerRectConverted(fromMetadataOutputRect: normalizedRect).standardized
    UIUtilities.addRectangle(
      standardizedRect,
      to: self.annotationOverlayView,
      color: UIColor.green
    )
  }
}`
morganchen12 commented 6 years ago

Can you share your project?

pandeyshivang commented 6 years ago

check demo project in CameraVIewcontroller and click on video icon code found face smile getting 0.0 always.

morganchen12 commented 6 years ago

Can you share the versions of MLKit and Firebase that you're using?

jguinez commented 6 years ago

You have to set

        options.classificationType = .all
        let faceDetector = vision.faceDetector(options: options)

to capture those features