Created
May 24, 2018 08:12
-
-
Save softberries/70cbd05e408fffa22acd7643e1e2d18e to your computer and use it in GitHub Desktop.
calling external python script
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 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