1. Face offline collection integration

1.1 Development Documents

Development document address: face offline collection integration

1.2 Problems encountered

1.2.1 Proceed to Step 2.3

The error message is as follows:

Error message: dyld: Library not the loaded: @ rpath/IDLFaceSDK framework/IDLFaceSDK Referenced from: / private/var/containers/Bundle/Application / 5 b25b8ba - 34 ac8 b3-4-8 dfa - E6EC3ED6913C/shenyang health wisdom. Wisdom app/shenyang medical insurance "Reason: image not found dyld: launch, loading dependent libraries DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Deve loper/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/ PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib Message from debugger: Terminated due to signal 6Copy the code

The IDLFaceSDK is not loaded

Solutions:

Step 1: Build Phases + New Copy Files Phase

Add idLFacesdk. framework to Frameworks for Destination.

1.2.2 Proceed to Step 3.4

Baidu provide demo, face after collecting the data – (void) in BDFaceLivenessViewController faceProcesss: UIImage *) in the image. NumberOfLiveness and the number of liveActionArray should be the same when setting live actions.

Note: Not all of the actions I understand are enabled, so numberOfLiveness is set to 1, which randomly selects one action for live verification each time we run the veness.

The implementation of the project is as follows, each time a random display of an action for in vivo verification

// Set the liveness detection action
NSArray *livenesswithList = @[
    @(FaceLivenessActionTypeLiveEye),
    @(FaceLivenessActionTypeLiveMouth),
    @(FaceLivenessActionTypeLiveYawRight),
    @(FaceLivenessActionTypeLiveYawLeft),
    @(FaceLivenessActionTypeLivePitchUp),
    @(FaceLivenessActionTypeLivePitchDown),
    ];
    
int x = arc4random() % 6;
    
[BDFaceLivingConfigModel.sharedInstance.liveActionArray addObject:livenesswithList[x]];
BDFaceLivingConfigModel.sharedInstance.isByOrder = NO;
BDFaceLivingConfigModel.sharedInstance.numOfLiveness = 1;
Copy the code

2. The OCR integration

2.1 Problems encountered

2.1.1 After the SDK is integrated, the system fails to run due to a warranty error

Error information is as follows:

/aip-ocr-ios-sdk-3/AipOcrDemo/AipOcrDemo.xcodeproj Building for iOS Simulator, but the linked and embedded framework 'IdcardQuality.framework' was built for iOS. Or build for ios but the linked and embedded framework was built for ios + ios SimulatorCopy the code

See blogs for solutions

Remove x86_64, i386, use the real machine debugging is good, no need to worry about the simulator, related command is as follows:

CD lib # to use lipo - info can view contains the architecture of the lipo - info AipBase. The framework/AipBase # Architectures in the fat file: AipBase are: I386 x86_64 armv7 armv7s arm64 # i386 lipo -remove x86_64 AipBase.framework/AipBase -o AipBase.framework/AipBase lipo -remove i386 AipBase.framework/AipBase -o AipBase.framework/AipBase lipo -remove x86_64 AipOcrSdk.framework/AipOcrSdk -o AipOcrSdk. Framework/AipOcrSdk lipo - remove i386 AipOcrSdk. The framework/AipOcrSdk - o AipOcrSdk framework/AipOcrSdk # to check again lipo -info AipBase.framework/AipBase # Architectures in the fat file: AipBase are: armv7 armv7s arm64Copy the code