Testys commited on
Commit
ef63134
1 Parent(s): 40e40ef

Removing the load_img function before processor

Browse files
Files changed (1) hide show
  1. utils/caption_utils.py +1 -2
utils/caption_utils.py CHANGED
@@ -11,8 +11,7 @@ class ImageCaptioning:
11
  self.processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
12
  self.model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base").to(device)
13
 
14
- def get_caption(self, image_path):
15
- image = load_image(image_path)
16
 
17
  # Preprocessing the Image
18
  img = self.processor(image, return_tensors="pt").to(device)
 
11
  self.processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
12
  self.model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base").to(device)
13
 
14
+ def get_caption(self, image):
 
15
 
16
  # Preprocessing the Image
17
  img = self.processor(image, return_tensors="pt").to(device)