Skip to content
Minimal Swift for TensorFlow OpenCV bindings
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
Extra Delete Install_OpenCV4_Colab_binary.ipynb Jul 10, 2019
Sources fix deprecation warnings Jul 10, 2019
Tests initial commit Apr 17, 2019
.gitignore initial commit Apr 17, 2019
Package.swift update to work with s4tf 0.4 Jul 10, 2019 add flip, transpose, more examples Apr 18, 2019


Minimal Swift for TensorFlow OpenCV4 bindings, partially ported from gocv.

OpenCV Functions exposed:

  • resize
  • getRotationMatrix2D
  • warpAffine
  • copyMakeBorder
  • GaussianBlur
  • remap
  • imdecode
  • imread
  • cvtColor
  • flip
  • transpose

OpenCV's Mat can be converted to S4TF's Tensor and ShapedArray types.

See Extra/Test.ipynb and Tests as an example of usage.

This notebook was executed using updated swift-jupyter docker image with OpenCV4 installed.


Include as SwiftPM package:

.package(url: "", .branch("master"))

NOTE: OpenCV4 must installed in order for package to compile.


Currently this package is just an example of OpenCV/S4TF integration with no safety checks and guarantees to work properly :)


OpenCV C API, (c) Copyright gocv authors.

You can’t perform that action at this time.