FileStructure

class lib.align.updater.FileStructure(alignments: dict[str, Any], version: float)

Bases: _Updater

Alignments were structured: {frame_name: <list of faces>}. We need to be able to store information at the frame level, so new structure is: {frame_name: {faces: <list of faces>}}

Attributes Summary

is_updated

True if this updater has been run otherwise False

Methods Summary

test()

Test whether the alignments file is laid out in the old structure of {frame_name: [faces]}

update()

Update legacy alignments files from the format {frame_name: [faces} to the format {frame_name: {faces: [faces]}.

Attributes Documentation

Parameters:
  • alignments (dict[str, T.Any])

  • version (float)

is_updated

True if this updater has been run otherwise False

Methods Documentation

test() bool

Test whether the alignments file is laid out in the old structure of {frame_name: [faces]}

Return type:

True if the file has legacy structure otherwise False

update() int

Update legacy alignments files from the format {frame_name: [faces} to the format {frame_name: {faces: [faces]}.

Return type:

The number of items that were updated

test() bool

Test whether the alignments file is laid out in the old structure of {frame_name: [faces]}

Return type:

True if the file has legacy structure otherwise False

update() int

Update legacy alignments files from the format {frame_name: [faces} to the format {frame_name: {faces: [faces]}.

Return type:

The number of items that were updated