TextRecognitionDataGenerator icon indicating copy to clipboard operation
TextRecognitionDataGenerator copied to clipboard

background generator issue

Open saijaswanth433 opened this issue 5 years ago • 6 comments

while i try to add other backgrounds by adding them in pictures folder...the generator still prints old default images from pictures as background.

saijaswanth433 avatar Apr 12 '20 07:04 saijaswanth433

That is weird, I'll try to reproduce the issue.

Belval avatar Apr 12 '20 15:04 Belval

I added a new parameter that allows you to pass and image_dir as a parameter, I think it will streamline the whole thing quite a bit.

It's not merged yet: https://github.com/Belval/TextRecognitionDataGenerator/pull/137

Belval avatar Apr 13 '20 20:04 Belval

It's merged now, please try it and report back.

Belval avatar Apr 15 '20 22:04 Belval

@Belval I'm trying this from my Jupyter Notebook, should it give the background images by default.

By default it does not give me any backgrounds, also specifying the absolute path doesn't work like this:

base_generator = GeneratorFromRandom(count=10,length=2,use_numbers=False,use_symbols=False, 
                             orientation=0,use_letters=True, 
                             image_dir='/home/ubuntu/mayub/text_detection/examples')

The way I have installed it is pip install trdg

Do I need to make any changes ?

mohammedayub44 avatar Mar 31 '21 21:03 mohammedayub44

Got it fixed. I had to give the background_type=3 as well in the arguments and it worked.

However if I don't specify any directory, the default directory is giving error

[Errno 2] No such file or directory: '/home/ubuntu/mayub/text_detection/TextRecognitionDataGenerator/trdg/generators/images'

It's picking up images dir from one addition level deep. Not sure if it should be .. or ../.. in the code (Line 42) to get the default path.

mohammedayub44 avatar Mar 31 '21 21:03 mohammedayub44

This should be covered by tests, thank you for reporting the issue I will look into it.

Belval avatar Apr 01 '21 02:04 Belval