-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
There are a few parts in the code that are a little inefficient or unnecessary:
-
Unnecessary Conversion: In the log_txt_as_img function, txts is converted to a NumPy array and then immediately converted to a Torch tensor. This conversion can be skipped, and txts can be directly returned as a NumPy array.
-
Inefficient Loop: In the log_txt_as_img function, the loop that creates the txt images can be optimized. Instead of creating a new txt image in each iteration, the loop can be simplified by creating a single txt image and then modifying it for each caption.
I am also submitting a PR with these necessary changes.
Metadata
Metadata
Assignees
Labels
No labels