Convert image to RGB to prevent error
Browse filesThe error otherwise is e.g. for RGBA images (as the one in the example) "RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0"
README.md
CHANGED
@@ -149,6 +149,7 @@ model.to("cuda")
|
|
149 |
# Inference
|
150 |
url = "https://assets-c4akfrf5b4d3f4b7.z01.azurefd.net/assets/2024/04/BMDataViz_661fb89f3845e.png"
|
151 |
image = Image.open(BytesIO(requests.get(url, stream=True).content))
|
|
|
152 |
|
153 |
convs = [
|
154 |
{"role": "system", "content": "You are agent that can see, talk and act."},
|
|
|
149 |
# Inference
|
150 |
url = "https://assets-c4akfrf5b4d3f4b7.z01.azurefd.net/assets/2024/04/BMDataViz_661fb89f3845e.png"
|
151 |
image = Image.open(BytesIO(requests.get(url, stream=True).content))
|
152 |
+
image = image.convert("rgb")
|
153 |
|
154 |
convs = [
|
155 |
{"role": "system", "content": "You are agent that can see, talk and act."},
|