FASnetSpoofDetection

main

Spoof detection for iOS using FASnet model
AppliedRecognition/Spoof-Detection-Fasnet-Apple

Spoof Detection using FASnet Model

Detects spoof in images

Installation

Swift Package Manager

  1. Open your project in Xcode.
  2. Select your project in the Project Navigator.
  3. Click on the Package Dependencies tab.
  4. Click the + icon and enter https://github.com/AppliedRecognition/Spoof-Detection-Fasnet-Apple.git in the search box labelled "Search or Enter Package URL".
  5. In the Dependency Rule drop-down select Up to Next Major Version and enter 1.0.0 in the adjacent text box.
  6. Press the "Add Package" button.

Usage

You will need an API key to use the spoof detection in your project. The API key in tests is rate-limited and not suitable for production applications. Please contact Applied Recognition to obtain an API key.

Sample code

Find out whether a face in an image is a spoof.

import FASnetSpoofDetection
import VerIDCommonTypes

let uiImage: UIImage // The image in which to detect spoof devices
let face: Face // Face detected in the image

let apiKey: String // Your API key
let url: URL // Service URL

let spoofDetection = FASnetSpoofDetection(apiKey: apiKey, url: url)
guard let cgImage = uiImage.cgImage, let image = Image(cgImage: cgImage) else {
    fatalError("Image conversion failed")
}
Task {
    let isSpoof = try await spoofDetection.isSpoofInImage(image, regionOfInterest: face.bounds)
}

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Sun Nov 16 2025 23:35:37 GMT-1000 (Hawaii-Aleutian Standard Time)