IRCameraSticker — a powerful face sticker and camera sticker for iOS

Irons163
2 min readMay 20, 2021

Screenshots

Look at my face! The stickers are there.

Features

  • Support face sticker.
  • Support GPUImage.

Future

  • Support more customized settings.

Install

Git

  1. Git clone this project.
  2. Copy this project into your own project.
  3. Add the .xcodeproj into you project and link it as embed framework.
  • Options: You can remove the “demo” and “ScreenShots” folder.

Cocoa-pods

Add "pod IRCameraSticker" in the Podfile
pod install

How does it work?

Using VNDetectFaceLandmarksRequestRevision3

Starting with iOS 13, you will get a different set of points (VNDetectFaceLandmarksRequestRevision3)

Get size of camera layer.

There are two methods to convert.

  1. Method one

2. Method two

Eyes

There are two methods to draw.

1. Method one

2. Method two

All points

Usage

Basic

  • Setup Camera
  • Setup `IRCameraStickerFilter` and `GPUImageView`
  • Start Camera
[self.videoCamera startCameraCapture];
  • LoadSticker
[IRCameraStickersManager loadStickersWithCompletion:^(NSArray<IRCameraSticker *> *stickers) {self.stickers = stickers;self.stickerFilter.sticker = [stickers firstObject];}];
  • Set callbacks and detect face then detail with it.

Advanced settings

  • Draw Face’s bound.
  • Draw Eyes’ bounds.

Thanks list

--

--