DeepPack3D is a Python-based 3D bin-packing software optimized for robotic palletization systems. It supports various methods, including reinforcement learning (RL) and heuristic baselines, and provides flexible options for data input and visualization.
- Supports multiple methods: Reinforcement Learning (RL), Best Lookahead (BL), Best Area Fit (BAF), Best Shortest Side Fit (BSSF), and Best Longest Side Fit (BLSF).
- Provides options for data generation, user input, or loading from a file.
- Offers training and testing modes for RL.
- Includes visualization to monitor the packing process.
- GPU-enabled for accelerated RL training and inference.
The software runs in Python 3.10 and Tensorflow 2.10.0.
You can refer to Tensorflow official website for the installation guideline.
- Clone the repository:
git clone https://github.com/zgtcktom/DeepPack3D.git
cd DeepPack3D- Install dependencies:
pip install -r requirements.txt- Ensure you have a compatible GPU environment if using RL methods.
Alternatively, you can create a distributable package.
- Creating a wheel
python setup.py sdist bdist_wheel- Install wheel
pip install ./dist/DeepPack3D-0.1.0-py3-none-any.whl- Run python module
python -m deeppack3d rl 5 --n_iterations=-1 --data=file --path=./input.txt --verbose=1You can run DeepPack3D directly from the command line:
python deeppack3d.py <method> <lookahead> [options]python deeppack3d.py bl 5 --n_iterations=-1 --data=file --path=./input.txt --verbose=1<method>: Choose the method from{"rl", "bl", "baf", "bssf", "blsf"}.<lookahead>: Set the lookahead value.
--data: Input source (generated,input, orfile).- Default:
generated.
- Default:
--path: File path (used only if--data=file).- Default:
None.
- Default:
--n_iterations: Number of iterations (used only if--data=generated).- Default:
100.
- Default:
--seed: Random seed for reproducibility (used only if--data=generated).- Default:
None.
- Default:
--verbose: Verbose level (0for silent,1for standard,2for detailed).- Default:
1.
- Default:
--train: Enable training mode (used only withmethod=rl).- Default:
False.
- Default:
--batch_size: Batch size (used only with--train).- Default:
32.
- Default:
--visualize: Enable visualization mode.- Default:
False.
- Default:
You can also import DeepPack3D as a Python library to integrate with other systems or workflows.
Example:
from deeppack3d import deeppack3d
for result in deeppack3d('rl', 5, n_iterations=-1, data='file', path='./input.txt', verbose=0):
if result is None:
print('new bin')
continue
_, (x, y, z), (w, h, d), _ = result
print(f'placing item ({w}, {h}, {d}) at ({x}, {y}, {z})')Contributions are welcome! Feel free to open issues or submit pull requests to improve the software.
If you find this package useful, please feel free to cite our following work.
Tsang, Y. P., Mo, D. Y., Chung, K. T., & Lee, C. K. M. (2025). A deep reinforcement learning approach for online and concurrent 3D bin packing optimisation with bin replacement strategies. Computers in Industry, 164, 104202. https://doi.org/10.1016/j.compind.2024.104202
This project is licensed under the MIT License. See the LICENSE file for details.


