pytorch / pytorch/vision

Write text on images as an augmentation

Open
#5,791 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: transforms needs discussion
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🚀 Torchvision GPU compatible text writing on images

Hi.

Right now, I believe that if you wanna write text on a GPU Tensor, you're gonna have to do it in CPU memory.

This is unfortunate since text writing is a very good augmentation is some cases, where input data might have timestamps for example. Also, most efficient loading libraries make use of the GPU (for example Nvidia Dali, decord) for efficient loading, meaning that converting a tensor back to numpy array sacrifices this advantage they have for "large" training (when you don't have the whole dataset in RAM).

I think it'd be great if writing random text on an image was a torchvision feature :D

Alternatives

Convert the tensor it back to numpy array and use OpenCV.

cc @vfdev-5 @datumbox

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Start by locating torchvision's image augmentation and tensor-device handling, then define the supported GPU text-writing behavior and tests; done means random text can be written on GPU tensors without converting them to CPU memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.