google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.29k stars 5.13k forks source link

iOS building mediapipe/tasks/ios/build_ios_framework.sh and import xxx.xcfrmaeworks showing "No registered object with name:xxx" error #4665

Closed Alex92908 closed 1 year ago

Alex92908 commented 1 year ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

iOS 16.5

MediaPipe Tasks SDK version

v0.10.3

Task name (e.g. Image classification, Gesture recognition etc.)

face_landmarker

Programming Language and version (e.g. C++, Python, Java)

Objc,C++, Swift

Describe the actual behavior

After building mediapipe/tasks/ios/build_ios_framework.sh, I got "MediaPipeTasksCommon.xcframework", "MediaPipeTasksVision.xcframework" ,"libMediaPipeTasksCommon_device_graph.a","libMediaPipeTasksCommon_simulator_graph.a". Then I added these files, and "face_landmarker.task" data file to a iOS target, when I setuped FaceLandmarker, "
        let options = FaceLandmarkerOptions()
        let baseOptions = BaseOptions()
        let path = Bundle.main.path(forResource: "face_landmarker", ofType: "task")
        baseOptions.modelAssetPath = path ?? ""
        options.baseOptions = baseOptions
        options.minTrackingConfidence = minPoseTrackingConfidence
        options.runningMode = .liveStream
        options.faceLandmarkerLiveStreamDelegate = self
        do {
            let faceLandmarker = try FaceLandmarker(options: options)
        } catch  {
            print("###FaceLandmarker failed")
        }
"
but errors showed when I catch error"
Error Domain=com.google.mediapipe.tasks Code=5 "NOT_FOUND: ValidatedGraphConfig Initialization failed.
No registered object with name: mediapipe::tasks::vision::face_landmarker::FaceLandmarkerGraph; Unable to find Calculator "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"
No registered object with name: FlowLimiterCalculator; Unable to find Calculator "FlowLimiterCalculator"" UserInfo={NSLocalizedDescription=NOT_FOUND: ValidatedGraphConfig Initialization failed.
No registered object with name: mediapipe::tasks::vision::face_landmarker::FaceLandmarkerGraph; Unable to find Calculator "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"
No registered object with name: FlowLimiterCalculator; Unable to find Calculator "FlowLimiterCalculator"} "

Describe the expected behaviour

Setup FaceLandmarker successfully

Standalone code/steps you may have used to try to get what you need

let options = FaceLandmarkerOptions()
        let baseOptions = BaseOptions()
        let path = Bundle.main.path(forResource: "face_landmarker", ofType: "task")
        baseOptions.modelAssetPath = path ?? ""
        options.baseOptions = baseOptions
        options.minTrackingConfidence = minPoseTrackingConfidence
        options.runningMode = .liveStream
        options.faceLandmarkerLiveStreamDelegate = self
        do {
            let faceLandmarker = try FaceLandmarker(options: options)
        } catch  {
            print("###FaceLandmarker failed")
        }

Other info / Complete Logs

No response

kuaashish commented 1 year ago

@zhuwen15,

Could you elaborate your query with complete details. Also, Please provide the complete steps you are following to reproduce the issue from our end. Thank you!

kuaashish commented 1 year ago

Hello @schmidt-sebastian,

Could you please look into this issue. Thank you

schmidt-sebastian commented 1 year ago

The build script is used internally to build our CocoaPods targets. Please use the publicly available MediapipeTasksVision pod.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No