Commit 702ef53a authored by Itsol-AnhNguyen's avatar Itsol-AnhNguyen

add customer view

parent 529a1ac4
File added
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
95FAF56E24EA83C900C161F2 /* Place within the box.png in Resources */ = {isa = PBXBuildFile; fileRef = 95FAF56B24EA83C800C161F2 /* Place within the box.png */; }; 95FAF56E24EA83C900C161F2 /* Place within the box.png in Resources */ = {isa = PBXBuildFile; fileRef = 95FAF56B24EA83C800C161F2 /* Place within the box.png */; };
95FAF56F24EA83C900C161F2 /* Avoid glare.png in Resources */ = {isa = PBXBuildFile; fileRef = 95FAF56C24EA83C900C161F2 /* Avoid glare.png */; }; 95FAF56F24EA83C900C161F2 /* Avoid glare.png in Resources */ = {isa = PBXBuildFile; fileRef = 95FAF56C24EA83C900C161F2 /* Avoid glare.png */; };
95FAF57024EA83C900C161F2 /* Do not place outside.png in Resources */ = {isa = PBXBuildFile; fileRef = 95FAF56D24EA83C900C161F2 /* Do not place outside.png */; }; 95FAF57024EA83C900C161F2 /* Do not place outside.png in Resources */ = {isa = PBXBuildFile; fileRef = 95FAF56D24EA83C900C161F2 /* Do not place outside.png */; };
A442B6EE25299DED0058D675 /* SBKValidateCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A442B6ED25299DED0058D675 /* SBKValidateCardView.swift */; };
A442B6F025299E160058D675 /* SBKValidateCardView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A442B6EF25299E160058D675 /* SBKValidateCardView.xib */; };
A442B6F22529A13A0058D675 /* SBKRecordFaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A442B6F12529A13A0058D675 /* SBKRecordFaceView.swift */; };
A442B6F42529A1440058D675 /* SBKRecordFaceView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A442B6F32529A1440058D675 /* SBKRecordFaceView.xib */; };
CCCF85EB83511B97EF23244B /* Pods_OCR_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6D65EE1B3D4F09B622C686E /* Pods_OCR_SDK.framework */; }; CCCF85EB83511B97EF23244B /* Pods_OCR_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6D65EE1B3D4F09B622C686E /* Pods_OCR_SDK.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -156,6 +160,10 @@ ...@@ -156,6 +160,10 @@
95FAF56B24EA83C800C161F2 /* Place within the box.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Place within the box.png"; sourceTree = "<group>"; }; 95FAF56B24EA83C800C161F2 /* Place within the box.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Place within the box.png"; sourceTree = "<group>"; };
95FAF56C24EA83C900C161F2 /* Avoid glare.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Avoid glare.png"; sourceTree = "<group>"; }; 95FAF56C24EA83C900C161F2 /* Avoid glare.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Avoid glare.png"; sourceTree = "<group>"; };
95FAF56D24EA83C900C161F2 /* Do not place outside.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Do not place outside.png"; sourceTree = "<group>"; }; 95FAF56D24EA83C900C161F2 /* Do not place outside.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Do not place outside.png"; sourceTree = "<group>"; };
A442B6ED25299DED0058D675 /* SBKValidateCardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SBKValidateCardView.swift; path = "../../../../ios-sdk/OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.swift"; sourceTree = "<group>"; };
A442B6EF25299E160058D675 /* SBKValidateCardView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SBKValidateCardView.xib; sourceTree = "<group>"; };
A442B6F12529A13A0058D675 /* SBKRecordFaceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SBKRecordFaceView.swift; sourceTree = "<group>"; };
A442B6F32529A1440058D675 /* SBKRecordFaceView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SBKRecordFaceView.xib; sourceTree = "<group>"; };
B6D65EE1B3D4F09B622C686E /* Pods_OCR_SDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OCR_SDK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B6D65EE1B3D4F09B622C686E /* Pods_OCR_SDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OCR_SDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -350,6 +358,8 @@ ...@@ -350,6 +358,8 @@
children = ( children = (
9546DDD2247D2C0C00AF50DE /* SBKCaptureCardVC.xib */, 9546DDD2247D2C0C00AF50DE /* SBKCaptureCardVC.xib */,
955105AA247774CC0053036F /* SBKCaptureCardVC.swift */, 955105AA247774CC0053036F /* SBKCaptureCardVC.swift */,
A442B6ED25299DED0058D675 /* SBKValidateCardView.swift */,
A442B6EF25299E160058D675 /* SBKValidateCardView.xib */,
); );
path = SBKCaptureCard; path = SBKCaptureCard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -367,6 +377,8 @@ ...@@ -367,6 +377,8 @@
children = ( children = (
9580130D2489F1EA00846F8A /* SBKRecordFace.swift */, 9580130D2489F1EA00846F8A /* SBKRecordFace.swift */,
9580130E2489F1EA00846F8A /* SBKRecordFace.xib */, 9580130E2489F1EA00846F8A /* SBKRecordFace.xib */,
A442B6F12529A13A0058D675 /* SBKRecordFaceView.swift */,
A442B6F32529A1440058D675 /* SBKRecordFaceView.xib */,
); );
path = SBKRecordFace; path = SBKRecordFace;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -491,6 +503,8 @@ ...@@ -491,6 +503,8 @@
95182D0624B3343E00405EA9 /* liveness.tflite in Resources */, 95182D0624B3343E00405EA9 /* liveness.tflite in Resources */,
95FAB2672499C89400CE7913 /* rotate.png in Resources */, 95FAB2672499C89400CE7913 /* rotate.png in Resources */,
95FAB20B24986B9600CE7913 /* valid_idcard.tflite in Resources */, 95FAB20B24986B9600CE7913 /* valid_idcard.tflite in Resources */,
A442B6F025299E160058D675 /* SBKValidateCardView.xib in Resources */,
A442B6F42529A1440058D675 /* SBKRecordFaceView.xib in Resources */,
955BECE624935A14001FB052 /* ic_record.png in Resources */, 955BECE624935A14001FB052 /* ic_record.png in Resources */,
955105FA2477B52C0053036F /* back.png in Resources */, 955105FA2477B52C0053036F /* back.png in Resources */,
955105B6247774CC0053036F /* Screen Shot 2020-05-12 at 15.14.44.png in Resources */, 955105B6247774CC0053036F /* Screen Shot 2020-05-12 at 15.14.44.png in Resources */,
...@@ -547,11 +561,13 @@ ...@@ -547,11 +561,13 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
955105AD247774CC0053036F /* Loadding.swift in Sources */, 955105AD247774CC0053036F /* Loadding.swift in Sources */,
A442B6EE25299DED0058D675 /* SBKValidateCardView.swift in Sources */,
955105CA247775290053036F /* SB_KYC_SDK.swift in Sources */, 955105CA247775290053036F /* SB_KYC_SDK.swift in Sources */,
955105AC247774CC0053036F /* ExtUiViewController.swift in Sources */, 955105AC247774CC0053036F /* ExtUiViewController.swift in Sources */,
955BEC4C249083A1001FB052 /* SBValidateInput.swift in Sources */, 955BEC4C249083A1001FB052 /* SBValidateInput.swift in Sources */,
955105C6247774CC0053036F /* SBKCaptureFaceVC.swift in Sources */, 955105C6247774CC0053036F /* SBKCaptureFaceVC.swift in Sources */,
955105C8247774CC0053036F /* SBKCaptureCardVC.swift in Sources */, 955105C8247774CC0053036F /* SBKCaptureCardVC.swift in Sources */,
A442B6F22529A13A0058D675 /* SBKRecordFaceView.swift in Sources */,
95801349248A25BC00846F8A /* CVPixelBufferExtension.swift in Sources */, 95801349248A25BC00846F8A /* CVPixelBufferExtension.swift in Sources */,
955105C3247774CC0053036F /* SBKResultFaceVC.swift in Sources */, 955105C3247774CC0053036F /* SBKResultFaceVC.swift in Sources */,
955105AB247774CC0053036F /* SBOCRRequest.swift in Sources */, 955105AB247774CC0053036F /* SBOCRRequest.swift in Sources */,
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>OCR-SDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
...@@ -56,11 +56,11 @@ public class SB_KYC_SDK { ...@@ -56,11 +56,11 @@ public class SB_KYC_SDK {
switch resultVaidate { switch resultVaidate {
case .ERROR: case .ERROR:
return -1 return -1
case .IMAGEFAKE: case .IMAGE_FAKE:
return 0 return 0
case .IMAGEFRONT: case .IMAGE_FRONT:
return 1 return 1
case .IMAGEBACK: case .IMAGE_BACK:
return 2 return 2
} }
} }
......
...@@ -194,7 +194,7 @@ class SBKCaptureCardVC: UIViewController, AVCapturePhotoCaptureDelegate { ...@@ -194,7 +194,7 @@ class SBKCaptureCardVC: UIViewController, AVCapturePhotoCaptureDelegate {
//Sự kiện chụp ảnh //Sự kiện chụp ảnh
@IBAction func onCapturePhoto(_ sender: Any) { @IBAction func onCapturePhoto(_ sender: Any) {
if (self.statusValidateImage == ValidateCard.IMAGEFRONT && self.checkScreen == 1) || (self.statusValidateImage == .IMAGEBACK && self.checkScreen == 2) { if (self.statusValidateImage == ValidateCard.IMAGE_FRONT && self.checkScreen == 1) || (self.statusValidateImage == .IMAGE_BACK && self.checkScreen == 2) {
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
let settings = AVCapturePhotoSettings(format: [AVVideoCodecKey: AVVideoCodecType.jpeg]) let settings = AVCapturePhotoSettings(format: [AVVideoCodecKey: AVVideoCodecType.jpeg])
stillImageOutput.capturePhoto(with: settings, delegate: self) stillImageOutput.capturePhoto(with: settings, delegate: self)
...@@ -265,7 +265,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate { ...@@ -265,7 +265,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate {
viewWithTag.removeFromSuperview() viewWithTag.removeFromSuperview()
} }
self.statusValidateImage = validateImageCard self.statusValidateImage = validateImageCard
if validateImageCard == ValidateCard.IMAGEFAKE || validateImageCard == .ERROR { if validateImageCard == ValidateCard.IMAGE_FAKE || validateImageCard == .ERROR {
self.lbDescription.textColor = UIColor.red self.lbDescription.textColor = UIColor.red
self.lbDescription.text = "Incorrect card, please check!".localized() self.lbDescription.text = "Incorrect card, please check!".localized()
self.imgCaution.isHidden = false self.imgCaution.isHidden = false
...@@ -275,7 +275,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate { ...@@ -275,7 +275,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate {
self.viewCamera.addSubview(overlay) self.viewCamera.addSubview(overlay)
} }
if validateImageCard == .IMAGEFRONT && self.checkScreen == 2 { if validateImageCard == .IMAGE_FRONT && self.checkScreen == 2 {
self.lbDescription.textColor = UIColor.red self.lbDescription.textColor = UIColor.red
self.lbDescription.text = "Please put the back of the card in".localized() self.lbDescription.text = "Please put the back of the card in".localized()
self.btnCapture.setImage(UIImage(named: "Button_Do@2x", in: Bundle(for: SBKTutorialVC.self), compatibleWith: nil), for: .normal) self.btnCapture.setImage(UIImage(named: "Button_Do@2x", in: Bundle(for: SBKTutorialVC.self), compatibleWith: nil), for: .normal)
...@@ -285,7 +285,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate { ...@@ -285,7 +285,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate {
self.viewCamera.addSubview(overlay) self.viewCamera.addSubview(overlay)
} }
if validateImageCard == .IMAGEBACK && self.checkScreen == 1 { if validateImageCard == .IMAGE_BACK && self.checkScreen == 1 {
self.lbDescription.textColor = UIColor.red self.lbDescription.textColor = UIColor.red
self.lbDescription.text = "Please put the front of the card in".localized() self.lbDescription.text = "Please put the front of the card in".localized()
self.btnCapture.setImage(UIImage(named: "Button_Do@2x", in: Bundle(for: SBKTutorialVC.self), compatibleWith: nil), for: .normal) self.btnCapture.setImage(UIImage(named: "Button_Do@2x", in: Bundle(for: SBKTutorialVC.self), compatibleWith: nil), for: .normal)
...@@ -295,7 +295,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate { ...@@ -295,7 +295,7 @@ extension SBKCaptureCardVC: AVCaptureVideoDataOutputSampleBufferDelegate {
self.viewCamera.addSubview(overlay) self.viewCamera.addSubview(overlay)
} }
if (self.statusValidateImage == ValidateCard.IMAGEFRONT && self.checkScreen == 1) || (self.statusValidateImage == .IMAGEBACK && self.checkScreen == 2) { if (self.statusValidateImage == ValidateCard.IMAGE_FRONT && self.checkScreen == 1) || (self.statusValidateImage == .IMAGE_BACK && self.checkScreen == 2) {
self.lbDescription.textColor = UIColor.colorFromHexa(Global.colorConfig) self.lbDescription.textColor = UIColor.colorFromHexa(Global.colorConfig)
self.lbDescription.text = "Are you ready. Let's start!".localized() self.lbDescription.text = "Are you ready. Let's start!".localized()
self.imgCaution.isHidden = true self.imgCaution.isHidden = true
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SBKValidateCardView" customModule="SB_KYC_SDK" customModuleProvider="target">
<connections>
<outlet property="btnTakePhoto" destination="MUh-i4-cOT" id="XIX-vk-Xo9"/>
<outlet property="viewCamera" destination="vId-Gb-QYw" id="dO3-YL-g95"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="tMz-JL-QhO">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vId-Gb-QYw">
<rect key="frame" x="0.0" y="44" width="414" height="698"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MUh-i4-cOT">
<rect key="frame" x="182" y="782" width="50" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="dPQ-aO-sFP"/>
<constraint firstAttribute="width" constant="50" id="nMV-8l-zek"/>
</constraints>
<state key="normal" image="iconCap.png"/>
<connections>
<action selector="onCapturePhoto:" destination="-1" eventType="touchUpInside" id="bv8-Oo-gSm"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="MUh-i4-cOT" firstAttribute="top" secondItem="vId-Gb-QYw" secondAttribute="bottom" constant="40" id="5HA-ie-rYI"/>
<constraint firstItem="vId-Gb-QYw" firstAttribute="top" secondItem="hB9-pv-7hU" secondAttribute="top" id="9yW-SW-kTY"/>
<constraint firstItem="vId-Gb-QYw" firstAttribute="leading" secondItem="tMz-JL-QhO" secondAttribute="leading" id="COE-Wm-3Sg"/>
<constraint firstItem="hB9-pv-7hU" firstAttribute="bottom" secondItem="MUh-i4-cOT" secondAttribute="bottom" constant="30" id="G5T-sy-Cra"/>
<constraint firstItem="MUh-i4-cOT" firstAttribute="centerX" secondItem="hB9-pv-7hU" secondAttribute="centerX" id="RAV-Ta-Xst"/>
<constraint firstAttribute="trailing" secondItem="vId-Gb-QYw" secondAttribute="trailing" id="U1Q-AI-Opp"/>
</constraints>
<viewLayoutGuide key="safeArea" id="hB9-pv-7hU"/>
<point key="canvasLocation" x="133" y="154"/>
</view>
</objects>
<resources>
<image name="iconCap.png" width="172" height="172"/>
</resources>
</document>
...@@ -402,9 +402,3 @@ class SBKRecordFace: UIViewController, AVCaptureVideoDataOutputSampleBufferDeleg ...@@ -402,9 +402,3 @@ class SBKRecordFace: UIViewController, AVCaptureVideoDataOutputSampleBufferDeleg
} }
} }
enum StatusFace: String {
case TOLEFT
case TORIGHT
case STRAIGHTFACE
case ERROR
}
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SBKRecordFaceView" customModule="SB_KYC_SDK" customModuleProvider="target">
<connections>
<outlet property="btnRecord" destination="kiz-B2-kqL" id="OpP-C8-4lo"/>
<outlet property="lbCopyright" destination="fBN-yA-pbq" id="Qwz-Ye-DJs"/>
<outlet property="lbDescription" destination="3NW-5M-g0h" id="e9r-PT-NWj"/>
<outlet property="viewBackground" destination="Z9C-Eh-mo9" id="pNl-8k-48n"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="UFA-SZ-Qoz">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z9C-Eh-mo9">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hK9-ib-LmH">
<rect key="frame" x="0.0" y="144.5" width="414" height="611"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fBN-yA-pbq">
<rect key="frame" x="205" y="84" width="4.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3NW-5M-g0h">
<rect key="frame" x="10" y="795.5" width="394" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kiz-B2-kqL">
<rect key="frame" x="182" y="826" width="50" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="Zge-fG-frc"/>
<constraint firstAttribute="width" constant="50" id="keQ-2a-Xpa"/>
</constraints>
<state key="normal" image="ic_record.png"/>
<connections>
<action selector="onRecord:" destination="-1" eventType="touchUpInside" id="ILY-WV-Xbt"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="3NW-5M-g0h" firstAttribute="leading" secondItem="UFA-SZ-Qoz" secondAttribute="leading" constant="10" id="4ym-MQ-aiv"/>
<constraint firstAttribute="bottom" secondItem="kiz-B2-kqL" secondAttribute="bottom" constant="20" id="7Ve-1m-MDs"/>
<constraint firstItem="Z9C-Eh-mo9" firstAttribute="leading" secondItem="UFA-SZ-Qoz" secondAttribute="leading" id="8JA-pa-TC1"/>
<constraint firstItem="3NW-5M-g0h" firstAttribute="centerX" secondItem="UFA-SZ-Qoz" secondAttribute="centerX" id="II3-ki-ySd"/>
<constraint firstAttribute="trailing" secondItem="Z9C-Eh-mo9" secondAttribute="trailing" id="REw-9J-X08"/>
<constraint firstItem="fBN-yA-pbq" firstAttribute="centerX" secondItem="UFA-SZ-Qoz" secondAttribute="centerX" id="Ruf-Rt-odr"/>
<constraint firstItem="hK9-ib-LmH" firstAttribute="top" secondItem="fBN-yA-pbq" secondAttribute="bottom" constant="40" id="TTn-Mn-7u7"/>
<constraint firstItem="hK9-ib-LmH" firstAttribute="centerX" secondItem="9lf-e8-SmZ" secondAttribute="centerX" id="Uxb-XZ-mT4"/>
<constraint firstItem="3NW-5M-g0h" firstAttribute="top" secondItem="hK9-ib-LmH" secondAttribute="bottom" constant="40" id="Wii-y3-Z3n"/>
<constraint firstAttribute="bottom" secondItem="Z9C-Eh-mo9" secondAttribute="bottom" id="X1j-RU-oQ0"/>
<constraint firstItem="Z9C-Eh-mo9" firstAttribute="top" secondItem="UFA-SZ-Qoz" secondAttribute="top" id="ddy-Yj-eLX"/>
<constraint firstItem="hK9-ib-LmH" firstAttribute="leading" secondItem="9lf-e8-SmZ" secondAttribute="leading" id="ejz-BC-pDd"/>
<constraint firstItem="kiz-B2-kqL" firstAttribute="centerX" secondItem="UFA-SZ-Qoz" secondAttribute="centerX" id="li9-pn-4K7"/>
<constraint firstItem="kiz-B2-kqL" firstAttribute="top" secondItem="3NW-5M-g0h" secondAttribute="bottom" constant="10" id="pYI-bW-8SR"/>
<constraint firstItem="fBN-yA-pbq" firstAttribute="top" secondItem="9lf-e8-SmZ" secondAttribute="top" constant="40" id="xcc-3V-dgz"/>
</constraints>
<viewLayoutGuide key="safeArea" id="9lf-e8-SmZ"/>
<point key="canvasLocation" x="133" y="154"/>
</view>
</objects>
<resources>
<image name="ic_record.png" width="100" height="100"/>
</resources>
</document>
...@@ -31,3 +31,49 @@ struct Global { ...@@ -31,3 +31,49 @@ struct Global {
static var imageCard1: Data? static var imageCard1: Data?
static var imageCard2: Data? static var imageCard2: Data?
} }
enum StatusFace: String {
case TOLEFT
case TORIGHT
case STRAIGHTFACE
case ERROR
}
public enum ValidateFace: String {
case FACE_STRAIGHT
case FACE_STRAIGHT_FAILD
case FACE_RIGHT
case FACE_RIGHT_FAILD
case FACE_LEFT
case FACE_LEFT_FAILD
case FACE_FAKE
case FACE_READY
case MANY_FACE
case NO_FACE
case ERROR
case INVALID
}
public enum StepRecord: String {
case STEP_FACE_STRAIGHT
case STEP_FACE_LEFT
case STEP_FACE_RIGHT
}
public enum ValidateCard: String {
case ERROR
case IMAGE_FAKE
case IMAGE_FRONT
case IMAGE_BACK
}
public enum TypeOverlay: String {
case OVAL
case CIRCLE
case SQUARE
}
public enum TypeCard: String {
case FRONT
case BACK
}
...@@ -29,11 +29,11 @@ class SBKValidateInput { ...@@ -29,11 +29,11 @@ class SBKValidateInput {
switch resultVaidate { switch resultVaidate {
case .ERROR: case .ERROR:
return -1 return -1
case .IMAGEFAKE: case .IMAGE_FAKE:
return 0 return 0
case .IMAGEFRONT: case .IMAGE_FRONT:
return 1 return 1
case .IMAGEBACK: case .IMAGE_BACK:
return 2 return 2
} }
} }
...@@ -64,11 +64,11 @@ class SBKValidateInput { ...@@ -64,11 +64,11 @@ class SBKValidateInput {
// Pass the pixel buffer to TensorFlow Lite to perform inference. // Pass the pixel buffer to TensorFlow Lite to perform inference.
result = modelDataHandler?.runModel(onFrame: pixelBuffer) result = modelDataHandler?.runModel(onFrame: pixelBuffer)
if result![0] > result![1] && result![0] > result![2]{ if result![0] > result![1] && result![0] > result![2]{
return .IMAGEFAKE return .IMAGE_FAKE
} else if result![1] > result![0] && result![1] > result![2] { } else if result![1] > result![0] && result![1] > result![2] {
return .IMAGEFRONT return .IMAGE_FRONT
} else { } else {
return .IMAGEBACK return .IMAGE_BACK
} }
} }
...@@ -190,10 +190,3 @@ class SBKValidateInput { ...@@ -190,10 +190,3 @@ class SBKValidateInput {
return croppedImage return croppedImage
} }
} }
enum ValidateCard: String {
case ERROR
case IMAGEFAKE
case IMAGEFRONT
case IMAGEBACK
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Pods-OCR-SDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>TensorFlowLiteC.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>TensorFlowLiteSwift.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment