Update face_recognition for tolerance and locales

When locales use comma for numeric decimal separator, tolerance argument is not passed correctly.
I propose to switch temporally to "C" locales before converting float tolerance to string to get a period decimal separator.
This commit is contained in:
Yvan-56
2020-01-04 16:18:46 +01:00
committed by GitHub
parent ffed4efdec
commit 5223fdf4ae

View File

@@ -235,9 +235,11 @@ local function face_recognition ()
-- Get path of exported images
local path = df.get_path (img_list[1])
dt.print_log ("Face recognition: Path to unknown images: " .. path)
os.setlocale("C")
local tolerance = dt.preferences.read(MODULE, "tolerance", "float")
local command = bin_path .. " --cpus " .. nrCores .. " --tolerance " .. tolerance .. " " .. knownPath .. " " .. path .. " > " .. OUTPUT
os.setlocale()
dt.print_log("Face recognition: Running command: " .. command)
dt.print(_("Starting face recognition..."))