Commit 4892e072 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Updated hash strategy. I was pretty stupid.

parent 497aa635
Pipeline #51948 passed with stage
in 312 minutes and 12 seconds
...@@ -5,21 +5,20 @@ from bob.extension import rc ...@@ -5,21 +5,20 @@ from bob.extension import rc
import os import os
import import
from functools import partial from functools import partial
import uuid
from bob.pipelines.utils import hash_string from bob.pipelines.utils import hash_string
def _make_sample_from_template_row(row, image_directory): def _make_sample_from_template_row(row, image_directory):
# Appending this hash, so we can handle parallel writting done correctly # Appending this key, so we can handle parallel writting done correctly
# paying the penalty of having duplicate files # paying the penalty of having duplicate files
hashstr = str(uuid.uuid4()) key = os.path.splitext(row["FILENAME"])[0] + "-" + str(row["TEMPLATE_ID"])
return DelayedSample( return DelayedSample(
load=partial(, os.path.join(image_directory, row["FILENAME"])), load=partial(, os.path.join(image_directory, row["FILENAME"])),
reference_id=str(row["TEMPLATE_ID"]), reference_id=str(row["TEMPLATE_ID"]),
subject_id=str(row["SUBJECT_ID"]), subject_id=str(row["SUBJECT_ID"]),
key=os.path.splitext(row["FILENAME"])[0] + "-" + hashstr, key=key,
gender=row["GENDER"], gender=row["GENDER"],
indoor_outdoor=row["INDOOR_OUTDOOR"], indoor_outdoor=row["INDOOR_OUTDOOR"],
skintone=row["SKINTONE"], skintone=row["SKINTONE"],
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment