Cyril666 commited on
Commit
135acdd
·
verified ·
1 Parent(s): 165c69a

Update processing_videollama3.py

Browse files
Files changed (1) hide show
  1. processing_videollama3.py +2 -0
processing_videollama3.py CHANGED
@@ -298,6 +298,8 @@ class Videollama3Qwen2Processor(ProcessorMixin):
298
  elif isinstance(image_path, str) and os.path.isdir(image_path):
299
  # images = [cv2.cvtColor(cv2.imread(os.path.join(image_path, f)), cv2.COLOR_BGR2RGB) for f in sorted(os.listdir(image_path))]
300
  images = [Image.open(os.path.join(image_path, f)).convert('RGB') for f in sorted(os.listdir(image_path))]
 
 
301
  elif isinstance(image_path, list) and isinstance(image_path[0], str):
302
  # images = [cv2.cvtColor(cv2.imread(f), cv2.COLOR_BGR2RGB) for f in image_path]
303
  images = [Image.open(f).convert('RGB') for f in image_path]
 
298
  elif isinstance(image_path, str) and os.path.isdir(image_path):
299
  # images = [cv2.cvtColor(cv2.imread(os.path.join(image_path, f)), cv2.COLOR_BGR2RGB) for f in sorted(os.listdir(image_path))]
300
  images = [Image.open(os.path.join(image_path, f)).convert('RGB') for f in sorted(os.listdir(image_path))]
301
+ elif isinstance(image_path, str) and image_path.startswith("http://") or image_path.startswith("https://"):
302
+ images = [Image.open(requests.get(image, stream=True).raw)]
303
  elif isinstance(image_path, list) and isinstance(image_path[0], str):
304
  # images = [cv2.cvtColor(cv2.imread(f), cv2.COLOR_BGR2RGB) for f in image_path]
305
  images = [Image.open(f).convert('RGB') for f in image_path]