darshan8950 commited on
Commit
1c02d26
·
1 Parent(s): 7eda7d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
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.imdecode(image_file.read(), cv2.IMREAD_COLOR)
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)