Scénario de test & Cas d'usage
Create a simulated dataset of machine parts, including an ID, a label ('defect' or 'ok'), and a placeholder for the image data. In a real scenario, this table would be populated by the `loadImages` action.
| 1 | DATA casuser.manufacturing_parts; |
| 2 | LENGTH _image_ $200. image_id $10. label $6.; |
| 3 | INFILE DATALINES dsd dlm='|'; |
| 4 | INPUT image_id $ label $ _image_ $; |
| 5 | DATALINES; |
| 6 | PART-001|defect|...binary_data_for_image_1... |
| 7 | PART-002|ok|...binary_data_for_image_2... |
| 8 | PART-003|ok|...binary_data_for_image_3... |
| 9 | PART-004|defect|...binary_data_for_image_4... |
| 10 | ; |
| 11 | RUN; |
| 1 | |
| 2 | PROC CASUTIL; |
| 3 | load |
| 4 | DATA=casuser.manufacturing_parts casout='manufacturing_parts' replace; |
| 5 | QUIT; |
| 6 |
| 1 | PROC CAS; |
| 2 | image.augmentImages / |
| 3 | TABLE={name='manufacturing_parts', caslib='casuser'}, |
| 4 | copyVars={'image_id', 'label'}, |
| 5 | augmentations={{useWholeImage=TRUE, mutations={horizontalFlip=TRUE}}}, |
| 6 | casOut={name='parts_flipped', caslib='casuser', replace=TRUE}; |
| 7 | QUIT; |
| 1 | PROC CAS; |
| 2 | image.augmentImages / |
| 3 | TABLE={name='manufacturing_parts', caslib='casuser'}, |
| 4 | seed=54321, |
| 5 | addColumns='augmentAttributes', |
| 6 | copyVars={'image_id', 'label'}, |
| 7 | augmentations={{ |
| 8 | useWholeImage=TRUE, |
| 9 | mutations={ |
| 10 | rotateLeft={type='RANGE', value={0, 25}}, |
| 11 | darken={type='RANGE', value={0.1, 0.3}} |
| 12 | } |
| 13 | }}, |
| 14 | casOut={name='parts_randomized', caslib='casuser', replace=TRUE}; |
| 15 | QUIT; |
Two output tables are created. The 'parts_flipped' table contains the flipped images with their original IDs and labels. The 'parts_randomized' table contains new images with random transformations applied. This second table should also include the original ID and label, plus new columns (e.g., `_rotation_angle_`, `_darken_value_`) detailing the exact random augmentation applied to each image, allowing for full traceability.