🐛 Bug
forward here checks for the filename attribute on a PIL image and will fail with ValueError: PosixPath('.') has an empty name if not present. This is the case if the PIL image is created from bytes. My hacky solution is below:
# read file
img_bytes = file.read()
img = Image.open(io.BytesIO(img_bytes))
img.save('/tmp/tmp.jpg')
# Reopen
img = Image.open('/tmp/tmp.jpg')
results = model(img, size=640)
To Reproduce (REQUIRED)
Run model(Image.open(io.BytesIO(img_bytes)), size=640)
Expected behavior
No failure if no filename attribute
Additional context
Previously referenced in #2246