Skip to content

Commit 2f1ee0b

Browse files
committed
Convert input image to RGB
This adds support for input images with different encodings. The classification version already does this: https://github.com/google-coral/tflite/blob/master/python/examples/classification/classify_image.py#L103
1 parent ce557ab commit 2f1ee0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/examples/detection/detect_image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def main():
9494
interpreter = make_interpreter(args.model)
9595
interpreter.allocate_tensors()
9696

97-
image = Image.open(args.input)
97+
image = Image.open(args.input).convert('RGB')
9898
scale = detect.set_input(interpreter, image.size,
9999
lambda size: image.resize(size, Image.ANTIALIAS))
100100

0 commit comments

Comments
 (0)