You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: