Add face attributes and fix jsonable by updating capybara-docsaid to 0.12.0 #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the JSON serialization and deserialization capabilities of the
pyfacelibrary, particularly for face-related objects. It addsfrom_jsonclass methods to core dataclasses, refines encoding/decoding logic for image and numpy data, and ensures compatibility with updated dependencies. Additionally, a new test verifies the correctness of the JSON (de)serialization process.Enhancements to JSON (de)serialization:
from_jsonclass methods to key dataclasses (Eye,Mouth,WhetherOrNot,Liveness,TDDFA,Encode,Who,Attribute,Face,Faces), enabling robust and consistent deserialization from JSON for all face-related objects. [1] [2] [3] [4] [5]Faceand related classes, standardizing the use ofcapybarautility functions for base64 conversions. [1] [2]pyface/__init__.py.Dependency and compatibility updates:
capybara-docsaidto0.12.0inpyproject.tomlto ensure compatibility with new features.pybase64import frompyface/object.pysince base64 operations are now handled bycapybara.Testing improvements:
tests/test_jsonable.py) to verify that face data can be serialized to JSON and accurately reconstructed, ensuring data integrity for the newfrom_jsonmethods.Minor bug fixes:
lmk68pttolmk3d68ptin both theTDDFAdataclass and its usage inface_service.pyfor consistency. [1] [2]face_service.pyfor improved readability.