fiftyone
fiftyone copied to clipboard
[BUG] Unique filenames are not generated when drawing labels
When drawing labels on samples and saving them to disk, it is expected that unique filenames will be created if multiple samples in the view have the same filename/path. However, currently these unique filenames aren't generated and only one copy of each file will be written.
from fiftyone import ViewField as F
import fiftyone.zoo as foz
dataset = foz.load_zoo_dataset("quickstart").clone()
sample = dataset.first()
dataset.add_sample(sample)
dup_view = dataset.match(F("filepath") == sample.filepath)
dup_view.draw_labels("/tmp/draw-labels", label_fields=["ground_truth"])
Resulting directory:
/tmp/draw-labels
00880.jpg
Expected result:
/tmp/draw-labels
00880.jpg
00880-2.jpg