Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
#Build Image Caption and Generate Image Game App.
|
3 |
import gradio as gr
|
4 |
def caption_and_generate(image):
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
#Create Image Captioning Pipeline
|
3 |
+
imagecaptioningpipe = pipeline("image-to-text",model="Salesforce/blip-image-captioning-base")
|
4 |
+
|
5 |
+
from diffusers import DiffusionPipeline
|
6 |
+
#Create Image Generation Pipeline
|
7 |
+
imagegenpipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
8 |
+
|
9 |
+
from helper import image_to_base64_str, base64_to_pil, captioner, generate
|
10 |
+
|
11 |
#Build Image Caption and Generate Image Game App.
|
12 |
import gradio as gr
|
13 |
def caption_and_generate(image):
|