Commit
·
1c02d26
1
Parent(s):
7eda7d2
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,7 @@ model, vis_processors, _ = load_model_and_preprocess(name="blip_caption", model_
|
|
10 |
|
11 |
# Define the input and output functions for Gradio
|
12 |
def generate_caption(image_file):
|
13 |
-
image = cv2.
|
14 |
-
|
15 |
-
# Preprocess the image using the Blip-Caption model's visual processors
|
16 |
-
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
17 |
|
18 |
# Preprocess the image using the Blip-Caption model's visual processors
|
19 |
image = vis_processors["eval"](raw_image).unsqueeze(0)
|
|
|
10 |
|
11 |
# Define the input and output functions for Gradio
|
12 |
def generate_caption(image_file):
|
13 |
+
image = cv2.imread(image_file)
|
|
|
|
|
|
|
14 |
|
15 |
# Preprocess the image using the Blip-Caption model's visual processors
|
16 |
image = vis_processors["eval"](raw_image).unsqueeze(0)
|