Unverified Commit cff78aa6 authored by Max Chuprov's avatar Max Chuprov Committed by GitHub
Browse files

fix bug when using PIL backend in references/classification (#7665)


Co-authored-by: default avatarMax Chuprov <m.chuprov@expasoft.tech>
parent 657027f3
...@@ -69,11 +69,10 @@ class ClassificationPresetEval: ...@@ -69,11 +69,10 @@ class ClassificationPresetEval:
backend="pil", backend="pil",
): ):
trans = [] trans = []
backend = backend.lower() backend = backend.lower()
if backend == "tensor": if backend == "tensor":
trans.append(transforms.PILToTensor()) trans.append(transforms.PILToTensor())
else: elif backend != "pil":
raise ValueError(f"backend can be 'tensor' or 'pil', but got {backend}") raise ValueError(f"backend can be 'tensor' or 'pil', but got {backend}")
trans += [ trans += [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment