ucinlp / autoprompt

AutoPrompt: Automatic Prompt Construction for Masked Language Models.
Apache License 2.0
594 stars 81 forks source link

Question on using this in conjunction with CLIP / Open_CLIP / VQGAN #33

Closed johndpope closed 3 years ago

johndpope commented 3 years ago

https://github.com/mlfoundations/open_clip/issues/1

@gabrielilharco suggested this research may help with my problem above. Basically want to introspect an image to shed light on what prompts would be appropriate to recreate a similar image.

rloganiv commented 3 years ago

Hi @johndpope,

This is an interesting idea! No guarantees, but this definitely could work, although you will probably get better prompts with multiple query (not sure this is the right word) images.

I think the best way to use AutoPrompt for your application would be to copy the relevant lines of code to the open_clip training script. Pretty much everything you need is contained in https://github.com/ucinlp/autoprompt/blob/master/autoprompt/create_trigger.py. The main things you'll need are:

Hope this helps! I'll leave this issue open for a couple days in case you have any follow up questions.

Best,

@rloganiv

rloganiv commented 3 years ago

Oh and to avoid licensing issues I just licensed this code base under Apache 2.0, so you should be free to copy and alter the code for open_clip however you see fit.

johndpope commented 3 years ago

Thanks Robert, going to be deferring to this repo by Jamie Kiros @dzryk https://github.com/dzryk/clip-grams