remove image pre process
Browse files
app.py
CHANGED
@@ -31,10 +31,10 @@ def caption_youtube(url):
|
|
31 |
|
32 |
# Convert the frame to a PIL image and apply the image transformation pipeline
|
33 |
image = Image.fromarray(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
34 |
-
image = image_transforms(image)
|
35 |
|
36 |
-
# Add batch dimension to the image tensor
|
37 |
-
image = image.unsqueeze(0)
|
38 |
inputs = processor(image, return_tensors="pt")
|
39 |
out = model.generate(**inputs)
|
40 |
caption = processor.decode(out[0], skip_special_tokens=True)
|
|
|
31 |
|
32 |
# Convert the frame to a PIL image and apply the image transformation pipeline
|
33 |
image = Image.fromarray(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
34 |
+
# image = image_transforms(image)
|
35 |
|
36 |
+
# # Add batch dimension to the image tensor
|
37 |
+
# image = image.unsqueeze(0)
|
38 |
inputs = processor(image, return_tensors="pt")
|
39 |
out = model.generate(**inputs)
|
40 |
caption = processor.decode(out[0], skip_special_tokens=True)
|