Skip to content

Instantly share code, notes, and snippets.

@softberries
Created May 24, 2018 08:12
Show Gist options
  • Save softberries/70cbd05e408fffa22acd7643e1e2d18e to your computer and use it in GitHub Desktop.
Save softberries/70cbd05e408fffa22acd7643e1e2d18e to your computer and use it in GitHub Desktop.
calling external python script
import sys.process._
import scala.concurrent.ExecutionContext.Implicits.global
def checkIfFacesMatch(facePath1: String, facePath2: String): Future[Boolean] = {
Future {
val result = s"python python/facematch.py --face1=$facePath1 --face2=$facePath2".!!
val res = result.split("\n").tail.headOption.exists(r => Try(r.toBoolean).getOrElse(false))
removeFile(facePath1)
removeFile(facePath2)
res
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment