This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
| export CLICOLOR=1 | |
| export LSCOLORS=ExFxBxDxCxegedabagacad |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| view.addSubview(sceneView) | |
| view.addSubview(infoLabel) | |
| //1 | |
| let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTap)) | |
| tapRecognizer.numberOfTapsRequired = 1 | |
| sceneView.addGestureRecognizer(tapRecognizer) | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //1 | |
| class ViewController: UIViewController, ARSCNViewDelegate { | |
| lazy var sceneView: ARSCNView = { | |
| let view = ARSCNView(frame: CGRect.zero) | |
| view.delegate = self | |
| return view | |
| }() | |
| //2 | |
| lazy var infoLabel: UILabel = { | |
| let label = UILabel(frame: CGRect.zero) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| //1 | |
| import ARKit | |
| import SceneKit | |
| class ViewController: UIViewController { | |
| //2 | |
| lazy var sceneView: ARSCNView = { | |
| let view = ARSCNView(frame: CGRect.zero) | |
| return view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let image = UIImage(named: "text.png")! | |
| let vnImage = VNImageRequestHandler(cgImage: image.cgImage!, options: [:]) | |
| let textRectsRequest = VNDetectTextRectanglesRequest { (request, error) in | |
| if let results = request.results as? [VNTextObservation] { | |
| for result in results { | |
| print("boundingBox \(result.boundingBox)") | |
| print("characterBoxes \(result.characterBoxes)") | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Vision | |
| //1 | |
| let sourceImage = UIImage(named: "jony.jpg") | |
| var resultImage = sourceImage | |
| //2 | |
| let detectFaceRequest = VNDetectFaceLandmarksRequest { (request, error) in | |
| //4 | |
| if let results = request.results as? [VNFaceObservation] { | |
| //5 | |
| for faceObservation in results { |