bulk icon indicating copy to clipboard operation
bulk copied to clipboard

bulk image takes a while to load - write docs

Open DUD91 opened this issue 3 years ago • 5 comments

Hi,

I tried to run bulk image on a dataset which was created according to: https://github.com/explosion/prodigy-recipes/blob/master/tutorials/bulk-images/make_pets.py

Unfortunately, running the command "python -m bulk image <my_csv>" only shows a blank bokeh server page on port 5006 without any errors or additional information in the terminal... Only output visible is: "About to serve bulk over at http://localhost:5006/."

Has anyone encountered this issue? Tried locally on macOS with bulk versions 0.1.0 - 0.1.3 and python 3.8-3.10 as well as within a docker-container, both with the same results (blank bokeh server page)

Would greatly appreciate any indications - thanks a lot!

DUD91 avatar Nov 21 '22 18:11 DUD91

It can take a few seconds for all the images to load in memory. How long was it stale?

koaning avatar Nov 22 '22 02:11 koaning

Yeah just figured out the issue is definitely related to df-size... 500 rows work reasonably well. Thanks a lot for your response and sorry for the inconvenience.

DUD91 avatar Nov 22 '22 06:11 DUD91

No worries, I'll re-open the issue to make sure this is better documented when I get round to making docs.

koaning avatar Nov 22 '22 08:11 koaning

One option is to use PIL to turn all of your images into Thumbnails. This can make the UI more responsive and dramatically reduce the launch time.

from PIL import Image
import glob

def resize():
    for img_name in glob.glob('myimages/*.jpg'):
        im = Image.open(img_name)
        im.thumbnail((200,200))
        im.save(img_name)

resize()

CGCooke avatar Feb 01 '23 11:02 CGCooke

That's a neat trick! I might write that one down in the readme/docs.

koaning avatar Feb 01 '23 15:02 koaning