palletdatagenerator.modes.single_pallet moduleο
Single Pallet Mode - Based on original one_pallet_generator.py
Implements the exact camera positioning, movement, and generation logic from the original single pallet generator.
- class palletdatagenerator.modes.single_pallet.SinglePalletMode(config)[source]ο
Bases:
BaseGenerator
Single pallet generation mode with camera movement around a stationary pallet. Replicates the exact behavior of the original one_pallet_generator.py
- position_camera_for_side_face(cam_obj, target_obj, cfg)[source]ο
Position camera to focus on side faces of the pallet, EXACT as in original. Includes ground-safe positioning to prevent camera going below floor.
- apply_pallet_movement(pallets)[source]ο
Apply optional XY movement to pallets while keeping vertical stack.
- prepare_pallets(base)[source]ο
Prepare pallet objects (duplicates, materials, etc.) exactly as original.
- position_pallets(pallets, base_mat)[source]ο
Position pallets according to stacking configuration.
- create_random_lights(anchor_obj, replace_existing=False)[source]ο
Create random lighting around the anchor object - uses base class method.
- handle_attached_boxes(pallets)[source]ο
Handle attached box variants per frame - EXACT from original.
- ATTACHED_GROUP_PREFIX = 'AttachedGroup_'ο
- get_detections(pallets, cam_obj, sc)[source]ο
Get 2D and 3D bounding boxes for all visible pallets - EXACT from original.
- auto_expose_frame(sc, cam_obj)[source]ο
Auto-exposure adjustment for the frame - uses base class method.
- save_frame(img_path, b2d_list, b3d_list, pockets_list, cam_obj, sc, valid, fn, coco, ann_id, meta, pallets, keypoints_data=None)[source]ο
Save all outputs for a single frame: analysis, YOLO, VOC, COCO, metadata - EXACT from original.