https://github.com/rxswiftcommunity/rxvision
RxVision (based on RxSwift)
https://github.com/rxswiftcommunity/rxvision
ios reactive-programming rxswift vision vision-framework
Last synced: 9 months ago
JSON representation
RxVision (based on RxSwift)
- Host: GitHub
- URL: https://github.com/rxswiftcommunity/rxvision
- Owner: RxSwiftCommunity
- License: mit
- Created: 2018-02-27T14:28:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-01T04:40:04.000Z (almost 6 years ago)
- Last Synced: 2025-07-21T00:42:14.689Z (11 months ago)
- Topics: ios, reactive-programming, rxswift, vision, vision-framework
- Language: Swift
- Size: 53.7 KB
- Stars: 13
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxVision
RxVision (based on RxSwift)
Basic usage.
```swift
let mlRequest: RxVNCoreMLRequest = VNCoreMLRequest.rx.request(model: model, imageCropAndScaleOption: .scaleFit)
mlRequest
.observable
.subscribe { [unowned self] (event) in
switch event {
case .next(let completion):
let cgImage = completion.value // NB you can easily pass the value along to the completion handler
if let result = completion.request.results?[0] as? VNClassificationObservation {
os_log("results: %@", type: .debug, result.identifier)
}
default:
break
}
}
.disposed(by: disposeBag)
let imageRequestHandler = VNImageRequestHandler(cgImage: cgImage, orientation: .up, options: requestOptions)
do {
try imageRequestHandler.rx.perform([mlRequest], on: cgImage) // NB you can easily pass the value along to the completion handler
} catch {
print(error)
}
```
Carthage setup.
```
github "RxSwiftCommunity/RxVision" ~> 0.1.0
```
Copyright (c) RxSwiftCommunity