pharmapsychotic / clip-interrogator

Image to prompt with BLIP and CLIP
MIT License
2.66k stars 433 forks source link

only using 10% of my gpu #19

Open nicolai256 opened 1 year ago

nicolai256 commented 1 year ago

hello, I managed to get the new interrogator to run locally but it only uses a fraction of my gpu power (10%) any way to optimize this? I'm trying to caption my database that has millions of images so it would be nice if it could be optimized. thanks 😄

pharmapsychotic commented 1 year ago

I'm definitely interested in optimizing it! The 2.0 version moved to precomputed embeddings and a few other nice speed ups. I have a bunch of ideas for speeding up "best" mode. You can try using the "fast" mode (interrogate_fast) which is like 1 second per image. It doesn't give alignments as close as best though.

nicolai256 commented 1 year ago

I'm definitely interested in optimizing it! The 2.0 version moved to precomputed embeddings and a few other nice speed ups. I have a bunch of ideas for speeding up "best" mode. You can try using the "fast" mode (interrogate_fast) which is like 1 second per image. It doesn't give alignments as close as best though.

I'm gonna try running it 7 times at once tomorrow maybe that'll work :) maybe there's a way to do that with this code, something like batch size or whatever

nicolai256 commented 1 year ago

by the way, the interrogator is really good, nicely done. best one I've used so far 😄

nicolai256 commented 1 year ago

My python skills are not advanced enough to figure out multiprocessing with listdir 😅 I figured out how to skip already done captions but that doesn't seem to have any effect on multiprocessing, great for resuming though

xxl2005 commented 1 year ago

hello, I managed to get the new interrogator to run locally but it only uses a fraction of my gpu power (10%) any way to optimize this? I'm trying to caption my database that has millions of images so it would be nice if it could be optimized. thanks smile

can you explain to me how you managed to run local. how to install?