Update pipeline.py
Browse files- pipeline.py +2 -2
pipeline.py
CHANGED
@@ -48,8 +48,8 @@ class PreTrainedPipeline():
|
|
48 |
# decode base64 image to PIL
|
49 |
image = Image.open(
|
50 |
BytesIO(base64.b64decode(inputs))).convert("RGB")
|
51 |
-
elif isinstance(inputs, Image.Image):
|
52 |
-
image = inputs.convert("RGB")
|
53 |
|
54 |
image = self.transform(image).unsqueeze(0).to(device)
|
55 |
|
|
|
48 |
# decode base64 image to PIL
|
49 |
image = Image.open(
|
50 |
BytesIO(base64.b64decode(inputs))).convert("RGB")
|
51 |
+
elif isinstance(inputs, "Image.Image"):
|
52 |
+
image = Image.open(inputs).convert("RGB")
|
53 |
|
54 |
image = self.transform(image).unsqueeze(0).to(device)
|
55 |
|