text2hologram
is an advanced Python package engineered to create holograms directly from textual input. Leveraging the power of libraries like odak, timm, transformers, diffusers, accelerate, and torch, it provides a seamless way to visualize your text in a whole new dimension.
This package is compatible with Python 3.9 and above.
For an in-depth look into the code and package structure, feel free to explore the source code here: Source Code
You are also welcome to run through Colab.
To install the text2hologram package, use the following pip command:
pip install text2hologram
Invoke text2hologram
from the command line to use it. Here's a simple demonstration:
text2hologram --device 'cuda' --outputdir './output'
In the command above, text2hologram
starts by verifying the specified device. Upon successful verification, it prompts for a text input, transforms the text into a hologram using the GPU (as specified by 'cuda'), and saves the resultant hologram in the './output' directory.
The options provided in the command are as follows:
--device
: The computing device to be used ('cpu' or 'cuda').--outputdir
: The output directory to store the generated holograms.--inference_steps
: The number of inference steps to be used for generating the image. Higher the number, more detailed and accurate the hologram. However, it would proportionately increase the computation time and cost.
For additional settings and options, refer to the config.json file. All settings are named in a self-explanatory manner for ease of use.
Should you have any queries or require further clarification, don't hesitate to get in touch with Pengze Li at linsonng@163.com.