garmentiq.landmark.derivation.derivation_dict
The registry of available derivation functions.
Maps each derivation method name to its callable and the arguments it expects. Pass a
modified copy to landmark.derive to add your own derivation rules.
1"""The registry of available derivation functions. 2 3Maps each derivation method name to its callable and the arguments it expects. Pass a 4modified copy to `landmark.derive` to add your own derivation rules. 5""" 6derivation_dict = { 7 "derive_keypoint_coord": { 8 "p1_id": None, 9 "p2_id": None, 10 "p3_id": None, 11 "p4_id": None, 12 "p5_id": None, 13 "direction": ["parallel", "perpendicular"], 14 } 15} 16"""dict: A dictionary defining the schemas for various landmark derivation functions. 17 18Each key in this dictionary represents a derivation function, and its value is 19another dictionary specifying the expected parameters for that function. 20`None` as a parameter value indicates that the parameter must be provided 21when calling the function, and it is typically an integer ID corresponding to a 22predefined landmark. 23 24Example structure for "derive_keypoint_coord": 25 "derive_keypoint_coord": { 26 "p1_id": None, # Required: Integer ID of the first point. 27 "p2_id": None, # Required: Integer ID of the second point. 28 "p3_id": None, # Required: Integer ID of the third point. 29 "p4_id": None, # Required: Integer ID of the fourth point. 30 "p5_id": None, # Required: Integer ID of the fifth point. 31 "direction": ["parallel", "perpendicular"], # Required: How to derive line 1's direction. 32 } 33"""
dict: A dictionary defining the schemas for various landmark derivation functions.
Each key in this dictionary represents a derivation function, and its value is
another dictionary specifying the expected parameters for that function.
None as a parameter value indicates that the parameter must be provided
when calling the function, and it is typically an integer ID corresponding to a
predefined landmark.
Example structure for "derive_keypoint_coord": "derive_keypoint_coord": { "p1_id": None, # Required: Integer ID of the first point. "p2_id": None, # Required: Integer ID of the second point. "p3_id": None, # Required: Integer ID of the third point. "p4_id": None, # Required: Integer ID of the fourth point. "p5_id": None, # Required: Integer ID of the fifth point. "direction": ["parallel", "perpendicular"], # Required: How to derive line 1's direction. }