palletdatagenerator.modes.warehouse module

Warehouse Mode - Based on original warehouse_generator.py

Implements the exact forklift simulation, camera paths, and generation logic from the original warehouse generator.

class palletdatagenerator.modes.warehouse.WarehouseMode(config)[source]

Bases: BaseGenerator

Warehouse generation mode with forklift simulation and camera paths. Replicates the exact behavior of the original warehouse_generator.py

__init__(config)[source]
generate_frames()[source]

Main warehouse generation loop exactly as in original warehouse_generator.py

find_warehouse_objects()[source]

Find and categorize warehouse objects by collections (object.XXX structure).

generate_warehouse_path(scene_objects)[source]

Generate a forklift-like camera path through the warehouse.

find_nearest_pallet(position, pallets)[source]

Find the nearest pallet to look at.

position_camera_on_path(cam_obj, camera_path, progress)[source]

Position camera along the forklift path with realistic movement.

randomize_scene_objects(scene_objects)[source]

Randomize scene objects and replace hidden boxes with generated groups - collection-aware approach.

generate_pallet_box_group(pallet, box_templates)[source]

Generate a group of boxes on a pallet - EXACT logic from original warehouse generator.

cleanup_generated_boxes()[source]

Clean up previously generated boxes.

find_pallet_box_relationships(scene_objects)[source]

Find relationships between pallets and their boxes.

get_visible_pallets(scene_objects, cam_obj, sc)[source]

Get pallets that are visible in the current camera view.

randomize_lighting()[source]

Set up dynamic warehouse lighting.

save_warehouse_frame_outputs(frame_id, img_filename, img_path, visible_pallets, cam_obj, sc, coco_data, meta)[source]

Save all outputs for a warehouse frame.

write_warehouse_annotations(visible_pallets, coco_data, img_id, img_w, img_h, cam_obj, sc)[source]

Write COCO and YOLO annotations for warehouse scene.

restore_scene_objects(removed_objects, original_positions)[source]

Restore scene objects to original state.

save_generated_scene(scene_id)[source]

Save the current generated scene to a .blend file in the scenes folder. This allows inspection and reuse of the randomized warehouse layout.